Get sub_pay_method
[!TIP|style:flat]
This API is only available for Quick Payment. You can use this API to get the value of sub_pay_method after obtaining auth_code to distinguish whether customer use WeChat Pay or Alipay+.
API URL:https://mapi.yabandpay.com/Payments
Method:POST
POST data type:Json
Parameter | Type | Description | Required |
---|---|---|---|
user | String | the UID of cashier account | Required |
sign | String | signature | Required |
method | String | v3.GetSubPay | Required |
time | Long | timestamp | Required |
- Parameter
Parameter | Type | Description | Required |
---|---|---|---|
auth_code | String | it will be obtained through scan the QR Code of customer's App | Required |
Signature:
Lexicographical sequence and URL key-value format new string
"auth_code=135056725249518813&method=v3.GetSubPay&time=1546588959&user=016683"
Use stringA and secret_key to get stringSign
Get Signature:
"be3401e32b3dd6e8a5dc061c9ac4b2aa262577c8123c70b9e6ac196ec6c64f37"
Example Request:
{
"user": "016683",
"sign": "be3401e32b3dd6e8a5dc061c9ac4b2aa262577c8123c70b9e6ac196ec6c64f37",
"method": "v3.GetSubPay",
"time": 1546588959,
"data": {
"auth_code": "135056725249518813"
}
}
Example Response:
{
"status": true,
"code": "200",
"data": {
"auth_code": "135056725249518813",
"sub_pay_method": "WeChat Pay"
},
"message": "",
}
Code types and rules
1. WeChat Pay
An 18-digit pure digital dynamic code used to identify WeChat Pay users with prefixes starting with 10, 11, 12, 13, 14, and 15, which must be read from the user's WeChat wallet in real time.
2. Alipay+
Alipay+ payment codes consist of four types: Alipay+ 19-digit code, CGCP code, AlipayCN code, and AlipayHK code. Each type of payment code complies with specific rules.
Refer to the table below for Alipay+ payment code types and corresponding rules.
Type | Rules |
---|---|
Alipay+ 19-digit code | Starts with 28. The 3rd digit is fixed as 9, and the 6th digit from the end is fixed as 6. Example: 2893612204263667830. |
CGCP code | Starts with 25, 26, 27, 28, 29, or 30. Contains 1-digit agreement ID (by default equals 1) and 3-digit routing numbers that are used to recognize the MPP. Example: 281010897274821897274821, where the routing number is 010. |
AlipayCN code | Length: 16 to 24 digits. Starts with 25, 26, 27, 28, 29, or 30. Example: 28024456785672301. |
AlipayHK code | Length: 17 to 19 digits. Starts with 25, 26, 27, 28, 29, or 30. Example: 280244567856723026. |