#Muhammad Awais - pay invoice
1 messages ยท Page 1 of 1 (latest)
It sounds like you will want to go through our "Build a subscriptions integration" guide if you have not already. It shows you how to collect a user's payment information and pay the first invoice with it https://stripe.com/docs/billing/subscriptions/build-subscriptions?ui=elements
Yep, the Subscription has a latest_invoice property and that invoice has a payment_intent
When creating the Subscription, you can pass an expand parameter of latest_invoice to be able to access that ID from what is returned in your subscription creation call https://stripe.com/docs/api/expanding_objects#expanding_objects
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
ok
What happens if subscription stays incomplete?
The subscription will stay incomplete for 23 hours and then will be automatically cancelled if its first invoice has not been paid https://stripe.com/docs/billing/subscriptions/overview#subscription-statuses
So if the customer wants to subscribe again after that point, you will want to create a new Subscription object and have them pay the first invoice on the new subscription
what if it's renewing?
incomplete only applies to subscriptions that have just been created. If a renewal payment fails, the Invoice will go to a past_due status and your account's settings determine what happens from there https://stripe.com/docs/billing/subscriptions/overview#settings
This section is also helpful https://stripe.com/docs/billing/subscriptions/overview#failed-payments
Do you know how you want your integration to respond to missed payments?
I have already set an email for invoice payment failed webhook I think it will cover that?
Those can certainly help prompt your customer to fix their CC details and make the payment. You can also set what status stripe changes the subscription to after our retries failed. I'm guessing you are having the subscription cancel automatically at that point?
I'm guessing you are having the subscription cancel automatically at that point?
I was not aware of this, Will check now thank you
Can we set both connect webhook and direct webhook at same url?
I mean I don't want to have two different configs.
I just want one webhook secret for both ends
๐ that's technically possible but not recommended. the number of events you'll receive may be overwhelming and there isn't a single value in the event that can definitively tell you whether the event is related to connect or not
I think if event is from connect account then event will have account id in payload['account'] ?