
In plain words
Pressing a lift button five times calls the lift once. That button is idempotent. A "pay" button that charges you again on every tap is not, and that is exactly what payment code must never be.
In practice
Networks repeat messages: a customer taps twice, a provider resends a callback. Make every step safe to repeat: record a unique ID for each request, check the current state before changing it ("is this payment still pending?"), lock the row while you change it, and add unique keys in the database as the last line of defence.
See Accept M-Pesa payments in Laravel.

Every lesson stays free. Tap the thumbs up so we know what works, or say thanks with a soda or a coffee: it pays for hosting and new lessons.


