目录

1 Parameter Naming Convention

The camel case is used to name API parameters. That is, if a parameter name consists of multiple words, each word, except the first one, begins with a capital letter, for example, walletVersion.

2 API Protocol Description

API protocol: HTTPS/HTTP

Response data format: JSON

Data charset: UTF-8

3 Common Result Codes

Result CodeDescriptionRemarks
0Success.NA
1Incorrect parameter.

For more information, please refer to the result description in the

response.

2Incorrect signature.NA
3Internal error.Generally, there is no specific cause, for example, an exception.

When encryption or decryption fails, required data is incomplete, or a processing exception occurs due to a non-specific cause, this result

code is returned.

6External dependency error.When an error occurs in the system that the server depends on or the system returns an unexpected response, this result code is returned.

4 Signature Mechanism

4.1 Generating a String to Be Signed

The following is a sample parameter array for generating a string to be signed:

string[] parameters={

  "amount=2.00",

  "BankId=JUNNET-NET",

  "orderId=918370122485714G",

  "notifyTime=1353317037173",

  "payType=2",

  "productName=Pearl necklace",

  "requestId=1352286825177",

  "result=0",

  "userName=lilan"

};

1. Sort the ASCII code of each item in the array in ascending order. If the initials of two items are the same, their second letters will be used for sorting, and so forth.

2. After the sorting is complete, connect all items in the array using ampersands (&).

BankId=JUNNET-NET&amount=2.00&notifyTime=1353317037173&orderId=918370122485714G&payType=2&productName=Pearl necklace&requestId=1352286825177&result=0&userName=lilan

The obtained string is the one to be signed.

4.2 RSA Signature

A private key and a public key are required for RSA signature. The global public key is as follows:

MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA1+b2/q6KEJfvI65xJLXhPMT8YRUO618zsgaW4pNGZ+r/mwfFC1EOZbcBp7sV0IaxSWeMy0WNyJPSh/JltuiC1R93hfA0Kh3DlaRWaDgJz9VC1b+aPjUOx+uqndOEFiZcKGGnM60YPXfyo7xCDH76/WsWR0G4Ov6MoYQ76RAUT0t+G0oumYGgdLYwx5hJ1ywDKPXszj7A/mKHtWJKiylPIhUK2mLwKR8Y/+3dLNuNomvb7miVgeBFiriwGS1FolQMu433zEugAqRgsiasZAKfVK1BChPmiC812IMS1UPhz1wwpXzzkjQ1YQUGjnbHpooKobeCyctKKgF27F84egpzsQIDAQAB

After obtaining the string to be signed based on a request, call the RSA signature function to sign the string using the public key. The signature algorithm is SHA256WithRSA.