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=0.1&currency=EUR&description=YabandPay test&method=v3.CreatePaymentsWechatMiniPay&notify_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:

"a82442d1a89ad2cabe4d40b7c23a182918cd882bfdc705a4af1bcd451a07360c"

Example Request:

{
    "user": "016683",
    "sign": "a82442d1a89ad2cabe4d40b7c23a182918cd882bfdc705a4af1bcd451a07360c",
    "method": "v3.CreatePaymentsWechatMiniPay",
    "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": "wx54afe855ab7112e8",
        "sub_open_id": "o7AXy5CuUQ0exDlZdhb-M7KMsmEg"
    }
}

Example Response:

{
    "status": true,
    "code": "200",
    "data": {
        "order_id": "20180902014018888",
        "trade_id": "d6775583-3b68-87af-996a-a1d30a7a3923",
        "amount": "0.10",
        "currency": "EUR",
        "settlement_amount": "0.10",
        "settlement_currency": "EUR",
        "exchange_rate": "1",
        "parameters": {
            "appId": "wx54afe855ab7112e8",
            "package": "prepay_id=wx17192406956168becf712f272061576476",
            "paySign": "5446bec354c4b507e1a1fbeb942f3441c65e3b9f6bb6a9ab4027b9800738c113",
            "nonceStr": "0e3b39a276f97d3d9843edebd44f4d76",
            "signType": "HMAC-SHA256",
            "timeStamp": "1555500247"
        },
        "state": "processing"
    },
    "message": ""
}

Please put the return parameters to mini-program, the parameters inside can allow the mini-prorgam to call up WeChat Pay.

results matching ""

    No results matching ""