#jack11sparrow
1 messages · Page 1 of 1 (latest)
Hello 👋
The Subscription doesn't get created until the checkout is completed
So the creation request won't have a subscription ID
ohkk, so we have somehing like
we create a checkout session from backend then ui uses link from that to show to customer and he pays
after that ui needs access to the subscriptionID
how can we do that
You can retrieve the Checkout Session Object on redirect, more info here
https://stripe.com/docs/payments/checkout/custom-success-page
how will i set subscriptionID at time of checkout session generation if i don't have it at that point of time
You can't really "set" a subscription ID.
As I mentioned above, you won't have access to subscription ID until the completion.
You can retrieve the Checkout session once it has completed and is redirecting to whatever success_url you set
@fleet marsh
me and @kind path are working together on the above integration. So, what you are suggesting is make the checkout session, complete the payment, then using the success-url providing the checkout-session id, retrieve the checkout session object and extract values from that?
Correct
Because there won't really be a subscription in existence until the checkout session is completed
Its the same with one-time payments for payment-intent also, am I correcT?
Correct
One final doubt,
{CHECKOUT_SESSION_ID}
so my success url will be sometrhing like
abc.com/?session_id={CHECKOUT_SESSION_ID}
Where I dont replace checkout_session_id value as its automatically replaced by stripe
Yup
Thanks hanzo, we will quickly implement it and le you know if we face any problems