Gateway

Gateway description:

The platform interface adopts RSA 2048 (SHA-256) asymmetric encryption algorithm.

  1. The platform provides the public key, and the merchant encrypts or decrypts the data with the public key.
  2. View the public key, merchant number, available payment channel ID, interface address and other information required for docking in the user center or account opening email attachment
  3. The interfaces mentioned below are all relative addresses, which need to be spliced with the interface domain name mentioned in the account opening email into a complete interface address.
  4. Some interfaces, such as ordering, support GET and POST to transmit parameters at the same time. If it is found that POST of some browsers cannot transmit parameters successfully (such as WeChat built-in browser), you can use GET to transmit parameters instead. It is also convenient for iframe to call the payment page
  5. If the POST request returns "Merchant does not exist", first check that the merchant ID is correct and sent in clear text in the access_token field. If there is no problem, check that whether the header correctly adds the Content-Type field.
  6. UTF8 encoding is required for all interfaces that allow reference to Chinese or other non-English characters.
  7. If the merchant cannot download the security plug-in on the UnionPay payment channel page,please click here to download it

Submit payment

Request mode: GET/POST

Request address:/pub/pay/records/gateway

Details:

Unified ordering interface, through which all payment requests are initiated to the payment platform. According to different payment methods, the request parameters and return data are different, and the business can choose different interfaces according to different usage scenarios.

  1. The key parameters are access_token, ciphertext.
  2. access_token: The merchant number provided by the platform
  3. ciphertext: The merchant loads the parameters specified by the interface into the json string, and then encrypts the ciphertext obtained by using the public key provided by the platform
  4. If currency is submitted in the currency field, the currency conversion function is automatically enabled, which will convert the amount you submitted into the channel currency amount before submitting payment. (The converted exchange rate is subject to the daily updated exchange rate of our company, and the final submitted amount is subject to the actual amount. Please know. If you need to inquire about the exchange rate of our company's order, you can use the interface of inquiring the exchange rate of order)
    "Due to the change of business policy, our company has not enabled the conversion function yet, and this field is temporarily unavailable"
  5. The timestamp field has not been verified by our company for the time being, and the timestamp transmission is used as a standby security parameter, so there is no need to worry about the server time and other issues leading to submission failure
  6. If the payment channel type used is mail payment (which can be confirmed in the merchant center-my interface), the email field is required and the callfront field is invalid, and the interface will always consider the submission value to be-1.

Header parameter Type Required Describe Example e.g.
Content-Type string Yes It is recommended to fix application/x-www-form-urlencoded application/x-www-form-urlencoded
isemailmode string No This field must be passed in Header when using mail mode payment channel, and its value is 1 1
issmsmode string No This field must be passed in the header when using the payment channel in SMS mode, and its value is 1 1
Body Sample

Query parameter Type Required Describe Example e.g.
access_token string Yes Merchant number, assigned merchant number 29901
ciphertext string Yes The ciphertext obtained by the merchant encrypting JSON with the public key
ciphertext encapsulates content Type Required Describe Example e.g.
payid string Yes Payment channel ID 1001
requestid string Yes Merchant order number (8 ~ 32-bit string composed of numbers, uppercase English letters and lowercase English letters) 20180909002
amount string Yes Payment amount (The currency of each channel may be different, use User Center-My Interface as the stanard. In addition, the incoming amount will be rounded to 2 decimal places.) 23.99
callfront string Yes Front notification address (The backstage setting shall prevail, and if it is not set, it will be subject to the setting when submission)
*If you can set or pass in-1, the default friendly prompt page of our company will be automatically used, and merchants need to use callback information to confirm payment
callback string Yes Backend notification address (The backstage setting shall prevail, and if it is not set, it will be subject to the setting when submission)
currency string No The currency you submitted(your currency is considered the same as the channel currency by default) USD
timestamp string No Time stamp (GMT time seconds since January 1, 1970) 1536131800
customeridentify string No User ID(optional, user name, login ID, user ID, etc. can be passed in, which can be used for some channels that need to collect information to automatically read the information of the customer's recent payment success) user123456
customername string No Name of customer requesting payment (optional, required for some channels) meimei han
idnumber string No Customer ID number applying for payment (optional, which may be required for some channels) 012345678
mobile string No Phone number of customer applying for payment (optional, required for some channels) 15000000000
email string No Customer mailbox applying for payment (optional, required for some channels) 123456@qq.com
paycard string No Default payment card number for applying for payment (optional, which may be required for some channels) 6223164991230014
customize1 string No Custom content 1 (optional, it will be sent back as it is when callback) Name:'Han Meimei 1'
customize2 string No Custom content 2 (optional, it will be sent back as it is when callback) Commodity: 'Red coat 2'
customize3 string No Custom content 3 (optional, it will be sent back as it is when callback) Specification:'XXXL3'

Real-time redirect

Request method: POST

Redirect address: set by the merchant in the background or specified when submitting payment

Details:

After successful or failed payment, the customer will jump to the address specified by the merchant with parameters, and the merchant can make a prompt interface when the payment is successful or failed

  1. Returns ciphertext with only one parameter
  2. ciphertext: The platform loads the preset parameters into the json string, and then encrypts the ciphertext with the private key saved by the platform

Example of the return:

        
ciphertext=wwlputO3AfKyi9AqnUm%2FY9c%2FZ8T4S1A%2FJ96k5SR8oCs03%2FuNU%2BlbJltxnqhdPep%2BciYqLcA2CxtD1FC0ChuONB2grI1DCYO181rGtSCibgxGMWjeUJNxyBx9qQFf5GGwORvDEuW%2BAAgEF2GFxVWgAlbARc2k%2BR%2BUXiUhY6YOefPMG5fG3yaysftDvOvGO6xgPix49WS88bOKGENY9sM4snonLoy8eBju5zWPlLXEiPv8n2pVVcgdGTNAKZ5j9yzSzYzMvTXo6js%2Fud3Zs1S5Nt40g6NONl7ifqv0YKFsEfhNMM16dvfxYL2s5%2Ffrw2HCPdgRwELemiI6P8DsjHZREp7ErBkaHaPGjvnubXA%2BKB7e%2FmKIYCtOQGIfP1fzlxdDn2xoNcjUi80qog60x%2BoDBFLx620I0NBox8Mj9VqDRQ2V1kqOrfOxtnjkIEINkO9Y1rUt420TvD6QGq6OaNRxNaSlG3gYmHYNj8yzyf%2BSfzNBKpw6jEM6yNb5O4ua8rX%2B
		
                                  
Received value Describe Type
ciphertext Ciphertext encrypted by platform with private key string
        
      The merchant uses the public key provided by the platform to decrypt ciphertext and get the following parameters:
	{
		"requestid": "1624438261194",
		"amount": 100,
		"subamount": 100,
		"paytime": "2021-06-13 16:51:49",
		"merchantid": 887082,
		"orderno": "1624438286359773",
		"paystatus": 1,
		"accNo": "622316****0014",
		"timestamp": 1624438320,
		"paystatusdesc": "SUCCESS",
		"customize1": "TEST",
		"customize2": "TEST",
		"customize3": "TEST"
	}
    
Ciphertext encapsulates content Describe Type
requestid Merchant order number string
amount Payment amount string
subamount Submitted amount string
paytime Time of payment string
merchantid Merchant number string
orderno Payment platform system order number string
paystatus Payment status (1 for: "Payment succeeded."-1 for: "Payment failed."-2 for: "Actual payment amount does not match requested amount."-3 for: "Payment order cancelled."-4 for: "Unknown exception.") string
paystatusdesc Payment status description, string type. When paystatus is-1 or-4, the specific description that may be returned varies according to different payment channels. string
accNo Customer payment card number, if there is no data, it will be an empty string string
timestamp Time stamp (GMT time seconds since January 1, 1970) string
customize1 Custom Content 1 (returned if filled in) string
customize2 Custom Content 2 (returned if filled in) string
customize3 Custom content 3 (returned if filled in) string

Receive callback

Request method:POST

Callback address: specified when the merchant sets in the background or submits payment

Details:

After the customer pays successfully, the system will send a notification to the order callback address please respond to the uppercase SUCCESSwhen receiving the callback successfully, otherwise the system will send 6 callback notifications at most for each order.

  1. Returns ciphertext with only one parameter
  2. ciphertext: The platform loads the preset parameters into the json string, and then encrypts the ciphertext with the private key saved by the platform

Example of the return:

        
ciphertext=wwlputO3AfKyi9AqnUm%2FY9c%2FZ8T4S1A%2FJ96k5SR8oCs03%2FuNU%2BlbJltxnqhdPep%2BciYqLcA2CxtD1FC0ChuONB2grI1DCYO181rGtSCibgxGMWjeUJNxyBx9qQFf5GGwORvDEuW%2BAAgEF2GFxVWgAlbARc2k%2BR%2BUXiUhY6YOefPMG5fG3yaysftDvOvGO6xgPix49WS88bOKGENY9sM4snonLoy8eBju5zWPlLXEiPv8n2pVVcgdGTNAKZ5j9yzSzYzMvTXo6js%2Fud3Zs1S5Nt40g6NONl7ifqv0YKFsEfhNMM16dvfxYL2s5%2Ffrw2HCPdgRwELemiI6P8DsjHZREp7ErBkaHaPGjvnubXA%2BKB7e%2FmKIYCtOQGIfP1fzlxdDn2xoNcjUi80qog60x%2BoDBFLx620I0NBox8Mj9VqDRQ2V1kqOrfOxtnjkIEINkO9Y1rUt420TvD6QGq6OaNRxNaSlG3gYmHYNj8yzyf%2BSfzNBKpw6jEM6yNb5O4ua8rX%2B
		
                                  
Received value Describe Type
ciphertext Ciphertext encrypted by platform with private key string
        
      The merchant uses the public key provided by the platform to decrypt ciphertext and get the following parameters:
	{
		"requestid": "1624438261194",
		"amount": 100,
		"subamount": 100,
		"paytime": "2021-06-13 16:51:49",
		"merchantid": 887082,
		"orderno": "1624438286359773",
		"paystatus": 1,
		"accNo": "622316****0014",
		"timestamp": 1624438320,
		"paystatusdesc": "SUCCESS",
		"customize1": "TEST",
		"customize2": "TEST",
		"customize3": "TEST"
	}
    
Ciphertext encapsulates content Describe Type
requestid Merchant order number string
amount Payment amount string
subamount Submitted amout string
paytime Time of payment string
merchantid Merchant number string
orderno Payment platform system order number string
paystatus Payment status (1 for: "Payment succeeded."-1 for: "Payment failed."-2 for: "Actual payment amount does not match requested amount."-3 for: "Payment order cancelled."-4 for: "Unknown exception.") string
paystatusdesc Payment status description, string type. When paystatus is-1 or-4, the specific description that may be returned varies according to different payment channels. string
setstatus Settlement status (1 means "settled". 0 means "pending settlement".) string
setcurr Settlement currency string
setamount Settlement amount string
accNo Customer payment card number, if there is no data, it will be an empty string string
timestamp Time stamp (GMT time seconds since January 1, 1970) string
customize1 Custom Content 1 (returned if filled in) string
customize2 Custom Content 2 (returned if filled in) string
customize3 Custom content 3 (returned if filled in) string

Refund

Request mode: GET/POST

Request address:/pub/pay/records/return

Details:

Order refund interface, which can be used by merchants to submit refund requests and refund a successfully paid order

  1. The key parameters are access_token, ciphertext.
  2. access_token: The merchant number provided by the platform
  3. ciphertext: The merchant loads the parameters specified by the interface into the json string, and then encrypts the ciphertext obtained by using the public key provided by the platform
  4. After decryption, the orderno and requestid fields cannot be empty at the same time, and the orderno query will be used first; Requestid must only find a unique order for this interface to work
  5. The cmd field is used to specify the order status to be operated on, for example:
    When the value is 0 (Auto), if the order is not settled, it will be refunded in the unsettled mode (Void), and if the order is settled, it will be refunded in the settled mode (Refund).
    When the value is 1 (Void), only the target order can be refunded if it is in the unsettled status;
    When the pass value is 2(Refund)the target order can only be refunded if it is in the settled status(the balance will be deducted from the settlement wallet of the order, and the balance in the wallet needs to be sufficient.)

Header parameter Type Required Describe Example e.g
Content-Type string Yes It is recommended to fix application/x-www-form-urlencoded application/x-www-form-urlencoded
Body Sample
Query parameter Type Required Describe Example e.g.
access_token string Yes Merchant number, assigned merchant number 29901
ciphertext string Yes The ciphertext obtained by the merchant encrypting JSON with the public key
Ciphertext encapsulates content Type Required Describe Example e.g.
orderno string No System order number (used to query orders) 1622798925426391
requestid string No Merchant order number (used to query orders) 10920180909203400603
amount string No Amount (the default is the total payment amount of the order. If the order has been submitted for partial liquidation, the amount will be prompted) 100
cmd string No Operation type "0 automatic, 1 before settlement only, 2 after settlement only (wallet balance is required to be deducted)"
(Default is automatic)
0
callback string No Callback address https://xxxx/callback.jsp
timestamp string No Time stamp (GMT time seconds since January 1, 1970) 1536131800

Example of the return:

        
{
    "code": "true",
    "message": "success"
}
                                  
Received value Describe Type
code Return value, which indicates success when true and success when false; If true, the request succeeded; Otherwise, the request failed string
msg Prompt message, success means success, otherwise specific error message string

Refund Callback

Request Mathod:POST

Callback address:Merchat set in the background settings or specify when submit payment

Detailed Description:

Each time the refund status is updated, the system will send a notification to the callback address of the refund, after successfully revice the callback, please response with "SUCCESS",Otherwise for each order, the system will only send callback notifications 6 times at most.

  1. Return only have one parameter: ciphertext
  2. ciphertext:The platform loads the preset parameters into the json string, and then encrypts the ciphertext obtained by using the private key saved by the platform

Example of the return:

        
ciphertext=wwlputO3AfKyi9AqnUm%2FY9c%2FZ8T4S1A%2FJ96k5SR8oCs03%2FuNU%2BlbJltxnqhdPep%2BciYqLcA2CxtD1FC0ChuONB2grI1DCYO181rGtSCibgxGMWjeUJNxyBx9qQFf5GGwORvDEuW%2BAAgEF2GFxVWgAlbARc2k%2BR%2BUXiUhY6YOefPMG5fG3yaysftDvOvGO6xgPix49WS88bOKGENY9sM4snonLoy8eBju5zWPlLXEiPv8n2pVVcgdGTNAKZ5j9yzSzYzMvTXo6js%2Fud3Zs1S5Nt40g6NONl7ifqv0YKFsEfhNMM16dvfxYL2s5%2Ffrw2HCPdgRwELemiI6P8DsjHZREp7ErBkaHaPGjvnubXA%2BKB7e%2FmKIYCtOQGIfP1fzlxdDn2xoNcjUi80qog60x%2BoDBFLx620I0NBox8Mj9VqDRQ2V1kqOrfOxtnjkIEINkO9Y1rUt420TvD6QGq6OaNRxNaSlG3gYmHYNj8yzyf%2BSfzNBKpw6jEM6yNb5O4ua8rX%2B
		
                                  
Received value Description Type
ciphertext The ciphertext encrypted by the platform with the private key string
        
      The merchant uses the public key provided by the platform to decrypt the ciphertext and get the following parameters:
	{
		"requestid": "1640940552189",
		"orderno": "1640940560602434",
		"reforderno": "R1640940560602434B1",
		"currency": "CNY",
		"amount": 50,
		"walletcur": "",
		"walletamt": 0,
		"amountsurplus": 0,
		"cmd": 0,
		"addtime": "2021-12-31 16:49:36",
		"status": 1,
		"audittime": "2021-12-31 16:49:36"
	}
    
ciphertext封装内容 Description Type
requestid Merchant Order Number string
orderno System Order Number string
reforderno Refund order number string
currency Currency Received string
amount Amount Received string
walletcur Deduction wallet string
walletamt Amount Deducated string
amountsurplus Available Refund Amount/td> string
cmd Operation Type【1:void、2:refund】 string
addtime Submit time string
status Audit Status(0:Pending、1:Approved、-1:Failed、-2:Cancelled) string
audittime Audit Time string

Payment on behalf of

Request mode: GET/POST

Request address:/pub/pay/records/payforanother

Details:

Payment ordering interface, which can be used by merchants to submit payment requests. Payment will usually be reviewed within 1 working day and received within 1 ~ 3 working days.

  1. The key parameters are access_token, ciphertext.
  2. access_token: The merchant number provided by the platform
  3. ciphertext: The merchant loads the parameters specified by the interface into the json string, and then encrypts the ciphertext obtained by using the public key provided by the platform
  4. The merchant order number is mainly used for uniqueness judgment to avoid submitting repeated payment requests. The order number of the paying merchant does not conflict with the order number of the paying merchant, but can be the same.
  5. Available collection currency is usually CNY
  6. The callback address is the background setting by the merchant preferentially. If the background of the merchant is not set, it will be subject to the payment submission. If the callback address is not specified, it will be deemed that the payment callback is not required
  7. The bank code can be used in the bankcode field. Please refer to[List of Paying Banks][Json Format]

Header parameter Type Required Describe Example e.g.
Content-Type string Yes It is recommended to fix application/x-www-form-urlencoded application/x-www-form-urlencoded
Body Sample
Query Parameter Type Required Describe Example e.g.
access_token string Yes Merchant number, assigned merchant number 29901
ciphertext string Yes The ciphertext obtained by the merchant encrypting JSON with the public key
Example e.g.
Ciphertext encapsulates content Type Required Describe
requestid string Yes Merchant order number 1622798925426391
paypass string Yes Payment password test1234
walletcur string Yes Deduction wallet USD
currency string Yes Currency of receipt CNY
amount string Yes Amount of collection 100
bankcode string Yes Account Opening bank ICBC
banksub string Yes Branch Beijing Chaoyang Branch
bankname string Yes Account name Zhang San
bankcard string Yes Card number 9876543210
bankcountry string No Account opening country China
bankprovince string No Account opening province Beijing
bankcity string No City of opening an account Beijing
callback string No Callback address https://xxxx/callback.jsp
timestamp string No Time stamp (GMT time seconds since January 1, 1970) 1536131800

Example of the return:

        
{
    "code": "true",
    "message": "success"
}
                                  
Received value Describe Type
code Return value,which indicates success when true and success when false; If true, the request succeeded; Otherwise, the request failed string
msg Prompt message, success means success, otherwise specific error message string

Payment callback

Request Method:POST

Callback address: specified when merchant's background setting or payment is submitted

Detailed description:

After the payment is approved and the transfer is successful, the system will send a notification to the callback address of the payment order respectivelyPlease respond to uppercase SUCCESS if the callback is successfully receivedOtherwise, the system will send up to 6 callback notifications per order.

  1. Returns ciphertext with only one parameter
  2. ciphertext:The platform loads the preset parameters into the json string, and then encrypts the ciphertext obtained by using the private key saved by the platform

The example of returns:

        
ciphertext=wwlputO3AfKyi9AqnUm%2FY9c%2FZ8T4S1A%2FJ96k5SR8oCs03%2FuNU%2BlbJltxnqhdPep%2BciYqLcA2CxtD1FC0ChuONB2grI1DCYO181rGtSCibgxGMWjeUJNxyBx9qQFf5GGwORvDEuW%2BAAgEF2GFxVWgAlbARc2k%2BR%2BUXiUhY6YOefPMG5fG3yaysftDvOvGO6xgPix49WS88bOKGENY9sM4snonLoy8eBju5zWPlLXEiPv8n2pVVcgdGTNAKZ5j9yzSzYzMvTXo6js%2Fud3Zs1S5Nt40g6NONl7ifqv0YKFsEfhNMM16dvfxYL2s5%2Ffrw2HCPdgRwELemiI6P8DsjHZREp7ErBkaHaPGjvnubXA%2BKB7e%2FmKIYCtOQGIfP1fzlxdDn2xoNcjUi80qog60x%2BoDBFLx620I0NBox8Mj9VqDRQ2V1kqOrfOxtnjkIEINkO9Y1rUt420TvD6QGq6OaNRxNaSlG3gYmHYNj8yzyf%2BSfzNBKpw6jEM6yNb5O4ua8rX%2B
		
                                  
Received value Describe Type
ciphertext Ciphertext encrypted by platform with private key string
        
      The merchant uses the public key provided by the platform to decrypt ciphertext and get the following parameters:
	{
		"requestid": "1639724634951",
		"orderno": "W1639724632326999",
		"walletcur": "USD",
		"currency": "MYR",
		"walletamt": 12.2,
		"amount": 50,
		"rate": 4.099,
		"addtime": "2021-12-17 15:03:52",
		"status": 1,
		"audittime": "2021-12-17 15:25:00",
		"paystatus": 1,
		"wdrtime": "2021-12-17 16:21:25",
		"bankcode": "",
		"banksub": "",
		"bankname": "Customer Name",
		"bankcard": "10000001",
		"bankcountry": "Malaysia",
		"bankprovince": "",
		"bankcity": "Kuala Lumpur"
	}
    
Ciphertext encapsulates content Describe Type
requestid Merchant order number string
orderno System order number string
walletcur Deduction wallet string
currency Currency of receipt string
walletamt Deduction amount string
amount Collection amount string
rate Payment rate string
addtime Time of submission string
status Audit status(0:Pending、1:Approved、-1:Failed) string
audittime Audit time string
paystatus Transfer status(0:Untransferred、1:Transferred) string
wdrtime Transfer time string
bankcode Account opening bank string
banksub Branch string
bankname Account name string
bankcard Card number string
bankcountry Account opening Country string
bankprovince Account opening Province string
bankcity Account opening City string

Query payment orders

Request mode: GET/POST

Request address:/pub/pay/records/query

Detailed Instruction:

Payment status query interface, through which business applications can query the status of payment orders to update the order payment status of business parties; The business party can also monitor the payment result notification sent by the payment platform and update the payment status of the business system.

  1. The key parameters are access_token, ciphertext.
  2. access_token: The merchant number provided by the platform
  3. ciphertext: The merchant loads the parameters specified by the interface into the json string, and then encrypts the ciphertext obtained by using the public key provided by the platform
  4. Orderno and requestid fields cannot be empty at the same time, so Orderno query is preferred;
  5. If the merchant opens and allows the merchant order number to be duplicate, the same requestid may find multiple results and return all the results together.

Header parameter Type Required Describe Example e.g.
Content-Type string Yes It is recommended to fix application/x-www-form-urlencoded application/x-www-form-urlencoded
Body Sample
Query parameter Type Required Describe Example e.g.
access_token string Yes Merchant number, assigned merchant number 29901
ciphertext string Yes The ciphertext obtained by the merchant encrypting JSON with the public key
Ciphertext encapsulates content Type Required Describe Example e.g
orderno string No System order number (used to query orders) 1622798925426391
requestid string No Merchant order number (used to query orders) 10920180909203400603
timestamp string No Time stamp (GMT time seconds since January 1, 1970) 1536131800

Example of the return:

        
{
    "code": "true",
    "message": "success",
    "data": ciphertext,
}
                                  
Received value Describe Type
code Return value, which indicates success when true and success when false; If true, the request succeeded; Otherwise, the request failed string
msg Prompt message, success means success, otherwise specific error message string
data Ciphertext encrypted by platform with private key string
        
      The merchant uses the public key provided by the platform to decrypt ciphertext and get the following parameters:
[
    {
        "requestid": "1624438261194",
        "amount": 100,
        "subamount": 100,
        "paytime": "2021-06-13 16:51:49",
        "merchantid": 887082,
        "orderno": "1624438286359773",
        "paystatus": 1,
        "accNo": "622316****0014",
        "amountsurplus": 100,
        "timestamp": 1624439865,
        "paystatusdesc": "SUCCESS",
        "setstatus": 0,
        "setcurr": "",
        "setamount": "",
        "customize1": "TEST",
        "customize2": "TEST",
        "customize3": "TEST"
    }
]
    
Ciphertext encapsulates content Describe Type
requestid Merchant order number string
amount Payment amount string
subamount Amount submitted string
paytime Time of payment string
merchantid Merchant number string
orderno Payment platform system order number string
paystatus Payment status (1 for: "Payment succeeded."-1 for: "Payment failed."-2 for: "Actual payment amount does not match requested amount."-3 for: "Payment order cancelled."-4 for: "Unknown exception.") string
paystatusdesc Payment status description, string type. When paystatus is-1 or-4, the specific description that may be returned varies according to different payment channels. string
accNo Customer payment card number, if there is no data, it will be an empty string string
setstatus Settlement status (0: Unsettled. 1: Settled) string
setcurr Settlement currency, blank if not settled string
setamount Settlement Amount; blank if not settled string
timestamp Time stamp (GMT time seconds since January 1, 1970) string
customize1 Custom Content 1 (returned if filled in) string
customize2 Custom Content 2 (returned if filled in) string
customize3 Custom content 3 (returned if filled in) string

Enquire about refund orders

Request mode: GET/POST

Request address:/pub/pay/records/refund/query

Details:

Interface for querying order refund status.

  1. The key parameters are access_token, ciphertext.
  2. access_token: The merchant number provided by the platform
  3. ciphertext: The merchant loads the parameters specified by the interface into the json string, and then encrypts the ciphertext obtained by using the public key provided by the platform
  4. The three fields of orderno, requestid and refordernocannot be empty at the same time,and the query priority is: reforderno > orderno > requestid;
  5. If the merchant opens and allows the merchant order number to be duplicate, the same requestid may find multiple results and return all the results together

Header parameter Type Required Describe Example e.g.
Content-Type string Yes It is recommended to fix application/x-www-form-urlencoded application/x-www-form-urlencoded
Body Sample
Query parameter Type Required Describe Example e.g.
access_token string Yes Merchant number, assigned merchant number 29901
ciphertext string Yes The ciphertext obtained by the merchant encrypting JSON with the public key
Ciphertext encapsulates content Type Required Describe Example e.g.
orderno string No System order number (used to query orders) 1622798925426391
requestid string No Merchant order number (used to query orders) 10920180909203400603
reforderno string No Refund order number (used to query orders) R1622798925426391B1
timestamp string No Time stamp (GMT time seconds since January 1, 1970) 1536131800

Example of the return:

        
{
    "code": "true",
    "message": "success",
    "data": ciphertext,
}
                                  
Received value Describe Type
code Return value, which indicates success when true and success when false; If true, the request succeeded; Otherwise, the request failed string
msg Prompt message, success means success, otherwise specific error message string
data Ciphertext encrypted by platform with private key string
        
      The merchant uses the public key provided by the platform to decrypt ciphertext and get the following parameters:
[
    {
        "merchantid": 887082,
        "requestid": "1624438261194",
        "orderno": "1624438286359773",
        "reforderno": "R1624438286359773B1",
        "addtime": "2021-4-14 15:09:44",
        "audittime": "2021-4-14 16:11:19",
        "cmd": 1,
        "refundamount": 100,
        "deductamount": 15.53,
        "refundcurrency": "CNY",
        "deductcurrency": "USD",
        "status": 1
    },
    {
        "merchantid": 887082,
        "requestid": "1624438261194",
        "orderno": "1624438286359773",
        "reforderno": "R1624438286359773B2",
        "addtime": "2021-4-14 15:09:44",
        "audittime": "2021-4-14 16:11:19",
        "cmd": 1,
        "refundamount": 100,
        "deductamount": 15.53,
        "refundcurrency": "CNY",
        "deductcurrency": "USD",
        "status": 1
    }
]
    
Ciphertext encapsulates content Describe Type
merchantid Merchant ID string
requestid Payment order merchant order number string
orderno Payment order system order number string
reforderno Refund order number string
addtime Application time string
audittime Audit time string
cmd Operation type "0: Void, 1: Refund, 2: Ahead" string
refundamount Refund amount string
deductamount Deduction amount string
refundcurrency Refund currency string
deductcurrency Deduction currency string
Status"-1: Refund failed, 0: Pending approval, 1: Refund successful" Status string

Inquire about payment orders

Request mode: GET/POST

Request address:/pub/pay/records/payforanother/query

Details:

Interface for querying payment order status.

  1. The key parameters are access_token, ciphertext.
  2. access_token: The merchant number provided by the platform
  3. ciphertext: The merchant loads the parameters specified by the interface into the json string, and then encrypts the ciphertext obtained by using the public key provided by the platform
  4. orderno and requestid fields cannot be blank at the same time,and the query priority is: orderno > requestid;

Header parameter Type Required Describe Example e.g.
Content-Type string Yes It is recommended to fix application/x-www-form-urlencoded application/x-www-form-urlencoded
Body Sample
Query parameter Type Required Describe Example e.g.
access_token string Yes Merchant number, assigned merchant number 29901
ciphertext string Yes The ciphertext obtained by the merchant encrypting JSON with the public key
Ciphertext encapsulates content Type Required Describe Example e.g.
orderno string No System order number (used to query orders) 1623403856822249
requestid string No Merchant order number (used to query orders) 1623403847078
timestamp string No Time stamp (GMT time seconds since January 1, 1970) 1536131800

Example of the return:

        
{
    "code": "true",
    "message": "success",
    "data": ciphertext,
}
                                  
Received value Describe Type
code Return value, which indicates success when true and success when false; If true, the request succeeded; Otherwise, the request failed string
msg Prompt message, success means success, otherwise specific error message string
data Ciphertext encrypted by platform with private key string
        
      The merchant uses the public key provided by the platform to decrypt ciphertext and get the following parameters:
[
    {
        "merchantid":887082,
        "addtime": "2021-06-13 16:51:49",
        "auditdate": "2021-06-13 16:53:39",
        "orderno": "1623403856822249",
        "requestid": "1623403847078",
        "deductcurrency": "USD",
        "deductamount": 15.35,
        "receivingcurrency": "CNY",
        "receivingamount": 100,
        "feerate": 7.04,
        "status": 1,
        "paystatus": 1,
        "bank": "Bank of China",
        "banksub": "Shanghai branch",
        "bankname": "TEST",
        "bankcard": "TEST",
		"bankcountry": "China",
        "bankprovince": "TEST",
        "bankcity": "TEST",
        "auditexplain": "TEST",
    }
]
    
Ciphertext encapsulates content Describe Type
merchantid Merchant ID string
addtime Application time string
audittime Audit time string
orderno Payment system order number string
requestid Payment merchant order number string
deductcurrency Deduction wallet string
deductamount Deduction amount string
receivingcurrency Currency of receipt string
receivingamount Amount of collection string
feerate Handling fee string
status Status "0:Pending approval, 1: Approval passed, 2: Approval failed" string
paystatus Transfer status "0: No Transfer, 1: Transferred" string
bank Name of Bank string
banksub Bank branch string
bankname Account name string
bankcard Receiving account string
bankcountry Account opening country string
bankprovince Account opening province string
bankcity City of opening an account string
auditexplain Cause string

Query order exchange rate

Request mode: GET/POST

Request address:/pub/pay/records/rate/query

Details:

If the optional parameter currency is used when placing an order, currency conversion will be carried out automatically (please consult our company if you need to turn on this function to use it). This interface is used to query the exchange rate to be used for currency conversion, so that the amount to be paid will be displayed in advance on your payment page.

  1. Returns ciphertext with only one parameter
  2. Currency and aimcurrency fields can be left blank, that is, all currencies supporting conversion are returned. If conversion function is not turned on, an empty array is returned
  3. ciphertext: The platform loads the preset parameters into the json string, and then encrypts the ciphertext with the private key saved by the platform

Header parameter Type Required Describe Example e.g.
Content-Type string Yes It is recommended to fix application/x-www-form-urlencoded application/x-www-form-urlencoded
Body Sample
Query parameter Type Required Describe Example e.g.
access_token string Yes Merchant number, assigned merchant number 29901
ciphertext string Yes The ciphertext obtained by the merchant encrypting JSON with the public key

Details:

Query the exchange rate used in the single currency conversion function of our company

  1. The key parameters are access_token, ciphertext.
  2. access_token: The merchant number provided by the platform
  3. ciphertext: The merchant loads the parameters specified by the interface into the json string, and then encrypts the ciphertext obtained by using the public key provided by the platform

Ciphertext encapsulates content Type Required Describe Example e.g.
currency string No Original currency USD
aimcurrency string No Target currency RM
timestamp string Yes Time stamp (GMT time seconds since January 1, 1970) 1536131800

Example of the return:

        
{
    "code": "true",
    "message": "success",
    "data": {
    	"USDRM":"4.12",
    }
}
                                  
Received value Describe Type
code Return value, which indicates success when true and success when false; If true, the request succeeded; Otherwise, the request failed string
message Prompt message, success means success, otherwise specific error message string
data Main data string

Converted payment amount

Request method: GET / POST

Request address: /pub/pay/payforanother/amount/conversion

Detailed Description

The currency of the amount submitted by the proxy payment interface is the currency of the actual payment, not the currency of the deduction from your wallet balance. If you want to specify the debit amount in your wallet, you can use this interface to automatically convert the expected payment amount for you.

  1. return only one parameter: ciphertext
  2. ciphertext: The platform loads the preseted parameters into the json string, and then encrypts the ciphertext with the private key saved by the platform

Header Parameters Type Required Describe Example e.g.
Content-Type string Yes Suggest pass in the fixed format as application/x-www-form-urlencoded application/x-www-form-urlencoded
Body Example
Query Parameters Type Required Describe Example e.g.
access_token string Yes Merchant number, assigned merchant number 29901
ciphertext string Yes The merchant encrypte JSON with the public key to obtain ciphertext
ciphertext encapsulated content Type Required Describe Example e.g.
deductcurrency string No Deduction currency USD
receivingcurrency string No Collection currency CNY
walletamt string No Deduction amount 100
timestamp string Yes Time stamp (GMT time seconds since January 1, 1970) 1536131800

Return example:

        
{
	"deductcurrency": "USDT",
	"receivingcurrency": "CNY",
	"walletamt": "100",
	"feerate": "10.0000",
	"amount": "612.33"
}
                                  
Response value Describe Type
deductcurrency Deduction currency string
receivingcurrency Collection currency string
walletamt Deduction amount string
amount Collection amount(Transferred Amount, can be used for submit proxy payment) string
feerate Commission charge string

RSA Encryption and Decryption Interface (GET)

Request mode: GET

Request address:/tools.php

Details:

On-line encryption and decryption interface is used to replace the original encryption and decryption class for on-line encryption and decryption when it is inconvenient or impossible to use the original source code for RSA encryption and decryption in some language environments. (For example, ASP, please refer to ASP Demo of our company)

  1. The key parameters are pubkey, cmd, ciphertext (required when cmd value is 2).
  2. When the cmd value is 1, it is encrypted mode, and all fields except pubkey and cmd are regarded as data to be encrypted
  3. When the cmd value is 2, it is decryption mode, which will decrypt the ciphertext in the ciphertext field based on pubkey
  4. This interface is an optional auxiliary interface, so it is recommended to try RSA encryption and decryption in native environment first.
  5. Because of URL length and Urlencode standard, the usage scenario of 5. GET mode has certain limitations. If it is not necessary, it is recommended to use POST encryption and decryption interface first

Encryption Request Sample

        
cmd=1&pubkey=-----BEGIN%20PUBLIC%20KEY-----%5CnMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCxZFhu7Yp4T3PS%2Fiech%2FafqyCA%5CnTQhypE2dacgY2wDepP6S1xe1s4RDhrfYl1LnN5VaSrl1w8SXqZkXVl9P3Qj9MAon%5CnhBCH1NdHekLdcKxCcOW9Vjd6HSsTGVxvi5Tjug%2BIh66mtNHkC0ZxcagpgfyarJeQ%5CnhI5So1g1a8C7C6eoqwIDAQAB%5Cn-----END%20PUBLIC%20KEY-----&key1=value1&key2=value2&key3=value3
		
    

Decryption Request Sample

        
cmd=2&pubkey=-----BEGIN%20PUBLIC%20KEY-----%5CnMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCxZFhu7Yp4T3PS%2Fiech%2FafqyCA%5CnTQhypE2dacgY2wDepP6S1xe1s4RDhrfYl1LnN5VaSrl1w8SXqZkXVl9P3Qj9MAon%5CnhBCH1NdHekLdcKxCcOW9Vjd6HSsTGVxvi5Tjug%2BIh66mtNHkC0ZxcagpgfyarJeQ%5CnhI5So1g1a8C7C6eoqwIDAQAB%5Cn-----END%20PUBLIC%20KEY-----&ciphertext=fcoJYQ%2BVG3xs9fTrvSGwkSlfjL8yTkTLN695bT96Y646PR%5C%2F2rADftdkyB0j3%5C%2FhbNjAljwv2P%5C%2FvJlunfu8KZBNYYxm1tTr9O75vy3GOI3vDT%2BWzzrf0ZJ8b9%5C%2FcxoRrIZ%5C%2FcBaRqCcx%2Batzcrjjy32x0kkxP0JicMWJwN1vSCKMnB0%3D
		
    
Received value Describe Type
pubkey Merchant public key (UrlEncode processing required) string
cmd Operation type, optional [1, 2]. 1. Encryption; Step 2.Decrypt number
key=value When cmd=1: data to be encrypted, all fields except pubkey and cmd are regarded as data to be encrypted, and the POST parameter transfer rule is followed string
ciphertext When Cmd=2: Ciphertext to be decrypted, required when operation type is decryption. (UrlEncode processing required) string

RSA Encryption and Decryption Interface(POST)

Request method: POST

Request address:/tools/encryption

Details:

On-line encryption and decryption interface is used to replace the original encryption and decryption class for on-line encryption and decryption when it is inconvenient or impossible to use the original source code for RSA encryption and decryption in some language environments. (For example, ASP, please refer to ASP Demo of our company)

  1. The key parameters are pubkey, cmd
  2. Encryption mode when the cmd value is 1, the plaintext field is required, and the json or other string to be encrypted is passed in
  3. When the cmd value is 2, it is decryption mode, ciphertext field is required, and ciphertext to be decrypted is passed in
  4. This interface is an optional auxiliary interface, so it is recommended to try RSA encryption and decryption in native environment first

Encryption Request Sample

        
cmd=1&pubkey=LS0tLS1CRUdJTiBQVUJMSUMgS0VZLS0tLS0KTUlHZk1BMEdDU3FHU0liM0RRRUJBUVVBQTRHTkFEQ0JpUUtCZ1FDKzJ5UVZQQ0RzT0Exa3ViTjIwWXVLNTlWVgpNT0pQOGpWcXNBMEY4ZUFkb3NnTHQvWVFDRGRXdWlLMERMRytxanoyd2dVVFdNMDM5MVRSWGhkVVBGcUNHaFY5CjBpamJaOWEwQmJJMmZHWHNrMXpEall2TlRBeUg0Ui9ibWc0ejFucEE3UWJacEl2NjNFNFcvMUpyOW8xT2VQQTMKTVViRkQwcDJudVBMRXE5RW9RSURBUUFCCi0tLS0tRU5EIFBVQkxJQyBLRVktLS0tLQ==&plaintext=dGVzdA==
		
    

Decryption Request Sample

        
cmd=2&pubkey=LS0tLS1CRUdJTiBQVUJMSUMgS0VZLS0tLS0KTUlHZk1BMEdDU3FHU0liM0RRRUJBUVVBQTRHTkFEQ0JpUUtCZ1FDKzJ5UVZQQ0RzT0Exa3ViTjIwWXVLNTlWVgpNT0pQOGpWcXNBMEY4ZUFkb3NnTHQvWVFDRGRXdWlLMERMRytxanoyd2dVVFdNMDM5MVRSWGhkVVBGcUNHaFY5CjBpamJaOWEwQmJJMmZHWHNrMXpEall2TlRBeUg0Ui9ibWc0ejFucEE3UWJacEl2NjNFNFcvMUpyOW8xT2VQQTMKTVViRkQwcDJudVBMRXE5RW9RSURBUUFCCi0tLS0tRU5EIFBVQkxJQyBLRVktLS0tLQ==&ciphertext=TjV3SkpZVDR3STlXcEQ5UzhuVG1pdkxwaHVwbU9uM21Tb0p5S3BWeEdtY3FuaGlKV2hLOHhYbHp2VktOQzJLZTVIbXdCRDZaQjYzK0JUYTZUNzlrQlIwb0ZlWThNNGJxM2poRHB5U3VrQ2hnMGVuNitxc0lwNGtqS0ptckNnYXlhTnUyMVoxdXl2R1ZKYlREU3dRbVVwbnRqdWVCTVFZSVBQcTh0czNneDVRPQ==
		
    
Received value Describe Type
pubkey Merchant public key(Base64 encoding is required) string
cmd Operation type,optional [1, 2]. 1.Encryption; Step 2 Decrypt number
plaintext When cmd=1: plaintext to be encrypted, required when cmd is 1 (Base64 encoding is required) string
ciphertext When cmd=2: Ciphertext to be decrypted, required when cmd is 2 (Base64 encoding is required) string
Top