Documentatie/API-referentie

API REFERENCE

Betalingen via miniprogramma

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

Betalingen via miniprogramma

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

Request parameters10

Required fields first

小程序支付

pay_methodRequiredstringdata.pay_methodonline
sub_pay_methodRequiredstringdata.sub_pay_methodWeChat Pay
amountRequiredstringdata.amount金额数字。例如 € 24.99 应该写成24.99,CNY金额>=1,欧元金额>=0.1
currencyRequiredstringdata.currency货币代码,ISO 4217,例如EUR,CHF
descriptionRequiredstringdata.description订单描述
timeoutRequiredstringdata.timeout过期时间单位分钟(0-1440)
notify_urlRequiredstringdata.notify_url支付完成后异步通知地址
sub_app_idRequiredstringdata.sub_app_id小程序的APPID
sub_open_idRequiredstringdata.sub_open_id小程序获得的用户OpenID
Optional parameters 1
demoOptionalstringdata.demo自定义字段

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

Tip

Opmerking: Geef uw WeChat Mini Program-Appid door aan YabandPay. De functie moet vóór gebruik worden geactiveerd.

API-URL:https://mapi.yabandpay.com/Payments

Methode:POST

POST gegevenstype:Json

ParameterTypeBeschrijvingVerplicht
userStringKassiersaccount UIDVerplicht
signStringSignatureVerplicht
methodStringv3.CreatePaymentsWechatMiniPayVerplicht
timeLongTimestampVerplicht
  • Parameters
ParameterTypeBeschrijvingVerplicht
pay_methodStringonlineVerplicht
sub_pay_methodStringWeChat PayVerplicht
order_idStringBestel-ID van de handelaarVerplicht
amountStringBedrag als numerieke tekenreeks. Voer bijvoorbeeld 24.99 in voor € 24.99. Het CNY-bedrag moet >=1 zijn; het EUR-bedrag >=0.1.Verplicht
currencyStringISO-valutacode 4217, bijvoorbeeld EUR of CHFVerplicht
descriptionStringBestelomschrijvingVerplicht
demoStringAangepast veldOptioneel
timeoutStringVervaltijd in minuten (0-1440)Verplicht
notify_urlStringURL voor asynchrone melding na betalingVerplicht
sub_app_idStringMini Program-APPIDVerplicht
sub_open_idStringOpenID van de gebruiker, verkregen via het Mini ProgramVerplicht

Handtekeningvoorbeeld:

Gesorteerde parameters aaneengevoegd tot een queryreeks in URL-stijl

"amount=1.23&currency=EUR&description=test&method=v3.CreatePaymentsWechatMiniPay&notify_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"

Onderteken stringA met secret_key

De resulterende handtekening is:

"YOUR_SIGNATURE"

Aanvraagvoorbeeld:

{
    "user": "011844",
    "sign": "YOUR_SIGNATURE",
    "method": "v3.CreatePaymentsWechatMiniPay",
    "time": 1732672545,
    "data": {
        "description": "test",
        "timeout": "300",
        "pay_method": "online",
        "sub_pay_method": "WeChat Pay",
        "order_id": "YOUR_ORDER_ID",
        "amount": "1.23",
        "currency": "EUR",
        "notify_url": "https://imenuapi.yabandpay.com/api/Notify/yabandpay",
        "sub_open_id": "opilP5dyazU7pTpyps8TDc53OGyU",
        "sub_app_id": "wx7a5355d3d2a904a4"
    }
}

Antwoordvoorbeeld:

{
    "status": true,
    "code": "200",
    "data": {
        "order_id": "YOUR_ORDER_ID",
        "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": ""
}

Gebruik de geretourneerde waarde van "parameters" om de WeChat Mini Program-betaling te starten.

Aanvullende informatie:

Resultaat van het antwoord:
  1. Een geslaagde aanvraag retourneert "status": true.

  2. Een mislukte aanvraag retourneert "status": false.

We raden sterk aan zowel Bestelling opvragen als Asynchrone meldingen te gebruiken om de betalingsstatussen actueel en nauwkeurig te houden.

Antwoordcodes:
StatusCodeBericht
true200Success
false-1000Internal error
false-3001Required field is missing
false-403The signature Error
false-4011Not support the payment method