Merchant API

2.2.2 Signature Calculation

The Signature is a hash of the all fields in the request or response parameters except Signature and optional field with empty value.

 

Before compute the hash, you need to concatenate all the values of the request or response parameters into one long string. The sequence of the values must follow the order of the request or response fields list.

 

Steps to calculate Signature:

  1. Concatenate all the values of the request or response parameters list (by following the order in the parameter list) into one long string, except Signature field and optional field with empty value.
  2. Compute the hash over this concatenated string using HMAC-SHA512 algorithm (Use given secret key as key).
  • Convert the computed hash into base64 format.

 

 

Example:

 

MerchantNo = “1000000000000001”

OrderId = “M123456789”

Amount = “10.50”

 

The string to sign would then be:

            1000000000000001M12345678910.50

 

The resulting signature would be (using HMAC-SHA512, Secret Key= “Ws123456Ws987654”):

    ++lLP7XD4fK3t7PsBz50LdVU35yutApDvZdmlltNXuBsrQnF0B/ed1uxAjSN+3anRjJWrDelYCZoWbsyTzAuMg==