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.yabandmedia.com/pay/webhook.php&order_id=20180902014018888&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:
"86c20dd24fd8936fcf1998f0c8df01a7038b72bac8eeb998ad934681c4562e3c"
Example Request:
{
"user": "016683",
"sign": "86c20dd24fd8936fcf1998f0c8df01a7038b72bac8eeb998ad934681c4562e3c",
"method": "v3.CreatePaymentsWechatAPPPay",
"time": 1546588959,
"data": {
"description": "YabandPay test",
"timeout": "0",
"pay_method": "online",
"sub_pay_method": "WeChat Pay",
"order_id": "20180902014018888",
"amount": "0.1",
"currency": "EUR",
"notify_url": "https://www.yabandmedia.com/pay/webhook.php",
"sub_app_id": "wxc72defa5cec6dfc7"
}
}
Example Response:
{
"status": true,
"code": "200",
"data": {
"order_id": "20180902014018888",
"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": ""
}