I'm working on converting to the SHA2 hash using the DPM method. (Migrating to accept.js is in the planning stage.)
In my sandbox account, I'm generating a SHA2 hash for the x_fp_hash field and it must be working correctly, because I'm getting a 'This transaction has been approved' response.
However, when I go to check the hash values in the return array, the MD5 hash matches but not the SHA2 hash.
I appear to be generating the message string correctly, it just isn't matching. Any suggestions?
Solved! Go to Solution.
01-25-2019 10:25 AM
Problem solved.
For those trying to get this working under DPM, the trick is that you don't create the message using the login ID, transaction ID and amount, as suggested in the conversion docs, but you use that ugly 30 field string.
Here's a PHP segment that worked for me:
$key1 = '^' . $_POST[x_trans_id]
. '^' . $_POST[x_test_request]
. '^' . $_POST[x_response_code]
. '^' . $_POST[x_auth_code]
. '^' . $_POST[x_cvv2_resp_code]
. '^' . $_POST[x_cavv_response]
. '^' . $_POST[x_avs_code]
. '^' . $_POST[x_method]
. '^' . $_POST[x_account_number]
. '^' . $_POST[x_amount]
. '^' . $_POST[x_company]
. '^' . $_POST[x_first_name]
. '^' . $_POST[x_last_name]
. '^' . $_POST[x_address]
. '^' . $_POST[x_city]
. '^' . $_POST[x_state]
. '^' . $_POST[x_zip]
. '^' . $_POST[x_country]
. '^' . $_POST[x_phone]
. '^' . $_POST[x_fax]
. '^' . $_POST[x_email]
. '^' . $_POST[x_ship_to_company]
. '^' . $_POST[x_ship_to_first_name]
. '^' . $_POST[x_ship_to_last_name]
. '^' . $_POST[x_ship_to_address]
. '^' . $_POST[x_ship_to_city]
. '^' . $_POST[x_ship_to_state]
. '^' . $_POST[x_ship_to_zip]
. '^' . $_POST[x_ship_to_country]
. '^' . $_POST[x_invoice_num]
. '^;
01-25-2019 12:10 PM
Problem solved.
For those trying to get this working under DPM, the trick is that you don't create the message using the login ID, transaction ID and amount, as suggested in the conversion docs, but you use that ugly 30 field string.
Here's a PHP segment that worked for me:
$key1 = '^' . $_POST[x_trans_id]
. '^' . $_POST[x_test_request]
. '^' . $_POST[x_response_code]
. '^' . $_POST[x_auth_code]
. '^' . $_POST[x_cvv2_resp_code]
. '^' . $_POST[x_cavv_response]
. '^' . $_POST[x_avs_code]
. '^' . $_POST[x_method]
. '^' . $_POST[x_account_number]
. '^' . $_POST[x_amount]
. '^' . $_POST[x_company]
. '^' . $_POST[x_first_name]
. '^' . $_POST[x_last_name]
. '^' . $_POST[x_address]
. '^' . $_POST[x_city]
. '^' . $_POST[x_state]
. '^' . $_POST[x_zip]
. '^' . $_POST[x_country]
. '^' . $_POST[x_phone]
. '^' . $_POST[x_fax]
. '^' . $_POST[x_email]
. '^' . $_POST[x_ship_to_company]
. '^' . $_POST[x_ship_to_first_name]
. '^' . $_POST[x_ship_to_last_name]
. '^' . $_POST[x_ship_to_address]
. '^' . $_POST[x_ship_to_city]
. '^' . $_POST[x_ship_to_state]
. '^' . $_POST[x_ship_to_zip]
. '^' . $_POST[x_ship_to_country]
. '^' . $_POST[x_invoice_num]
. '^;
01-25-2019 12:10 PM
This
x_method
x_account_number fields are for the Bank account payment. Right? So, can we remove those fields if we are choosing a credit card payment? Or is it the one that we get from the transaction response? Please give me a reply. I am still facing the hash mismatch issue.
03-05-2019 12:42 AM - edited 03-05-2019 12:56 AM
03-05-2019 03:09 AM