#gracine

1 messages ยท Page 1 of 1 (latest)

green thicketBOT
light river
#

hi! not sure I follow completely, a subscription can not change currency at any point โ€” it will charge in the currency that corresponds to the Prices you pass in when creating the Subscription and you aren't able to change it to use Prices from other currencies I believe. So I'm not quite sure I follow your case, do you have an example?

royal zodiac
#

Ok, let me explain the use case

#

we have a classic subscription with free / premium with 4 different currency that you can select (CAD, USD, EUR, GBP)

#

The price of the premium product has matching 4 currency prices

#

The Stripe integration is a new feature and is not yet in production

#

So we have existing users that I need to migrate to Stripe. Currently all users are on a special promo that let them use premium free for 1 year

#

So I wrote a script using a SubscriptionSchedule, respecting the free promo in the first phase by using a 100% free coupon, the end date of the phase 1 is when the user's account creation date + 12 months ends,

#

At this point I remove the coupon and they start to pay

#

my issue is with currency, my script does not have any context so I default to USD

#

but a user might be in EUR, he does not want to be charged in USD its going to be wierd

light river
#

my script does not have any context so I default to USD
that's what I don't follow. When you create the Schedule you pass something to phases.items.price , which is a Stripe Price object ID, which has a currency. So you know the currency of the subscription.

royal zodiac
#

Yes the price object is configured with a USD, CAD, EUR and GBP currency

#

But my script loops on all users and assign this price to a new subscription, I just don't know which currency the user should have

#

I imagine some kind of scenario where when the payment become past_due (phase 2), I present in the UI a mandatory currency selection screen ?

light river
royal zodiac
#

ahah, yes

light river
#

ultimately there is a default currency

royal zodiac
#

well, the issue would be somehow the same with 4 different prices with single currency

#

yes

#

I default to USD

light river
#

you do have to pick one

royal zodiac
#

ok so I am screwed

#

i must know the currency in advance

light river
#

so really sounds to me like you need to decide ahead of time what currency makes sense for the customer when you create the schedule

#

I would say yes, you do

#

not sure how else this could work

royal zodiac
#

So the only option for me would be what I mentionned : I imagine some kind of scenario where when the payment become past_due (phase 2), I present in the UI a mandatory currency selection screen, at this point I could update the subscription schedule and change the default USD currency to the one the user have choosen

light river
#

you can't change the currency on an existing subscription though

royal zodiac
#

ah..

light river
#

so you can not
create a schedule
schedule create a subscription
some payments on the subscription fail
you handle that and update the currency

that's simply impossible

royal zodiac
#

but could I cancel the subscription (since never really paid/started) and resubscribe to the same price with new currency

light river
#

maybe you instead cancel the existing subscription when that happens and start or schedule the creation of a new one, but that seems like really the wrong approach and really tricky.
Really the only and best solution here is you know what currency your existing customers want at the point in time when you're doing this migration.

light river
royal zodiac
#

If I cancel in advance (still in phase 1), and then update, will the customer be notified ?

#

because the email notifications are not testable

light river
#

it really depends on the specifics of the exact schedule

#

ultimately I think the answer is you need to decide the currency in advance, I can't see any other approach.

royal zodiac
#

ok

#

thanks

#

Also 2 small questions

#

1 - Is there a way to not collect taxes but only for some currencies, we are based in Canada and we do not want to collect taxes for other country it will be too much business overhead for us

#

(we use the Stripe checkout )

#

2 - Is there a way that the customer can cancel immediatly using the billing portal ? because when we cancel a yearly plan it waits for the end of the year

lyric rivet
#

Hi! I'm taking over this thread.

#

1 - Is there a way to not collect taxes but only for some currencies, we are based in Canada and we do not want to collect taxes for other country it will be too much business overhead for us
Are you using Checkout Session with automatic_tax?
2 - Is there a way that the customer can cancel immediatly using the billing portal ? because when we cancel a yearly plan it waits for the end of the year
You mean for customers to cancel their subscriptions with the portal? Then yes, it's possible as mentioned here https://stripe.com/docs/customer-management#customer-portal-features

royal zodiac
#

For 1, i do not specify it so it should use automatic

#

for 2, thank you I did not read this

#

And by the way, I think I found a solution for my initial question (missing currency context in my migration script)

lyric rivet
#

For 1, i do not specify it so it should use automatic
I'm not sure I understand. How are you currently collecting taxes? Can you share an example of a Checkout Session ID?

royal zodiac
#

session_params = {
mode: 'subscription',
payment_method_collection: 'if_required',
# allow_promotion_codes: false,
client_reference_id: user.account.account_id,
currency: @currency,
line_items: [{
quantity: 1,
price: billing_product_price.stripe_id
}],
success_url: Rails.application.config.welcomespaces_uri + "/app/dashboard?has_changed_plan=#{@has_changed_plan}",
cancel_url: Rails.application.config.welcomespaces_uri + '/app-signup/plans?checkout_cancelled=true'
}

#

after i either specify the customer or customer_email

#

and then

#

session = Stripe::Checkout::Session.create(session_params)

#

this is how I create a checkout session

lyric rivet
#

Got it, so you are not collecting taxes currently?

royal zodiac
#

I am finishing the integration, i am only using test data

lyric rivet
royal zodiac
#

so I must specify automatic_tax: true, I tough it was the default

#

got it

lyric rivet
#

so I must specify automatic_tax: true, I
Yes
I tough it was the default
No it isn't.

royal zodiac
#

ok

#

so I guess since I pass the currency to use from the front end to backend, I could simply set automatic_tax: @currency == 'CAD'

#

then we will only collect canadian charges

lyric rivet
#

Yes that should work.

royal zodiac
#

ok

lyric rivet
#

Wait, it needs to be automatic_tax: {enabled: true/false}

royal zodiac
#

ah

#

got it

#

thx

#

And to conclude on my original question, missing currency info at my migration script from non stripe user to stripe subscribed customers

#

What I will do is:

#
  • Subscribe each users to a price in 'USD' with a 100% free coupon applied
#

Instead of creating a second phase to my SubscriptionSchedule that will remove the coupon

#

I will set the end_behavior to cancel

#

the user will because free and will have to register on our subscription page where the currency must be choosen

#

That would work

#

Not sure if a subscription schedule is relevant at this point if i have only 1 phase

lyric rivet
royal zodiac
#

ok! great!

#

merci beaucoup

#

have a great day