Documentation/API Reference

API REFERENCE

H5 Payments

POSThttps://mapi.yabandpay.com/Payments
Live API
API PLAYGROUND · Live API

H5 Payments

POSThttps://mapi.yabandpay.com/Payments
Automatically signed with your credentials

Request parameters10

Required fields first

H5 Payments

pay_methodRequiredstringdata.pay_methodonline
sub_pay_methodRequiredstringdata.sub_pay_methodWeChat Pay
amountRequiredstringdata.amountAmount as a numeric string. For example, enter 24.99 for € 24.99. CNY amount >=1; EUR amount >=0.1.
currencyRequiredstringdata.currencyE currency code, ISO 4217, such as EUR or CHF
descriptionRequiredstringdata.descriptionOrder description
timeoutRequiredstringdata.timeoutExpiration time in minutes (0-1440)
notify_urlRequiredstringdata.notify_urlAsynchronous notification URL after payment
ip_addressRequiredstringdata.ip_addressIp address
Optional parameters 2
demoOptionalstringdata.demoCustom field
redirect_urlOptionalstringdata.redirect_urlRedirect URL after payment

Credentials stay on this page. Your secret key is never stored or sent to the documentation server.

Tip

Note: WeChat does not support H5 payments by default. Apply to YabandPay to activate this feature before use.

ParameterTypeDescriptionRequired
userStringCashier account UIDRequired
signStringSignatureRequired
methodStringv3.CreatePaymentsWechatH5PayRequired
timeLongTimestampRequired
  • Parameters
ParameterTypeDescriptionRequired
pay_methodStringonlineRequired
sub_pay_methodStringWeChat PayRequired
order_idStringMerchant order IDRequired
amountStringAmount as a numeric string. For example, enter 24.99 for € 24.99. CNY amount >=1; EUR amount >=0.1.Required
currencyStringE currency code, ISO 4217, such as EUR or CHFRequired
descriptionStringOrder descriptionRequired
demoStringCustom fieldOptional
timeoutStringExpiration time in minutes (0-1440)Required
notify_urlStringAsynchronous notification URL after paymentRequired
redirect_urlStringRedirect URL after paymentOptional
ip_addressStringIp addressRequired

Signature example:

Sorted parameters concatenated into a URL-style query string

"amount=0.1&currency=EUR&demo=test&description=YabandPay test&ip_address=127.0.0.1&method=v3.CreatePaymentsWechatH5Pay&notify_url=https://www.yabandpay.com/notify&order_id=202487816549841654&pay_method=online&redirect_url=https://www.yabandpay.com&sub_pay_method=WeChat Pay&time=1555498137&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.CreatePaymentsWechatH5Pay",
  "time": 1555498137,
  "data": {
    "amount": "0.1",
    "currency": "EUR",
    "demo": "test",
    "description": "YabandPay test",
    "notify_url": "https://www.yabandpay.com/notify",
    "order_id": "YOUR_ORDER_ID",
    "pay_method": "online",
    "redirect_url": "https://www.yabandpay.com",
    "sub_pay_method": "WeChat Pay",
    "timeout": "0",
    "ip_address" : "127.0.0.1"
  }
}

Response example:

{
    "status": true,
    "code": "200",
    "data": {
        "order_id": "YOUR_ORDER_ID",
        "trade_id": "ced03b0a-3bb1-ce9b-237e-eed85f4b7e33",
        "amount": "0.10",
        "currency": "EUR",
        "parameters": {
            "pay_url": "https://pay.yabandpay.com/payments/wechat_native_callback/order/M80d5a3f88dfb16716f04479e36dda8d79fbea0dc52cf8d902bd3330bb41"
        },
        "state": "processing"
    },
    "message": ""
}

Pass the pay_url parameter to the corresponding H5 interface to launch WeChat Pay.

Additional information:

Response result:
  1. A successful request returns "status": true.

  2. 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:
StatusCodeMessage
true200Success
false-1000Internal error
false-3001Required field is missing
false-403The signature Error
false-4011Not support the payment method