API DocumentationπŸ”‘ Signature

Basic Steps

  1. Let M be the set of all sent or received data
  2. Sort the parameters that require signing in set M by parameter name in ascending ASCII order (dictionary order)
  3. Use URL key-value pair format (key1=value1&key2=value2...) to concatenate into string stringA
  4. Append &appSecret=secretKey to stringA to get stringSignTemp string
  5. Perform MD5 operation on stringSignTemp
  6. Convert all characters in the resulting string to uppercase to get the final signature value

Important Rules

Please note the following rules:

  • Parameter names must be sorted in ascending ASCII order (dictionary order)
  • Parameter names are case-sensitive
  • The transmitted signature parameter does not participate in signing, used only for verification
  • Interface may add fields, signature verification must support additional extension fields

Example (PHP)

Assume the parameters are:

appId: 12345
chainType: 1
merchantOrderNo: 123123123123
productName:Goods

Step 1: Parameter Sorting

Remove parameters that do not require signing, and sort the parameters that require signing in key=value format:

$stringA = 'appId=12345&chainType=1&merchantOrderNo=123123123123';

Step 2: Append Secret Key

$stringSignTemp = $stringA.'&appSecret=secretKey';

Step 3: MD5 Encryption

$signature = md5($stringSignTemp);

Step 4: Convert to Uppercase

$signature = strtoupper($signature);