In-App Payment
[!TIP|style:flat]
Note: Please provide the Appid of your App to YabandPay, which can only be used after activation.
When customer make payment in Apps, it will open up WeChat app to process the payment.
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.CreatePaymentsWechatAPPPay | Required |
time | Long | timestamp | Required |
- Parameter
Parameter | Type | Description | Required |
---|---|---|---|
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 |
redirect_url | String | the redirect URL after payment is completed | Optional |
sub_app_id | String | the APPID from WeChat Open Platform | Required |
Signature:
Lexicographical sequence and URL key-value format new 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=wx54afe855ab7112e8&sub_open_id=o7AXy5CuUQ0exDlZdhb-M7KMsmEg&sub_pay_method=WeChat Pay&time=1546588959&timeout=0&user=016683"
Use stringA and secret_key to get stringSign
Get Signature:
"51811ce6c796e4a7e2ee7ebf5e6cce1de93ee3c5f485fd06022228d599553352"
Example Request:
{
"user": "016683",
"sign": "51811ce6c796e4a7e2ee7ebf5e6cce1de93ee3c5f485fd06022228d599553352",
"method": "v3.CreatePaymentsWechatAPPPay",
"time": 1546588959,
"data": {
"description": "YabandPay test",
"timeout": "0",
"pay_method": "online",
"sub_pay_method": "WeChat Pay",
"order_id": "202459846951635165",
"amount": "0.1",
"currency": "EUR",
"notify_url": "https://www.yabandpay.com/notify",
"sub_app_id": "wxc72defa5cec6dfc7"
}
}
Example Response:
{
"status": true,
"code": "200",
"data": {
"order_id": "202459846951635165",
"trade_id": "eaf6b81c-1a19-3ce5-d2d7-4002d6812c76",
"amount": "0.10",
"currency": "EUR",
"settlement_amount": "0.10",
"settlement_currency": "EUR",
"exchange_rate": "1",
"parameters": {
"appid": "wxc72defa5cec6dfc7",
"partnerid": "299811131",
"prepayid": "wx15164758052100530086b5391151892200",
"package": "Sign=WXPay",
"noncestr": "_YB_5d2c3dbe544a4",
"timestamp": "1563180478",
"sign": "B2DABBB957F96105AF007BA7EAB6D9879B0C3A402E884F64FE9CD3049106EF01"
},
"state": "processing"
},
"message": ""
}
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 |