Reply
Highlighted
Member
Posts: 3
Registered: ‎02-12-2016

MD5 Hash Removal/Disablement DPM, Python

[ Edited ]

We are using Python with DPM post option. Followed the hash upgrade link instructions from here:

https://developer.authorize.net/support/hash_upgrade/

 

 

DPM post fails with "This transaction cannot be accepted." Not getting additional clues and the failed transaction is not visible in Sandbox.

 

I am stuck and don't know how to proceed. Need a clear example for the following:

 

1. How to generate the SHA512 hash in Python

2. How to verify the returned hash in Python

 

Here is what I tried for #1 above that results in failure:

 

 fingerprint = hmac.new(binascii.unhexlify(security_tokens["SIGNATURE_KEY"]),
"^"+security_tokens["LOGIN_ID"]+"^"+self.seq+"^"+ts+"^"+self.amount+"^", digestmod=hashlib.sha512).hexdigest()

 

When I do a DPM post with this generated hash in x_fp_hash, I get  "This transaction cannot be accepted."

 

Still don't know the exact python code to verify the returned SHA512 hash (#2).

 

Example code snippets in Python is much appreciated.

 

 

Also when I copied the signature key to clipboard, I noticed an extra carriage return in the beginning. However, I used the characters after the carriage return. Not sure if that has any impact?

 

Thanks