Dokumentation/API-Referenz

API REFERENCE

Zahlungen im Mini-Programm

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

Zahlungen im Mini-Programm

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.

Tipp

Hinweis: Stellen Sie YabundPay die App-ID Ihres WeChat-Mini-Programms bereit. Die Funktion muss vor der Nutzung aktiviert werden.

ParameterTypBeschreibungErforderlich
userStringKassiererkonauf UIDErforderlich
signStringSignatureErforderlich
methodStringv3.CreatePaymentsWechatMiniPayErforderlich
timeLongTimestampErforderlich
  • Parameter
ParameterTypBeschreibungErforderlich
pay_methodStringonlineErforderlich
sub_pay_methodStringWeChat PayErforderlich
order_idStringHändlerbestellnummerErforderlich
amountStringBetrag als numerische Zeichenfolge. Geben Sie zum Beispiel 24.99 for € 24.99. CNY-Betrag >=1; EUR-Betrag >=0.1.Erforderlich
currencyStringISO 4217 Währungscode, zum Beispiel EUR or CHFErforderlich
descriptionStringBestellbeschreibungErforderlich
demoStringBenutzerdefiniertes FeldOptional
timeoutStringAblaufzeit in Minuten (0-1440)Erforderlich
notify_urlStringURL für asynchrone Benachrichtigung nach der ZahlungErforderlich
sub_app_idStringMini Program APPIDErforderlich
sub_open_idStringUser OpenID obtained by the Mini ProgramErforderlich

Signaturbeispiel:

Nach Parametern sortierte Werte, verkettet zu einer URL-ähnlichen Abfragezeichenfolge

"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"

Signieren Sie die Zeichenfolge A mit secret_key

Die resultierende Signatur lautet:

"YOUR_SIGNATURE"

Anfragebeispiel:

{
    "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"
    }
}

Antwortbeispiel:

{
    "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": ""
}

Verwenden Sie den zurückgegebenen Wert von „parameters“, um die Zahlung im WeChat-Mini-Programm zu starten.

Zusätzliche Informationen:

Antwortergebnis:
  1. Eine erfolgreiche Anfrage gibt "status": true.

  2. Eine fehlgeschlagene Anfrage gibt "status": false.

Wir empfehlen dringend, sowohl Bestellabfrage und Asynchrone Benachrichtigungen um Zahlungsstatus korrekt und aktuell zu halten.

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