#jasperste-checkoutsession-metadata
1 messages · Page 1 of 1 (latest)
jasperste-checkoutsession-metadata
@sick mica that's mostly impossible. You can't "update" a Checkout Session after creation. So you'll have to mostly track this in your own database/on your end really
(If there is a way). We also considered creating different checkout sessions for each way, however that would give us the risk of orders being paid twice. Since you can't create a checkout session for one paymentIntent
you can always cancel the first Session before creating the new one for example
But there's no way to re-use the Session and update its settings
Thanks. That's what we were afraid of indeed.
The documentation around checkout session is a bit confusing, stating: We recommend creating a new Session each time your customer attempts to pay. . An attempt to pay can mean multiple things, it could be trying again in a different browser/device and the same order or it could mean for a different order in general.
Could you specify that? Since we do the latter, but the first might be closer to something we want to achieve (if done correctly)
I'm not sure I really grasp what you are trying to answer. I think it depends a lot on the situation. Checkout Sessions are ephemeral and automatically expire after 24 hours so it's meant to indicate that if the customer leaves your app/website and comes back hours later it's best to just create a brand new Session for their payment attempt
Isn't there a risk of double payments if you do not cancel the first session? Or are we thinking to defensive there? Could be that this is not really an issue normally
yes the assumption is that you would cancel the first session in that case
Thanks
We mainly trying to figure out how to handle for example customers who start a payment via desktop and customers starting a payment via a mobile phone. If we should create a seperate session or reuse the same one.
And if we use the same one determine on what device the payment was finished when receiving the paid event.
whether to reuse the same one or not is up to you. And there is no way today to track where they came from other than doing it in your own systems if you re-use the same Session
How is it not up to us if I may ask? We have full control over the created checkout sessions
I said it is up to you, I think you misread my sentence
hether to reuse the same session or not reuse the same session, is up to you
Haha, sorry about that!
all good, that was weirdly worded
The problem you have is that if you have a Session URL valid for 24 hours and then a customer, from any device, can click a button and get to that URL to pay, then you can't track in Stripe which device they come from as there's no API to "update" the Session to indicate that
so the only way would be to either track this in your own database, or create different Session(s) (and cancel the previous one to avoid double payments)