A customer pays $49. Your Laravel app records the payment. The webhook response times out, so Stripe retries. Your app records another $49 payment.
Now your sales report shows $98, and the customer has two receipts. Stripe collected $49. Where did the extra $49 come from? Your webhook handler treated the retry as a new payment.
Use the payment ID as your business key
A Stripe event ID identifies a notification. A PaymentIntent ID identifies the payment this example records. You can log event IDs to spot retries, but the rule your database needs to enforce is one payment record per PaymentIntent . That also protects the handler if two different event IDs refer to the same successful payment. Stripe’s guide to duplicate webhook events
Make the database enforce it
This example assumes one Stripe account and one PaymentIntent per order. Save the PaymentIntent ID on the order when your server creates it, and add a unique index to orders.stripe_payment_intent_id and payments.stripe_payment_intent_id .…