Mini Program Payment
[!TIP|style:flat]
Note: Please provide the Appid of WeChat mini program to YabandPay, which can only be used after activation.
API URL:https://mapi.yabandpay.com/Payments
Method:POST
POST data type:Json
Parameter | Type | Description | Mark |
---|---|---|---|
user | String | the UID of cashier account | Required |
sign | String | signature | Required |
method | String | v3.CreatePaymentsWechatMiniPay | Required |
time | Long | timestamp | Required |
- Parameter
Parameter | Type | Description | Mark |
---|---|---|---|
pay_method | String | online | Required |
sub_pay_method | String | WeChat Pay | Required |
order_id | String | order id from Merchant | Required |
amount | String | format in cents: € 24.99 should be 24.99, the min amount is EUR 0.10 or CNY1 | Required |
currency | String | ISO 4217, For example EUR, CHF | Required |
description | String | order description | Required |
demo | String | custom field | Optional |
timeout | String | value 0 means 1440 minutes | Optional |
notify_url | String | asynchronous notification url | Required |
sub_app_id | String | the APPID of WeChat mini-program account | Required |
sub_open_id | String | open_id of customer, it will be obtained through the API of WeChat | Required |
Signature:
Lexicographical sequence and URL key-value format new string
"amount=1.23¤cy=EUR&description=test&method=v3.CreatePaymentsWechatMiniPay¬ify_url=https://imenuapi.yabandpay.com/api/Notify/yabandpay&order_id=202413271095510835&pay_method=online&sub_app_id=wx7a5355d3d2a904a4&sub_open_id=opilP5dyazU7pTpyps8TDc53OGyU&sub_pay_method=WeChat Pay&time=1732672545&timeout=300&user=011844"
Use stringA and secret_key to get stringSign
Get Signature:
"05eb5bf244f6c6d5dfcfcb427f319da870089463180d29cbd414f59d5db8fc7f"
Example Request:
{
"user": "011844",
"sign": "4051095367cc625eb827ba287bbfcf9eff84f5f49ae746264712a0f896adcbce",
"method": "v3.CreatePaymentsWechatMiniPay",
"time": 1732672545,
"data": {
"description": "test",
"timeout": "300",
"pay_method": "online",
"sub_pay_method": "WeChat Pay",
"order_id": "202413271095510835",
"amount": "1.23",
"currency": "EUR",
"notify_url": "https://imenuapi.yabandpay.com/api/Notify/yabandpay",
"sub_open_id": "opilP5dyazU7pTpyps8TDc53OGyU",
"sub_app_id": "wx7a5355d3d2a904a4"
}
}
Example Response:
{
"status": true,
"code": "200",
"data": {
"order_id": "202413271095510835",
"trade_id": "e405c9d5-069f-34f5-9eb2-16919cd7e411",
"amount": "1.23",
"currency": "EUR",
"parameters": {
"appId": "wx7a5355d3d2a904a4",
"package": "prepay_id=wx270959141300258779d83459e08e4b0000",
"paySign": "Av83Y6u+Ua8hkU3VyoAN5MUu7cm9vPfID8OstMkS+3BbbNnl1bax5nRapKoFTz2DUzaGyzPiT+gDUzyGW7DshqPLy+NsmKvQGSQM5vyfSjXsz5F4LKOeI3YaaUBTnVXkKX6qBrzbVUfStyjvYwtqPJUXx0X2zZEiGV5ScEf44IOmWQXeiRKyv8j34KnhMHcSFgSVAPN/B10Z1BnN34VUpak6DyaM/d0zfEkUbtODzD260An9NBSKZqAg1Wh35o/Eebqd5KoPIPX74lfRjUH4O9IZUCXnb2NqTxCR2M8j7Yx5zzz3xiQGhqEPzc7m0vXQTYv3TjD+158LeF993e/c2w==",
"nonceStr": "0ypozLSDOzutrUA7WUI7eTfWUHtDqO9n",
"signType": "RSA",
"timeStamp": "1732672754"
},
"state": "processing"
},
"message": ""
}
Please put the return parameters to mini-program, the parameters inside can allow the mini-prorgam to call up WeChat Pay.
More Information:
Return results:
On a successful API call, the response will be
"status": true
.On a failed API call, the response will be
"status": false
.
We strongly recommend using both Order Query and Asynchronous Notification simultaneously to synchronize and update payment status, ensuring real-time accuracy of payment information.
Result/Error codes:
Status | Code | Message |
---|---|---|
true | 200 | Success |
fales | -1000 | Internal error |
fales | -3001 | Required field is missing |
fales | -403 | The signature Error |
fales | -4011 | Not support the payment method |