API REFERENCE
Einheitlicher Zahlungsauftrag
API-Parameter, Signaturanweisungen sowie Anfrage- und Antwortbeispiele aus der bestehenden SimplePay-API-Dokumentation.
Unterstützte Zahlungsmethoden: WeChat Pay und Alipay
Tipp
Please note that this payment option only supports WeChat Pay and Alipay. We recommend the Hosted Checkout, which includes all enabled Zahlungsmethodes.
| Parameter | Typ | Beschreibung | Erforderlich |
|---|---|---|---|
| user | String | Kassiererkonto UID | Erforderlich |
| sign | String | Signature | Erforderlich |
| method | String | v3.CreatePayments | Erforderlich |
| time | Long | Timestamp | Erforderlich |
- Parameter
| Parameter | Typ | Beschreibung | Erforderlich |
|---|---|---|---|
| pay_method | String | online | Erforderlich |
| sub_pay_method | String | WeChat Pay,Alipay,YabandPay | Erforderlich |
| order_id | String | Händlerbestellnummer | Erforderlich |
| amount | String | Betrag als numerische Zeichenfolge. Geben Sie beispielsweise 24.99 for € 24.99. CNY amount >=1; EUR amount >=0.1. | Erforderlich |
| currency | String | ISO 4217 Währungscode, zum Beispiel EUR oder CHF | Erforderlich |
| description | String | Bestellbeschreibung | Erforderlich |
| demo | String | Benutzerdefiniertes Feld | Optional |
| timeout | String | Ablaufzeit in Minuten (0-1440) | Erforderlich |
| redirect_url | String | Weiterleitungs-URL nach der Zahlung | Erforderlich |
| notify_url | String | URL für asynchrone Benachrichtigung nach der Zahlung | Erforderlich |
Signaturbeispiel:
Nach Parametern sortierte Werte, verkettet zu einer URL-ähnlichen Abfragezeichenfolge
"amount=0.1¤cy=EUR&demo=test&description=YabandPay test&method=v3.CreatePayments¬ify_url=https://www.yabandpay.com/notify&order_id=2024849687894683&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"
Einfragebeispiel:
{
"user": "YOUR_CASHIER_UID",
"sign": "YOUR_SIGNATURE",
"method": "v3.CreatePayments",
"time": 1555498137,
"data": {
"amount": "0.2",
"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"
}
}
Eintwortbeispiel:
{
"status": true,
"code": "200",
"data": {
"order_id": "YOUR_ORDER_ID",
"trade_id": "4552eeea-1ae8-1e40-3b4b-802dc2f5686a",
"amount": "0.2",
"currency": "EUR",
"settlement_amount": "0.2",
"settlement_currency": "EUR",
"exchange_rate": "1",
"url": "https://pay.yabandpay.com/payments/callback/order/NDU1MmVlZWEtMWFlOC0xZTQwLTNiNGItODAyZGMyZjU2ODZh",
"state": "processing"
},
"message": ""}
1. Desktop or tablet browser
In a desktop or tablet browser, the merchant generates a QR code for the customer to scan and pay.
YabandPay supports native WeChat Pay and Alipay QR codes, as well as unified payment QR codes supporting both WeChat Pay and Alipay.
The merchant can redirect to the URL returned by the YabandPay API to generate a native WeChat Pay or Alipay payment QR code.
For a unified payment QR code, the merchant can encode the URL returned by the YabandPay API as a QR code and display it to the customer, then poll Bestellabfrage for the payment result or wait for an asynchronous notification.
2. Unified payments
YabandPay launches the appropriate WeChat Pay or Alipay payment flow according to the browser environment and use case (PC, H5, App, etc.).
sub_pay_method=
| Browser type | WeChat Pay | Alipay | YabandPay |
|---|---|---|---|
| Mobile browser | Generate a WeChat Pay QR code (launch WeChat Pay if H5 is enabled) | Launch Alipay | Generate a unified QR code |
| Webview in a mobile App | Generate a WeChat Pay QR code | Launch Alipay | Generate a unified QR code |
| WeChat browser (inside the WeChat App) | Launch WeChat Pay | Generate an Alipay QR code | Launch WeChat Pay |
| Alipay browser (inside the Alipay App) | Generate a WeChat Pay QR code | Launch Alipay | Launch Alipay |
| All desktop browsers | Generate a WeChat Pay QR code | Generate an Alipay QR code | Generate a unified QR code |
Zusätzliche Informationen:
Eintwortergebnis:
-
Eine erfolgreiche Einfrage gibt "status": true.
-
Eine fehlgeschlagene Einfrage gibt "status": false.
Wir empfehlen dringend, sowohl Bestellabfrage and Asynchrone Benachrichtigungen zu verwenden, damit die Zahlungsstatus korrekt und aktuell bleiben.
Eintwortcodes:
| Status | Code | Message |
|---|---|---|
| true | 200 | Success |
| false | -1000 | Internal error |
| false | -3001 | Required field is missing |
| false | -403 | The signature Error |
| false | -4011 | Not support the payment method |
