#Tiana-portal

1 messages · Page 1 of 1 (latest)

inner wolf
heady lava
#

And if not, how can I allow the customer to select a product while automatically cancelling the previous one as soon as the new one is paid ?

inner wolf
heady lava
#

Alright, will this automatically cancel the previous product ?

inner wolf
#

so if you don't want them to change products you'd only allow updates to be to other prices in the existing product by having a single entry in that array

#

not sure what 'cancel' means, but it switches the subscription to the new product yes

heady lava
#

That's what I meant, yes. Thanks

#

Okay, turns out my boss don't want that in terms of UX in the end.
So here's another question : is it possible to create a checkout session which, once paid, will switch an existing subscription to a new product ?

inner wolf
#

no it's not

heady lava
#

Yes.
How do I do that ?

inner wolf
#

do what exactly? I kind of explained it above

heady lava
#

I mean what API endpoints can I use ?

inner wolf
#

the ones the docs I linked describe.

heady lava
#

Can a customer create a subscription with a different currency from previous subscriptions ?

inner wolf
#

they can't , customers in Stripe have a currency lock unfortunately

heady lava
#

Why not ?

inner wolf
#

it's just a limitation that's always existed unfortunately! it's basically because of things like how a customer's debit/credit balance and amount_off coupons at a customer level could work

#

it's a really common pain point over the years and something we're actively looking at redesigning, but for now it is what it is.

heady lava
#

Ok

#

So, if I need to create a new Stripe customer because our app user want to switch currency, can it be created with the same email ?

inner wolf
#

yep! they don't have to be unique across all customers, we don't enforce that.

heady lava
#

Alright, does the dashboard allow my boss to retrieve all the data of an app user that has mutliple Stripe accounts with the same email in a single place ?

#

If not, how difficult is this to manage ?

inner wolf
#

you could create a few test customers in test mode with the same email and play around with it yourself to see

#

you can filter customers by email in the dashboard yes, for example.

heady lava
#

Okay, thanks.

heady lava
inner wolf
#

yep but if you test this out it should naturally flow a little.
After you update the subscription, there might be an invoice generated(depends on the type of the update and what value you pass to payment_behavior ), it would be the latest_invoice field on the Subscription object. Invoices have a hosted_invoice_url https://stripe.com/docs/api/invoices/object#invoice_object-hosted_invoice_url and you can redirect the user to that to pay that invoice which was generated for the update. https://stripe.com/docs/invoicing/hosted-invoice-page

heady lava
#

I don't know about payment_behavior but I pass proration_behavior to always_invoice. What should I do about payment_behavior ?

inner wolf
#

oh yeah it's proration_behavior true, my bad. Just a typo.

heady lava
#

Alright !

inner wolf
#

though you can use payment_behavior too, it's for pending updates

heady lava
#

How do I redirect the user back to my app when using hosted_invoice_url ?

inner wolf
#

you can't unfortunately

heady lava
#

What do I do then ?

inner wolf
#

well you just don't redirect. It depends how important this is to you. There are alternatives.

heady lava
#

What alternatives are there ?
Also how do I set the locale of hosted_invoice_url ?

inner wolf
inner wolf
#

ok!

#

as far as I know the locale comes from the customer's preferred_locales but I'd have to test it, it might also just be based on the browser you view the page in.

heady lava
#

What's the type and format of preferred_locales ?

inner wolf
#

it's an array of strings of ISO 639 language codes like ["en","fr"]

heady lava
#

Okay.