Why does this PHP retry charge customers twice?

Why does this PHP retry logic charge customers twice in production. The PHP code retries a payment call after a timeout without an idempotency key, so the gateway processes duplicates. In PHP billing services this creates double charges and refunds.

#whatswrongwiththisphpcode #phpbug #phpproductionbug #phpdebugging #phpbackend #phpcodereview #phpsecurity #phpperformance #phpreliability #phpapi #phpw...

https://www.youtube.com/watch?v=rITaVoDHgWY

Why does this PHP retry charge customers twice? #phpapi

YouTube