Integration and Testing

Authorize.Net API questions and help with your payment integration.

Posts: 12
Registered: ‎01-31-2019

Re: Sha-512 hash mismatch

@Renaissancemany thanks


As someone's post mentions, we just need to know how is encoding the strings before carrying out the hash calculation.



All Star
Posts: 733
Registered: ‎11-05-2018

Re: Sha-512 hash mismatch


It is a url encoded post request, I am pretty sure. There is no easy way around it. What I did is take the raw post data and convert it, character for character. It was a sort of fun exercise and then the person who asked me didn’t want to buy it. I had hoped to get some cash out of it, as I know of no one else who figured out how to do this. I spent 4 hours on the below, about 2.5 of which was trying (in futility) to find a way to validate an uppercase Lithuanian I reliably. That one is a wild card and if your customers use that it is likely to break your validation process. I could modify the below script to validate such responses, but god knows how long it would take me. It would have to be some sort of iterative process testing scenarios. Pretty much all of the remaining characters can be converted. Disclaimer: I have tested this script on responses containing every single diacritic character except the lith I. I have also tested on a host of mixed bag requests with dozens and dozens of these characters. It has worked on them all. I cannot guarantee that there is not some permutation or combination of these characters that will throw this off. Every request I made I deliberately crammed it full of them. I would say that if your customers use only normal amounts of them you are fine. Disclaimer #2, I had made some modifications that will not be useful to users on the forum (more trying to validate the I) and removed those modifications before posting. The below script hasn’t been tested. If it works for you let me know. Eyeballing it I believe it should.