#Dhaval
1 messages · Page 1 of 1 (latest)
"sub_1LmybjBlLQmfoqiATFnLYtNL" this is my subscriptionId
Could you explain what you would like to achieve?
my payment was failed now it is in retrying mode
i want date in which payment get failed
but in currentperiodend i got next payment date instead of failed date
when I retrieve subscription how can i know that my payment was failed
When an invoice payment is failed every time, Stripe will send invoice.payment_failed event. For example, https://dashboard.stripe.com/test/events/evt_1LyESYBlLQmfoqiAieEyzvLV
You can use the event timestamp to determine the invoice payment failure of a subscription.
In subscription object which param i need to use to get invoice payment failure?
bcz i want to show in my app like payment was due for 1 day or 3 day like that
invoice.payment_failed event throw one time but when my app call getdetails at that time i have to pass actual data of failure
There's no straightforward way to do it. One way I can think of is to:
- Get the PaymentIntent ID in latest invoice from the subscription with expanding
latest_invoice: https://stripe.com/docs/api/subscriptions/object#subscription_object-latest_invoice - List the charges from PaymentIntent: https://stripe.com/docs/api/charges/list#list_charges-payment_intent
The list of charges are the attempts to make payment.
Alternatively, I'd recommend storing the timestamp of failed invoice payment once you receive invoice.payment_failed event. Then use those stored timestamps to display to your customer.