#atul
1 messages ยท Page 1 of 1 (latest)
๐ Thanks for reaching out
Could you please share more details about what you are trying to achieve ?
I have to handle payment falure
I want to listen to subscription.updated event
I need confirmation what would be the status when payment fails
If automatic payment fails, the subscription updates to past_due and Stripe attempts to recover payment based on your retry rules. If payment recovery fails, you can set the subscription status to canceled, unpaid, or leave it past_due.
https://stripe.com/docs/billing/subscriptions/overview#failed-payments
If payment fails because of a card error, such as a decline, the status of the PaymentIntent is requires_payment_method and the subscription is incomplete
This is the line from stripe docs only
which one is correct ??
Your docs is quite confussing
There is no exact solution
PLease let me know the possible work around
Somewhere in docs it mentioned to listen to subscription.updated event
at other place its mentioned to listen to invoice.payment_failed
Here, once the first payment attempt failed then the created subcsription status is incomplete. However, if the subscription is already created and first/previous payments were made successfully, then an automatic payment fails, then the subscription passes to past_due
I invite to check the diagram in this section:
https://stripe.com/docs/billing/subscriptions/overview#subscription-lifecycle
ok,
If subscription is created, and payment is not made even once subscription status will chnage to incomplet after unsuccessful payment
I have subscription model
I use stripe's checkout to create subscription, so sbscription is created only after successful payment only
Now, I need to maintain the reason for failure of automatic payment failure
Is it enough to listen to invoice.payment_failure
Yes. and that's what we recommend:
https://stripe.com/docs/billing/subscriptions/webhooks#payment-failures
yes you can using stripe cli:
stripe trigger invoice.payment_failed
https://stripe.com/docs/cli/trigger
No, you need to create a new Customer object
My requirement is I want to create customer with test clock enabled
ok
new invoice will be generated at end of every billing cycle
suppose payment is failed so subscription will go to past_due,
Suppose 2 billing cycle is passed away and no payment is recieved from customer, In that scenario new invoice will be generated every month ??
That depends on how your account is configured to handle failed payments: https://dashboard.stripe.com/settings/billing/automatic
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
I have recieve invoice.payment_failed event, where can i find the reason for payment failure
If all retries for a payment fail than i have setting to mark subscription as unpaid
You'd look at the related payment_intent on the Invoice: https://stripe.com/docs/api/invoices/object#invoice_object-payment_intent
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Then yes, we'd continue to generate an invoice for each cycle: https://stripe.com/docs/billing/subscriptions/overview#unpaid-subscriptions