#Sophia Wong

1 messages · Page 1 of 1 (latest)

pine yokeBOT
halcyon hawk
#

Hi there. So you want to create a PaymentLink for subscriptions?

quaint wasp
#

Yes. Both for a new subscription scenario and a renew scenario. Just now I tried to create a checkout session with subscription mode, but got empty subscription_id in return data.

halcyon hawk
#

Is the checkout session completed?

quaint wasp
#

no. I cancelled it. So it's the reason? If user cancels a checkout session payment, there'll be no subscription created?

#

I'm still working in these APIs and Docs to find my way. Thank u for ur response. I'll leave messages if there're more problems.

halcyon hawk
#

Yes you are right, Stripe won't create a subscription if the checkout session is cancelled.

quaint wasp
#

Well, here is my problem, how can I get the subscription_id from a checkout session object. I dumped it but the attribute 'subscription' is empty.

#

Sorry I have to left for about 2 hours. See you later.

halcyon hawk
#

You should listen to checkout.session.completed event and get the subscription ID upon receiving the event.