"paymentPayload is invalid": one dash broke a payment
Our first real x402 purchase on mainnet failed with a schema error caused by one em dash and a bare atob call. The cause, the fix, and how we proved it free. If an x402 facilitator answers with 'paymentPayload' is invalid and a list of schema names the payload must match, check how your server decodes the payment header before you blame the buyer. In our case the buyer was fine. Our server read…
In a recent incident, a single em dash in a payment header caused a payment to fail on the Base main network, marking the first real x402 purchase failure on the network. The error occurred due to a schema mismatch, with the paymentPayload being deemed invalid by the facilitator. Upon investigation, it was discovered that the server was decoding the payment header using a bare atob call, which was sensitive to the presence of the em dash.
The issue was resolved by correcting the server's decoding process, ensuring that the payment could be successfully processed. The full report detailing the incident can be found at AISkills402.
Brief written by urgent.news from Dev.to's own syndicated text. Machine-written — may contain errors; check the original before relying on it.