|
@@ -1,33 +1,8 @@
|
|
-# 3.General API specification
|
|
+# 3. API Interface
|
|
|
|
|
|
-Common interface between merchant server and AllPay gateway, each channel has functions including: Purchase, Refund, Inqiury interface.
|
|
+## 3.1. Purchase interface
|
|
|
|
|
|
-## 3.1. Description of verifying the signature
|
|
+Merchant could use purchase interface to initiate a transaction, send transaction information to payment channels through AllPay gateway.
|
|
-
|
|
|
|
-
|
|
|
|
-1.For a POST request message sent to the ALLPAY system, in which all incoming parameters (except signature parameters) according to the field name of ASCII smallest sequence (dictionary), using the format of the URL key/value pair (key1 = value1 & key2 = value2... ) spliced into a string String1.
|
|
|
|
-
|
|
|
|
-2.At the end of String1, the signature key K1(assigned at ALLPAY upon access) agreed by both parties is spliced directly (no need to connect with "&"), resulting in a stringSignTemp string, and an md5 operation on stringSignTemp to get the value of signature.
|
|
|
|
-
|
|
|
|
-3.Sample signature string:
|
|
|
|
-
|
|
|
|
-```
|
|
|
|
-acqID=99020344&backURL=https://www.baidu.com&charSet=UTF-8&frontURL=nil&goodsInfo=iPhone x&merID=800039253992510&merReserve=&orderAmount=1.00&orderCurrency=INR&orderNum=ap0180417163142&paymentSchema=EB&signType=MD5&transTime=20180417163142&transType=PURC&trxn_email_id=benson.zhang@allpayx.com&trxn_firstname=benson zhang&trxn_is_coupon_enabled=1&trxn_phone=15026528888&unique_id=abcde12345&version=VER000000002f3e0e436cd24430aa4aaaed597450f26
|
|
|
|
-```
|
|
|
|
-
|
|
|
|
-## 3.2. General API access address
|
|
|
|
-
|
|
|
|
- Transaction Type |Test Address|Production Address
|
|
|
|
- ------- |-----------|-------
|
|
|
|
- Purchase |https://testapi.allpayx.com/pay/v1 |https://api.allpayx.com/pay/v1
|
|
|
|
- Inqiury |https://testapi.allpayx.com/pay/v1 |https://api.allpayx.com/pay/v1
|
|
|
|
- Refund |https://testapi.allpayx.com/pay/v1 |https://api.allpayx.com/pay/v1
|
|
|
|
-
|
|
|
|
-## 3.3. Purchase interface
|
|
|
|
-
|
|
|
|
-1. Request message format
|
|
|
|
-
|
|
|
|
- This field is a list of common fields, sending, every channel needs some channel channel exclusive field, specific fields please go to the channel's exclusive canal to the fields that view. Consumer interface is divided into jump transformation and parameters return type, default to jump transformation, parameters return type will be explained in chapter 4 channels (exclusive) inside.
|
|
|
|
|
|
|
|
No. |Field Name |Max.Length|Type|Parameter Name|Comment
|
|
No. |Field Name |Max.Length|Type|Parameter Name|Comment
|
|
-----|-----|----|----|------|------
|
|
-----|-----|----|----|------|------
|
|
@@ -42,17 +17,13 @@ acqID=99020344&backURL=https://www.baidu.com&charSet=UTF-8&frontURL=nil&goodsInf
|
|
9|Merchant Reserved |1024 |Text|merReserve |Merchant reserved content, can pass any content, such as purchase information, account number, etc., but do not pass special symbols, such as commas.
|
|
9|Merchant Reserved |1024 |Text|merReserve |Merchant reserved content, can pass any content, such as purchase information, account number, etc., but do not pass special symbols, such as commas.
|
|
10|Merchant ID |15 |Text|merID |Merchant ID, assigned by AllPay
|
|
10|Merchant ID |15 |Text|merID |Merchant ID, assigned by AllPay
|
|
11|Acquirer ID |11 |Text|acqID |"99020344"
|
|
11|Acquirer ID |11 |Text|acqID |"99020344"
|
|
- 12|Payment Channel Code |10 |Text|paymentSchema|Payment Channel Code:[Click here for details](https://git.allpayx.com/OpenAPI/b2c/src/master/pc_api/paymentSchema.md)
|
|
+ 12|Payment Channel Code |10 |Text|paymentSchema|UnionPay:"UP",Wechat:"WX,Alipay:"APMP"
|
|
13|Goods Information |60 |Text|goodsInfo |Goods Information
|
|
13|Goods Information |60 |Text|goodsInfo |Goods Information
|
|
14|Transaction Time |14 |Text|transTime |Transaction time, format :" yyymmddhhmmss"
|
|
14|Transaction Time |14 |Text|transTime |Transaction time, format :" yyymmddhhmmss"
|
|
15|Signature Type |3 |Text|signType |MD5
|
|
15|Signature Type |3 |Text|signType |MD5
|
|
16|Signature Data |32 |Text|signature |MD5 signature
|
|
16|Signature Data |32 |Text|signature |MD5 signature
|
|
-
|
|
|
|
-2. Jump transformation Purchase interface response message
|
|
|
|
-
|
|
|
|
- The merchant needs to provide an HTTP/HTTPS protocol interface that is included in the parameters passed to the SDK, the backURL. After the payment is complete, the AllPay server will call the backURL as a Get, informing the payment result.
|
|
|
|
|
|
|
|
-The parameters are as follows:
|
|
+## 3.2. Purchase Response from AllPay
|
|
|
|
|
|
No. |Field Name |Max.Length|Type|Parameter name|Comment
|
|
No. |Field Name |Max.Length|Type|Parameter name|Comment
|
|
-----|-----|----|----|------|------
|
|
-----|-----|----|----|------|------
|
|
@@ -69,15 +40,18 @@ The parameters are as follows:
|
|
11|Gateway Transaction ID |32|Text|transID |The unique transaction id generated by the gateway.
|
|
11|Gateway Transaction ID |32|Text|transID |The unique transaction id generated by the gateway.
|
|
12|Merchant ID |15 |Text|merID |Merchant ID, assigned by AllPay
|
|
12|Merchant ID |15 |Text|merID |Merchant ID, assigned by AllPay
|
|
13|Acquirer ID |11 |Text|acqID |"99020344"
|
|
13|Acquirer ID |11 |Text|acqID |"99020344"
|
|
- 14|Payment Channel Code |10 |Text|paymentSchema|Payment Channel Code:[Click here for details](https://git.allpayx.com/OpenAPI/b2c_pc_payment/src/master/paymentSchema.md)
|
|
+ 14|Payment Channel Code |10 |Text|paymentSchema|UnionPay:"UP",Wechat:"WX,Alipay:"APMP"
|
|
15|Response Code |2 |Text|RespCode |00 stands for success; 01 stands for fail.
|
|
15|Response Code |2 |Text|RespCode |00 stands for success; 01 stands for fail.
|
|
16|Response Message |20 |Text|RespMsg |Response message, all English characters
|
|
16|Response Message |20 |Text|RespMsg |Response message, all English characters
|
|
17|Transaction Time |14 |Text|transTime |Transaction time, format :" yyymmddhhmmss"
|
|
17|Transaction Time |14 |Text|transTime |Transaction time, format :" yyymmddhhmmss"
|
|
18|Gateway process time |14 |Text|GWTime |YYYYMMDDHHMMSS this should be a GWtime, currently is local transaction time
|
|
18|Gateway process time |14 |Text|GWTime |YYYYMMDDHHMMSS this should be a GWtime, currently is local transaction time
|
|
19|Signature Type |3 |Text|signType |MD5
|
|
19|Signature Type |3 |Text|signType |MD5
|
|
20|Signature Data |32 |Text|signature |MD5 signature
|
|
20|Signature Data |32 |Text|signature |MD5 signature
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+## 3.3. Inqiury interface
|
|
|
|
+
|
|
|
|
|
|
-## 3.4. Inqiury interface
|
|
|
|
|
|
|
|
1. Interface specification
|
|
1. Interface specification
|
|
|
|
|
|
@@ -85,6 +59,7 @@ The parameters are as follows:
|
|
|
|
|
|
2. Request message format
|
|
2. Request message format
|
|
|
|
|
|
|
|
+
|
|
No. |Field Name |Max.Length|Type|Parameter name|Comment
|
|
No. |Field Name |Max.Length|Type|Parameter name|Comment
|
|
-----|-----|----|----|------|------
|
|
-----|-----|----|----|------|------
|
|
1|Message Version|12|Text|version |"VER000000002"
|
|
1|Message Version|12|Text|version |"VER000000002"
|
|
@@ -94,13 +69,15 @@ The parameters are as follows:
|
|
5|Merchant Reserved |1024 |Text|merReserve |Merchant reserved content
|
|
5|Merchant Reserved |1024 |Text|merReserve |Merchant reserved content
|
|
6|Merchant ID |15 |Text|merID |Merchant ID, assigned by AllPay
|
|
6|Merchant ID |15 |Text|merID |Merchant ID, assigned by AllPay
|
|
7|Acquirer ID |11 |Text|acqID |"99020344"
|
|
7|Acquirer ID |11 |Text|acqID |"99020344"
|
|
- 8|Payment Channel Code |10 |Text|paymentSchema|Payment Channel Code:[Click here for details](https://git.allpayx.com/OpenAPI/b2c_pc_payment/src/master/paymentSchema.md)
|
|
+ 8|Payment Channel Code |10 |Text|paymentSchema|UnionPay:"UP",Wechat:"WX,Alipay:"APMP"
|
|
9|Transaction Time |14 |Text|transTime |Transaction time, format :" yyymmddhhmmss"
|
|
9|Transaction Time |14 |Text|transTime |Transaction time, format :" yyymmddhhmmss"
|
|
10|Signature Type |3 |Text|signType |MD5
|
|
10|Signature Type |3 |Text|signType |MD5
|
|
11|Signature Data |32 |Text|signature |MD5 signature
|
|
11|Signature Data |32 |Text|signature |MD5 signature
|
|
|
|
|
|
|
|
+
|
|
3. Response message format
|
|
3. Response message format
|
|
|
|
|
|
|
|
+
|
|
No. |Field Name |Max.Length|Type|Parameter name|Comment
|
|
No. |Field Name |Max.Length|Type|Parameter name|Comment
|
|
-----|-----|----|----|------|------
|
|
-----|-----|----|----|------|------
|
|
1|Message Version|12|Text|version |"VER000000002"
|
|
1|Message Version|12|Text|version |"VER000000002"
|
|
@@ -117,7 +94,7 @@ The parameters are as follows:
|
|
12|Signature Type |3 |Text|signType |MD5
|
|
12|Signature Type |3 |Text|signType |MD5
|
|
13|Signature Data |32 |Text|signature |MD5 signature
|
|
13|Signature Data |32 |Text|signature |MD5 signature
|
|
|
|
|
|
-## 3.5. Refund interface
|
|
+## 3.4. Refund interface
|
|
|
|
|
|
1.Interface specification
|
|
1.Interface specification
|
|
|
|
|
|
@@ -136,12 +113,13 @@ This interface provides the function of refund transaction for access merchants.
|
|
7|Merchant Reserved |1024 |Text|merReserve |Merchant reserved content, can pass any content, such as purchase information, account number, etc., but do not pass special symbols, such as commas.
|
|
7|Merchant Reserved |1024 |Text|merReserve |Merchant reserved content, can pass any content, such as purchase information, account number, etc., but do not pass special symbols, such as commas.
|
|
8|Merchant ID |15 |Text|merID |Merchant ID, assigned by AllPay
|
|
8|Merchant ID |15 |Text|merID |Merchant ID, assigned by AllPay
|
|
9|Acquirer ID |11 |Text|acqID |"99020344"
|
|
9|Acquirer ID |11 |Text|acqID |"99020344"
|
|
- 10|Payment Channel Code |10 |Text|paymentSchema|Payment Channel Code:[Click here for details](https://git.allpayx.com/OpenAPI/b2c_pc_payment/src/master/paymentSchema.md)
|
|
+ 10|Payment Channel Code |10 |Text|paymentSchema|UnionPay:"UP",Wechat:"WX,Alipay:"APMP"
|
|
11|Transaction Time |14 |Text|transTime |Transaction time, format :" yyymmddhhmmss"
|
|
11|Transaction Time |14 |Text|transTime |Transaction time, format :" yyymmddhhmmss"
|
|
12|Signature Type |3 |Text|signType |MD5
|
|
12|Signature Type |3 |Text|signType |MD5
|
|
13|Signature Data |32 |Text|signature |MD5 signature
|
|
13|Signature Data |32 |Text|signature |MD5 signature
|
|
|
|
|
|
3.Response message format
|
|
3.Response message format
|
|
|
|
+
|
|
|
|
|
|
No. |Field Name |Max.Length|Type|Parameter name|Comment
|
|
No. |Field Name |Max.Length|Type|Parameter name|Comment
|
|
-----|-----|----|----|------|------
|
|
-----|-----|----|----|------|------
|
|
@@ -157,5 +135,4 @@ This interface provides the function of refund transaction for access merchants.
|
|
10|Transaction Time |14 |Text|transTime |Transaction time, format :" yyymmddhhmmss"
|
|
10|Transaction Time |14 |Text|transTime |Transaction time, format :" yyymmddhhmmss"
|
|
11|Gateway process time |14 |Text|GWTime |YYYYMMDDHHMMSS this should be a GWtime, currently is local transaction time
|
|
11|Gateway process time |14 |Text|GWTime |YYYYMMDDHHMMSS this should be a GWtime, currently is local transaction time
|
|
12|Signature Type |3 |Text|signType |MD5
|
|
12|Signature Type |3 |Text|signType |MD5
|
|
- 13|Signature Data |32 |Text|signature |MD5 signature
|
|
+ 13|Signature Data |32 |Text|signature |MD5 signature
|
|
-
|
|
|