Payment Details Hash
The hash of the payment notification details allows the merchant system to verify both the source and the integrity of the payment notification details it receives at the Result URL in the Payment Notification.
In order to generate the hash, the Paymer Merchant service concatenates the following fields in the Payment Notification Form in the following order:
-
Merchant Number (PM_PAYMERCH_ID);
-
Payment amount (PM_PAYMENT_AMOUNT);
-
Type of payment amount (PM_PAYMENT_ATYPE);
-
Merchant Reference Number (PM_PAYMENT_NO);
-
Test/Live Mode Flag (PM_PAYTEST_MODE);
-
Transaction ID (PM_PAYSYS_TRANS_NO);
-
Transaction Date and Time (PM_PAYSYS_TRANS_DATE);
-
Secret Key (PM_PAYSECRET_KEY);
The hash algorithm used to generate the hash is MD5. In the case of MD5, the calculated hash will consist of 32 hexadecimal digits sent in the PM_PAYHASH field, as in the commonly used Message Digest 5 (MD5) algorithm.
Verification of hash value
Hash value can be verified either manually on the special page of this website or automatically on the merchant’s website according to the following algorithm:
-
MD5
- Create a string by concatenating the values of the fields received via the Payment Notification Form in the same order as used to create hash in the Paymer Merchant service.
The value of the Secret Key in the above concatenation must be used.
-
Calculate the hash of this string.
-
Compare the calculated hash with the hash sent by the Paymer Merchant system in the PM_PAYHASH field on the Payment Notification Form.
If the hash sent via the Payment Notification Form is identical to the hash calculated by the merchant system, the merchant can safely conclude that the values of the fields on the Payment Notification Form were not modified and payment notification details were indeed sent by the Paymer Merchant system.
Notwithstanding the fact that customers cannot modify the payment amount, it is important that the merchant verifies the amount sent via the PM_PAYMENT_AMOUNT field.
The Paymer Merchant system enables merchants to test the integration of Paymer Merchant with the merchant system without effecting real payments. The mode of payment processing is based on the value of the Test/Live Flag property set by the merchant.
The information about the mode used by the merchant is submitted in the PM_PAYTEST_MODE field.
If the mode is set to test, payments will be simulated and payment details will be fabricated by the Paymer Merchant system.
|