#yonatan
1 messages · Page 1 of 1 (latest)
Can you share the Invoice Id?
in_1NG7R1CWcHXwVLZT4jNQpa3j
I see that I get multiple invoice events, one of them is invoice.paid, but the last one is payment_failed, which cause subscription cancellation on our side
the user reported the cash app shows a successful transaction
https://dashboard.stripe.com/events/evt_3NG7R1CWcHXwVLZT1gLiiVjB and https://dashboard.stripe.com/events/evt_1NG7R3CWcHXwVLZTJd0YOsvz is a set and I believe it's result of the PaymentIntent inside the Invoice, needed action from the customer. Later than that the customer may performed authentication in CashApp and the invoice.paid wast sent
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
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 think you can check further the PaymentIntent when you received invoice.payment_failed, and only to cancel the Sub if you also see the underlying PaymentIntent has status = failed
Why would status will be anything other then failed when receiving invoice.payment_failed?
How can I disable cash app?
Also, invoice.payment_failed is the last event sent, which means that eventually the payment failed
As you see on example above: when the PaymentIntent needs customer action to finish.
But it was finished, I received invoice.paid and then invoice.payment_failed
invoice.payment_failed was 2023-06-06 21:29:00, while invoice.paid was sent later, on 2023-06-06 21:29:17
in my logs I see something else, the last event was evt_1NG7R3CWcHXwVLZTJd0YOsvz
which is invoice.payment_failed
with status "open"
Yes, but don't you have evt_1NG7RJCWcHXwVLZTZXpXJN0C which is sent later?
It mean eventually the payment succeed and the invoice is paid
this event was last sent at 2023-06-06T21:29:17
and evt_1NG7R3CWcHXwVLZTJd0YOsvz was sent at 2023-06-06T22:28:37.600282Z
could it be that stripe is retrying an event, so it is received not in chronological order?
Sorry, where do you see this 22:28:37?
in my logs
this is when I received the webhook request
but let's drop it for now, I want to be able to fix our system according to how webhooks work
in case of subscription, which webhook indicate the payment is failed and I should disable the subscription?
https://dashboard.stripe.com/events/evt_1NG7R3CWcHXwVLZTJd0YOsvz was generated at 2023-06-06 21:29:00, and yes after a few retries it lands on https://api.gling.ai/payment/stripe/webhook at 22:28:38
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
So when you receive it, you should perform an additional API to retrieve the PaymentIntent under it
If the PaymentIntent status = failed, then you cancel the Sub
if the PaymentIntent status = requires_action (customer is still authenticating) or succedeed (the event was retried and the payment was actually succeded), then don't cancel
got you, thanks!
in payment intent status i don't see 'failed'
only 'canceled'
| 'processing'
| 'requires_action'
| 'requires_capture'
| 'requires_confirmation'
| 'requires_payment_method'
| 'succeeded';
so 'canceled' should be when the payment failed?
requires_payment_method I believe, as it will be back to that status
does this also applies for subscription recurring payment?
Yes