#Henrik Rasmussen-checkout-subscription

1 messages ยท Page 1 of 1 (latest)

smoky river
#

Which request times out? What specifically happens from start to finish? (feel free to post a video of what you're seeing too)

carmine night
#

Hi @smoky river - thanks for responding.
It is very simple (still) as I call one function for all my checkout sessions.
I pass along the price id and a mode param, which is either "payment" or "subscription".
If I call for a payment the call to createCheckoutSession succeed ut if I call for a subscription it fails.
When it fails the error object is "Timeout while waiting for session response"

#

I am using still very few param, here is my call

createCheckoutSession(payments, {
mode: modeId,
price: priceId,
collect_shipping_address: true,
success_url: window.location.origin + "?goto=shop",
cancel_url: window.location.origin + "?goto=shop",
shipping_address_collection: {
allowed_countries: ['JP'],
},
})

smoky river
#

If not, are you able to do a console.log() after the Checkout Session is created to see what (if anything) is being created?

carmine night
#

Ths very helpfull and makes sense. I originally had a subscription in one currency (sek) and now all products are in JPY....

#

and one customer 2 currencies is a nogo apparently

#

wonder how I get rid of that problem, starting out in sek was a mistake....

smoky river
#

Ahhh, okay. Did you figure out where it was going wrong?

#

There are a few places a currency could be declared, so I'm unsure what to advise from here without more details

carmine night
#

The full error message is:
You cannot combine currencies on a single customer. This customer has had a subscription, coupon, or invoice item with currency sek

smoky river
#

That makes sense. You'll have to figure out what currency to present at each given Checkout Session

#

Not sure if that helps or not, but feel free to reply with any specific questions and I'm happy to assist

carmine night
#

I am still not live, still testing. Is there a way I can reset my user, so that sek invoice does not block future purchases which are (for now) all in jpy?

#

and why can I do purchase in jpy but not subscription?

smoky river
#

Did you ever find a request ID for the request that is giving you an error?

#

I'm curious about this myself, as I didn't think we enforced a single currency on a customer-by-customer basis, but rather I would expect that on the Subscription itself

carmine night
#

sorry - here it is
req_N0SMz0CZJr2ofS

smoky river
#

Ah, interesting. So I guess it is indeed set on the customer object, but that only applies to recurring products. One-off payments would still be supported in other currencies

#

There's no way to update the currency, so you would have to create a new Customer for the new JPY Subscription

carmine night
#

what happens if I delete this customer?

smoky river
#

Any subscriptions they have currently active will be cancelled and that Customer object will cease to be usable. So you'd still have to recreate the Customer with the new currency, but you'd just be doing it without the presence of a duplicate Customer

carmine night
#

THanks - I do not dare deleting the customer - but I will create a new one and test my code using that one....

#

It works fine

#

It got me worried for a bit.

#

I was unhappy about the error I got back, had it stated the cause, life would have been better

#

But that is history now ๐Ÿ™‚

#

THanks for your help

smoky river
#

My pleasure! Glad to assist

carmine night
#

Thinking ahead, once I do get to having customers in 2 countries, how to manage which prices to show who?

pine mountain
#

HI ๐Ÿ‘‹ @smoky river had to step away so I'm taking over. Can you give me a summary of your overall question?

carmine night
#

We found out, that subscriptions for a customers should always be in the same currency. This is OK for me for now, as I focus on Japan for now, but what happens when I add another country.

No real question here, just thought on the future ๐Ÿ™‚

#

Any good articles about this?

#

Gotta run, getting late here, I shall revert with these question later

pine mountain
#

Which is unfortunately just "don't do that"

#

Sorry for the delay

carmine night
#

thanks anyway