AuthorizeNet / sample-code-ruby

This repository contains working code samples which demonstrate ruby integration with the Authorize.Net API
MIT License
24 stars 58 forks source link

Ruby example for `calculate_TransHashSha512()` is not functional #69

Open robertwahler opened 5 years ago

robertwahler commented 5 years ago

68 Fixes this, but this fixed code doesn't seem to calculate the same hash that test.authorize.net/gateway/transact.dll site returns for SIM hosted page forms. Can someone verify the correct text to hash for SIM?

robertwahler commented 5 years ago

I've located the proper fields to hash in the deprecated SIM documentation and updated the SDK. I will not issue a pull request as this is not complete SIM API support. https://github.com/robertwahler/sdk-ruby/tree/SIM_lifeline

gnongsie commented 5 years ago

Hi, Thanks for bringing this to our notice. There were some minor issues with the sample which I have fixed.

However, the SIM module has been deprecated in the latest version of the SDK. Server side support for the transHash value returned in SIM will also be discontinued and will return a null value moving forward. Please refer to the following links for MD5 based hash getting discontinued.

The new field being sent for verification is transHashSHA2, for which the sample code you referred to is valid and functional.

robertwahler commented 5 years ago

Hi, thanks for the response. There is no transHashSHA2 returned from test.authorize.net/gateway/transact.dll. but there is a SHA2_Hash that is populated with a hash of 30 different return parameter fields (see the referenced fork above). I understand SIM is deprecated but it is not obsolete yet so I hope that your gateway will continue to return SHA2_Hash. Could you verify?

gnongsie commented 5 years ago

Hi Robert, Yes, x_SHA2_Hash is the SIM equivalent for transHashSHA2.

Kindly refer to this document for any further doubts.

Also, may I suggest that you consider migrating to our new APIs for your integration? Please refer to this document for suggestions on how to upgrade.