# Signature

# Signature Algorithm


# signature generation procedure

  1. set all data sent or received as set M, sort the parameters of non-empty parameter values in set M from small to large according to the ASCII code of the parameter name (lexicographically ordered), and use the correct format of the URL key value (key1 = value1 & key2 = value2…) Concatenate a string stringA.
  2. Concatenate the key (merchant key) at the end of the stringA to obtain stringSignTemp string, perform MD5 operation on the stringSignTemp, and then convert all the characters of the obtained string to uppercase to obtain the sign value signValue

# special attention

  1. the ASCII code of the parameter name is sorted from small to large (in alphabetical order);
  2. if the value of the parameter is empty, the signature is not involved;
  3. parameter names are case sensitive;
  4. when the call is returned or the payment system initiates the notification signature, the sign parameter in the data does not participate in the signature. The generated signature is verified with the sign value. .
  5. Additional fields may be added to the payment interface. Additional extended fields must be supported when verifying the signature.
  6. The plaintext used by the merchant key when signing the signature. If the Google verification code is not bound, the merchant's back-end key may display ciphertext.

# Example

for example, the request parameters are as follows:

 {
  "countryId": "COL",
  "currency": "COP",
  "customerAccount": "3720000264",
  "merId": "8301000002750275",
  "merOrderNo": "merOrderNo",
  "nonceStr": "string",
  "orderAmount": "30000",
  "payProduct": "08",
  "nonceStr": "4cKcL83FIsDgjAi"
}

Concatenate strings according to the rules to obtain the string to be signed:

countryId=COL&currency=COP&customerAccount=3720000264&merId=8301000002750275&merOrderNo=merOrderNo&nonceStr=4cKcL83FIsDgjAi&orderAmount=30000&payProduct=08&key=11111111111111111111111111111111

The signature result is as follows:

1DD2448C750D92B3AE512F2E493F5665

The final request parameters are as follows:

 {
  "countryId": "COL",
  "currency": "COP",
  "customerAccount": "3720000264",
  "merId": "8301000002750275",
  "merOrderNo": "merOrderNo",
  "nonceStr": "string",
  "orderAmount": "30000",
  "payProduct": "08",
  "nonceStr": "4cKcL83FIsDgjAi",
  "sign": "1DD2448C750D92B3AE512F2E493F5665"
}

# Use the signature SDK


  1. for SDK download, see download-signature SDK"
  2. introduce the supefina-sign jar package to your project
  3. pass com. supefina. sign. SupefinaSignUtils#sign (java. lang. Object, java. lang. String)method to complete the signature operation
    1. parameter 1: request parameter json object
    2. parameter 2: Merchant key