#dong_66093
1 messages · Page 1 of 1 (latest)
Hello dong_66093, we'll be with you shortly! Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
• https://discord.com/channels/841573134531821608/1164516554826854441, 0 days ago, 10 messages
A Checkout Session will create the subscription after the payment on it has been completed. After the subscription has been created, you can make the normal calls on that subscription to pause payment or retrieve it
The ID will be on the subscription object once checkout is completed https://stripe.com/docs/api/checkout/sessions/object#checkout_session_object-subscription
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
And you can listen to the checkout.session.completed event to listen for that happening
yes ,I have got this session .However ,when I tried to retrieve the subscription with the session'id ,I got error :No such subscription:cs_test_a1VItOPJ9Q81brbbmVX3LEnfp6whQHAYg186Pc7tdpoJjNXIJcfkD1DSls"
Have no idea where can I get the subscribeId,like format:"'sub_1XXXXXXXX'"
I think I GOT IT ,"subscription": "sub_1O30jSImZeQYXOtGdMArw7TN", ... I have just found it in the doc ,thanks a lot bro !
!
cs_test_a1VItOPJ9Q81brbbmVX3LEnfp6whQHAYg186Pc7tdpoJjNXIJcfkD1DSls is a Checkout Session, you will need to retrieve it via the Checkout Session endpoint https://stripe.com/docs/api/checkout/sessions/retrieve
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
I have tried ,still have an issue ,which is I will need to unsubscribe at a specific date ,how can I do it ?Such as : await stripe.subscriptions.del(subscribeId, {
cancel_at: canceledDate.getTime() / 1000, // 使用 Unix 时间戳
});
Close. The del function is for cancelling the subscription immediately. To set up a future cancellation, you will want to set cancel_at in the update function https://stripe.com/docs/api/subscriptions/update#update_subscription-cancel_at
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.