API REFERENCE
In-App Payments
Tip
Note: Provide your WeChat Mini Program Appid to YabandPay. The feature must be activated before use.
| Parameter | Type | Description | Required |
|---|---|---|---|
| user | String | Cashier account UID | Required |
| sign | String | Signature | Required |
| method | String | v3.CreatePaymentsWechatAPPPay | Required |
| time | Long | Timestamp | Required |
- Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| pay_method | String | online | Required |
| sub_pay_method | String | WeChat Pay | Required |
| order_id | String | Merchant order ID | Required |
| amount | String | Amount as a numeric string. For example, enter 24.99 for € 24.99. CNY amount >=1; EUR amount >=0.1. | Required |
| currency | String | ISO 4217 currency code, for example EUR or CHF | Required |
| description | String | Order description | Required |
| demo | String | Custom field | Optional |
| timeout | String | Expiration time in minutes (0-1440) | Required |
| notify_url | String | Asynchronous notification URL after payment | Required |
| sub_app_id | String | App APPID | Required |
Signature example:
Sorted parameters concatenated into a URL-style query string
"amount=0.1¤cy=EUR&description=YabandPay test&method=v3.CreatePaymentsWechatAPPPay¬ify_url=https://www.yabandpay.com/notify&order_id=202459846951635165&pay_method=online&sub_app_id=wxc72defa5cec6dfc7&sub_pay_method=WeChat Pay&time=1546588959&timeout=0&user=YOUR_CASHIER_UID"
Sign stringA using secret_key
The resulting signature is:
"YOUR_SIGNATURE"
Request example:
{
"user": "YOUR_CASHIER_UID",
"sign": "YOUR_SIGNATURE",
"method": "v3.CreatePaymentsWechatAPPPay",
"time": 1546588959,
"data": {
"description": "YabandPay test",
"timeout": "0",
"pay_method": "online",
"sub_pay_method": "WeChat Pay",
"order_id": "YOUR_ORDER_ID",
"amount": "0.1",
"currency": "EUR",
"notify_url": "https://www.yabandpay.com/notify",
"sub_app_id": "wxc72defa5cec6dfc7"
}
}
Response example:
{
"status": true,
"code": "200",
"data": {
"order_id": "YOUR_ORDER_ID",
"trade_id": "eaf6b81c-1a19-3ce5-d2d7-4002d6812c76",
"amount": "0.10",
"currency": "EUR",
"parameters": {
"appid": "wxc72defa5cec6dfc7",
"partnerid": "299811131",
"prepayid": "wx15164758052100530086b5391151892200",
"package": "Sign=WXPay",
"noncestr": "_YB_5d2c3dbe544a4",
"timestamp": "1563180478",
"sign": "YOUR_SIGNATURE"
},
"state": "processing"
},
"message": ""
}
Pass this parameter to the corresponding App interface to launch WeChat Pay.
Additional information:
Response result:
-
A successful request returns "status": true.
-
A failed request returns "status": false.
We strongly recommend using both Query Order and Asynchronous Notifications to keep payment statuses accurate and up to date.
Response codes:
| Status | Code | Message |
|---|---|---|
| true | 200 | Success |
| false | -1000 | Internal error |
| false | -3001 | Required field is missing |
| false | -403 | The signature Error |
| false | -4011 | Not support the payment method |
