#_best-practices
1 messages ¡ Page 1 of 1 (latest)
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.
- _best-practices, 15 hours ago, 8 messages
- _best-practices, 16 hours ago, 10 messages
đ Welcome to your new thread!
â˛ď¸ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
âąď¸ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
đ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1220541968187134004
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
In response to a related question I received yesterday, I realize that the debit payment method and subscription mode are not compatible. But our team need to integrate this method.
Here is the link to that question
#dev-help message
As my colleague mentioned the Subscription is built that way. I can double check if you provide an example Subscription Id in Test Mode
To share a little more details about my current test situation, I tested webhook handling with a card that completes payment processing after 3 minutes, and I saw that a subscription was created for the customer who tried to pay before the processing was complete. At this point, the Payment and Invoice were in pending status, but the Subscription was active. I'm a little confused by this - it doesn't make sense that the subscription is active when the payment hasn't been fully processed.
Is it correct that the subscription is active because the information received through the delayed webhook is delayed in updating stripe from the bank, so it's pending, and the money is actually gone from the customer's end?
Sure.
This one is what i made.
sub_1OwwMJIVqSKgy6N9Fx1YNT5D
Yeah I think it's what it's. If you create a Subscription using API maybe you can change its payment_behavior to default_incomplete for example https://docs.stripe.com/api/subscriptions/create#create_subscription-payment_behavior
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
But you are using Checkout
Yes, we are using stripe hosted checkout session and hadling webhook in our server. In this case, is ther any best practice case for handling subscription status?
There is another way that you could use Checkout in Setup mode to collect a PaymentMethod beforehand, then only after it succeeded, you use it to create a Subscription
If I understand correctly, check the status of the payment_method via the setup_intet id of the Session object in the session.completed webhook and if it is pending, then updates the payment_behavior of that customer subscription to default_incomplete?
No you can just ... not creating the Subscription yet. Only create the Subscription if you receive checkout.session.async_payment_succeeded
Once a subscription is active, can't it be changed to past_due status via update?
No you can't touch its status directly
If its payment fails, it will automatically change to past_due
It's more of an automatic engine
I see..
Yeah , i want to make subscription only when i get checkout.session.async_payment_succeeded but stripe make subscription to active automatically when customer put their info of debit card and submit in the checkout.
I didn't understand the Setup mode you described very well, can you explain this a bit more in detail?
Sure, when you create a Checkout Session, you got a mode parameter, right? Set it to setup instead of subscription
Okie, now after confirm you will have setup_intent.succeeded webhook event
I think I need to learn a bit about setup intent mode, but I'll check the documentation for that. Can you continue with the explanation?
Hey sorry, I think the Doc could explain better than me: https://docs.stripe.com/payments/save-and-reuse
Basically you will create a SetupIntent via Checkout Session
Then separately, after that, using the collected PaymentMethod to create a Subscription