#varol-checkout-paymentintent
1 messages · Page 1 of 1 (latest)
varol-checkout-paymentintent
Checkout Sessions expire after 24 hours and then the PaymentIntent is canceled
but you can re-use the Session for as long as it's valid
otherwise you can just ignore the incomplete PaymentIntent
gotcha. i see it's possible to add checkout_session_id as a url parameter to the cancel url. i assume i can use that to retrieve the existing session and reuse.
any problems you see with doing that?
thank you very much for your help
I was just testing and it works https://example.com/cancel?session_id={CHECKOUT_SESSION_ID} for example
is it possible to form a new checkout url using the checkout_session_id or a call to retrieve will be necessary?
I don't understand what that could mean
The cancel_url is passed on creation. You don't know the id at that point. You use the magic value {CHECKOUT_SESSION_ID} so that when we redirect we replace with the correct id
So I see the checkout url looks like this:
https://checkout.stripe.com/c/pay/cs_test_a1uDSjlc1d8dcUYG2XNaySicbe1mYAyI2EHzQwnJSGSLNhxSZQ#fidkd...
the last part of the path has the session id. but simply using https://checkout.stripe.com/c/pay/cs_test_a1uDS... does not work.
so to get a checkout url to redirect the customer i have to do a request to /checkout/sessions/{session_id} and get a new url?
1/ Create a Checkout Session https://stripe.com/docs/api/checkout/sessions/create
2/ Redirect the customer to Checkout via the URL available in the url property
ok thank you very much for your help today
of course, do you feel you have all you need?
yes. the url thing i'll just trial and error to see if i can get it to work the way i need. not an important part. thank you again