The parameters and their order to be used for the hash algorithmare as follows.merchant_key customer_number card_token app_secret
#!/usr/bin/env bash
set -euo pipefail
# Example values. Load your merchant app_secret on your server.
parts=(
"merchant_example" # merchant_key
"10001" # customer_number
"example_card_token" # card_token
)
app_secret="example_app_secret"
message=$(IFS='|'; printf '%s' "${parts[*]}")
printf '%s' "$message" | openssl dgst -sha256 -hmac "$app_secret" -r | awk '{print $1}'
{
"status_code": 100,
"status_description": "The card token saved successfully",
"card_token": "ad89a1169c075a21a4b2f5e30691539c"
}