#yonatan

1 messages · Page 1 of 1 (latest)

woven zephyrBOT
dreamy depot
#

Can you share the Invoice Id?

white moat
#

in_1NG7R1CWcHXwVLZT4jNQpa3j

white moat
#

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

dreamy depot
#

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

#

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

white moat
#

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

dreamy depot
#

As you see on example above: when the PaymentIntent needs customer action to finish.

white moat
#

But it was finished, I received invoice.paid and then invoice.payment_failed

dreamy depot
#

invoice.payment_failed was 2023-06-06 21:29:00, while invoice.paid was sent later, on 2023-06-06 21:29:17

white moat
#

in my logs I see something else, the last event was evt_1NG7R3CWcHXwVLZTJd0YOsvz

#

which is invoice.payment_failed

#

with status "open"

dreamy depot
#

Yes, but don't you have evt_1NG7RJCWcHXwVLZTZXpXJN0C which is sent later?

#

It mean eventually the payment succeed and the invoice is paid

white moat
#

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?

dreamy depot
white moat
#

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?

dreamy depot
#

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

white moat
#

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?

dreamy depot
#

requires_payment_method I believe, as it will be back to that status

white moat
#

does this also applies for subscription recurring payment?

dreamy depot
#

Yes