#jack_lim4

1 messages · Page 1 of 1 (latest)

balmy quartzBOT
#

Hello! We'll be with you shortly. Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.

grim marsh
#

Can you share the example Payment Intent (pi_xxx) with the behaviour you described?

frail dune
#

pi_3OWuYxFPBYgm0zl21xszEcJU

grim marsh
#

In test mode with dispute test card, the dispute will happen immediately to simulate disputed transaction. In the case of pi_3OWuYxFPBYgm0zl21xszEcJU, charge.dispute.created and payment_intent.succeeded events were created at the same time on 2024-01-10 05:48:07 UTC. Stripe doesn't guarantee event ordering in this case: https://stripe.com/docs/webhooks#event-ordering

In live mode, this is very rare, but may still happen if the customer raises dispute to the issuing bank immediately.

Listen for events on your Stripe account so your integration can automatically trigger reactions.

frail dune
#

Okay got it, so the best way is to fetch the charge to see if there's any dispute to confirm when this happens?

grim marsh
#

If the charge.dispute.* comes first, it means that the payment has been paid successfully, but a dispute happened. This can be logged in your system without additional check with Stripe. When payment_intent.succeeded event comes later, your system would have known a dispute is raised

frail dune
#

I see, currently my system is updating my DB invoice status to "paid" if payment_intent.succeeded webhook event is received

So I think I could update my DB invoice status to "disputed" if charge.dispute.* webhook event is received. When payment_intent.succeeded webhook event is received, instead of updating the invoice status to "paid" mindlessly, I should check if my DB invoice status is "disputed", and only update to "paid" if it's not

#

Does this makes sense?

grim marsh
#

Yes, this sounds right to me

frail dune
#

Okay, thank you river!