What happened.
When a customer pays, renews or cancels, the payment provider sends a message to the company's system so the account can be updated. The company had recently put a new security layer in front of its application. After that, accounts stopped updating: customers who had paid still looked unpaid.
What we found, and the technical detail
The provider's dashboard showed every message failing with an 'unauthorised' error. One developer suggested switching the check off to get things moving. That would have let anyone on the internet send a fake 'payment received' message.
Every message from the provider carries a signature: a tamper-proof stamp worked out from the exact content of the message. The company's code checked the stamp against a slightly different version of the content, one that had been tidied up on the way in. A stamp checked against tidied-up content never matches.
The check was working properly. It was looking at the wrong thing. So the fix was to make it look at the right thing, and to leave it switched on.
Technical detail. The signature is an HMAC of the raw request body. The web framework parsed and re-serialised the JSON before the handler calculated the HMAC, so spacing and key order differed from what the provider signed. We moved verification ahead of parsing, calculated it over the exact bytes received and compared the result in constant time.