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.
API protocol: HTTPS/HTTP
Response data format: JSON
Data charset: UTF-8
| Result Code | Description | Remarks |
| 0 | Success. | NA |
| 1 | Incorrect parameter. | For more information, please refer to the result description in the response. |
| 2 | Incorrect signature. | NA |
| 3 | Internal 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. |
| 6 | External 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. |
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¬ifyTime=1353317037173&orderId=918370122485714G&payType=2&productName=Pearl necklace&requestId=1352286825177&result=0&userName=lilan
The obtained string is the one to be signed.
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.