Debugging a Worldpay MD5/EMV signature mismatch
How a rejected Worldpay payment on a live checkout was traced to the exact fields being signed, and the structure that keeps it fixed.
Client case studyPublished Updated 2 min readBy Muhammad Idrees

Payment bugs are rarely solved by staring at the final error message. What works is rebuilding the exact signed payload, field by field, until you can show that the application and the gateway are signing the same thing.
The symptom
The Stainless & Aluminium checkout flow had a signature mismatch around Worldpay MD5/EMV handling. The visible checkout data looked reasonable, but the gateway rejected the request because the signature did not match the payload Worldpay expected.
A checkout can look perfect to the customer while the payload built on the server is slightly wrong. So the debugging here was about the exact values that went into the signature, and the form on screen was only a starting point.
The debugging path
I treated the signature as something to reproduce. I isolated the fields that make up the MD5 input, then confirmed their order and formatting, then compared the values that differ between environments: installation IDs, currency, amount formatting, callback URLs, and how the shared secret is used.
I prefer to build this logic on the server. That keeps secrets out of the browser and makes it easier to add safe diagnostic logging for non-secret fields while the issue is being tracked.
The failure points worth checking
The usual causes of a mismatch are dull ones, and they get missed for that reason: an amount sent in pounds instead of minor units, a field included in one environment and not another, a callback URL that differs by a trailing slash, or a string encoded differently before hashing.
EMV fields add another layer, because they can change the signed payload without changing anything a product owner sees on screen. Guessing does not help here. Print a comparison trace with the secret left out, and reduce the signature to input that comes out the same every time.
A safer structure for checkout code
The checkout should have a single server-side function that builds the Worldpay payload, a second function that signs it, and tests or fixtures for known payload examples. That structure makes future gateway changes less fragile and makes payment failures easier to isolate.
If you are dealing with a similar integration problem, start with an API and checkout integration review rather than rewriting the whole checkout from scratch.
Where to go next
- APIs and third-party integrations
Typed contracts at the boundary, a fallback for every third-party call, and secrets kept on the server.
- See the live client sites
Client sites in the UK and UAE, each linking to the site the business runs on today.
- Tell me about your project
Describe the site or app you need. I reply within one business day.
Questions
- How do you debug a payment signature mismatch?
- Rebuild the exact payload that gets signed, field by field, with the secret left out of any logs. Check the order and formatting of the fields, then compare the values that change between environments: amounts in minor units, currency, installation IDs, and callback URLs.
- Should payment signatures be generated in the browser?
- No. Generate them on the server, so the shared secret never reaches the browser and the signing code can be tested and logged safely.
Need a website that brings in customers?
I reply within one business day. Website builds typically start at £750. Or get a free teardown of your current site