#Martyn-checkout

1 messages ยท Page 1 of 1 (latest)

pearl escarp
#

hello, give me a moment to read up

cinder frost
#

Sure thing mate, no rush and thanks!

pearl escarp
#

Q - Is there a "clever" way to get the users stripe ID returned after the redirect so it can be stored in a DB table?

if you append {CHECKOUT_SESSION_ID} in your success_url, the CheckoutSession ID will be sent in the URL to your redirect page where you can grab it and send it to your backend to store it in your DB

cinder frost
#

Mate your a star thanks! I presume for the cancel, I can just pass in the checkout session ID from above as a parameter?

pearl escarp
#

no actually! You need to pass in the Subscription ID.

The CheckoutSession that is completed (assuming it is mode: subscription ) will have a subscription: sub_123 ID on it, so you should store that too.

#

and thanks for the feedback!

cinder frost
#

Great thanks mate - sorry just finding my way so apologies for the dumb questions.

Ive got one more if you can tollerate it... The above youve mentioned "will have a subscription: sub_123 ID on it" Can I ask if that is also appended in the URL, or if I have to make a seperate call to get it?

#

(unless im wrong @pearl escarp , and thanks again for your help!)

pearl escarp
#

Great thanks mate - sorry just finding my way so apologies for the dumb questions.
No silly questions, please continue asking ๐Ÿ™‚

#

Can I ask if that is also appended in the URL, or if I have to make a seperate call to get it

it would be a separate call, to fetch the CheckoutSession

or alternatively, you listen to webhook events for checkout.session.succeeded event

#

and that has the full CheckoutSession object in it