Documentation/Référence API

API REFERENCE

Paiement rapide

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

Paiement rapide

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

Request parameters9

Required fields first

快捷支付

pay_methodRequiredstringdata.pay_methodoffline
amountRequiredstringdata.amount金额数字。例如 € 24.99 应该写成24.99,CNY金额>=1,欧元金额>=0.1
currencyRequiredstringdata.currency货币代码,ISO 4217,例如EUR,CHF
auth_codeRequiredstringdata.auth_code微信支付或者支付宝+钱包的授权码
descriptionRequiredstringdata.description订单描述
Optional parameters 4
sub_pay_methodOptionalstringdata.sub_pay_methodWeChat Pay,Alipay,UnionPay QRcode,通过接口获取sub pay method 获取。如果为空(推荐),将由YabandPay来做支付方式判断。
tip_amountOptionalstringdata.tip_amount总金额中包含的小费,金额数字。例如 1.02
demoOptionalstringdata.demo自定义字段
notify_urlOptionalstringdata.notify_url支付完成后异步通知地址

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

Paramètres

ParameterTypeDescriptionObligatoire
data.pay_methodstringoffline✓
data.sub_pay_methodstringWeChat Pay,Alipay,UnionPay QRcode,通过接口[获取sub pay method](/yabandpay/docs/v3-cn/payments/simplepay/subpaymethod) 获取。**如果为空(推荐),将由YabandPay来做支付方式判断。**—
data.order_idstring商户订单号✓
data.amountstring金额数字。例如 € 24.99 应该写成24.99,CNY金额>=1,欧元金额>=0.1✓
data.tip_amountstring总金额中包含的小费,金额数字。例如 1.02—
data.currencystring货币代码,ISO 4217,例如EUR,CHF✓
data.demostring自定义字段—
data.auth_codestring微信支付或者支付宝+钱包的授权码✓
data.descriptionstring订单描述✓
data.notify_urlstring支付完成后异步通知地址—

S’applique aux paiements en magasin avec WeChat Pay et Alipay+.

ChampTypeDescriptionObligatoire
userStringCashier account UIDObligatoire
signStringSignatureObligatoire
methodStringv3.BarcodePaymentObligatoire
timeLongTimestampObligatoire
  • Parameters
ChampTypeDescriptionObligatoire
pay_methodStringofflineObligatoire
sub_pay_methodStringWeChat Pay,Alipay,UnionPay QRcode. Obtain it through Obtenir le sous-moyen de paiement. If left empty (recommended), YabandPay identifies the payment method.Facultatif
order_idStringMerchant order IDObligatoire
amountStringAmount as a numeric string. For example, enter 24.99 for € 24.99. CNY amount >=1; EUR amount >=0.1.Obligatoire
tip_amountStringTip included in the total amount, as a numeric string; for example 1.02Facultatif
currencyStringISO 4217 currency code, for example EUR or CHFObligatoire
demoStringCustom fieldFacultatif
auth_codeStringAuthorization code from the WeChat Pay or Alipay+ walletObligatoire
descriptionStringOrder descriptionObligatoire
notify_urlStringAsynchronous notification URL after paymentFacultatif

Signature example:

Sorted parameters concatenated into a URL-style query string

"amount=2.1&auth_code=134443133735495918&currency=EUR&demo=test&description=YabandPay test&method=v3.BarcodePayment&notify_url=https://www.yabandpay.com/notify&order_id=202488465489451317&pay_method=offline&sub_pay_method=WeChat Pay&time=1555499083&tip_amount=0.5&user=YOUR_CASHIER_UID"

Sign stringA using secret_key

Le champ resulting signature is:

"YOUR_SIGNATURE"

Exemple de requête:

{
    "user": "YOUR_CASHIER_UID",
    "sign": "YOUR_SIGNATURE",
    "method": "v3.BarcodePayment",
    "time": 1555499083,
    "data": {
        "amount": "2.1",
        "tip_amount": "0.5",
        "auth_code": "YOUR_AUTH_CODE",
        "currency": "EUR",
        "demo": "test",
        "description": "YabandPay test",
        "notify_url": "https://www.yabandpay.com/notify",
        "order_id": "YOUR_ORDER_ID",
        "pay_method": "offline",
        "sub_pay_method": "WeChat Pay"
    }
}

Exemple de réponse:

{
    "status": true,
    "code": "200",
    "data": {
        "order_id": "YOUR_ORDER_ID",
        "trade_id": "511444d0-2d91-5396-9e34-f2900e80d715",
        "amount": "2.1",
        "tip_amount": "0.5",
		"sub_pay_method": "WeChat Pay",
        "state": "paid"
    },
    "message": ""}

Informations complémentaires:

Résultat de la réponse:

Conseil

  1. If the customer does not need to enter a password, the payment result is returned synchronously.
  1. If the customer needs to enter a password after the code is scanned, the payment result is state: processing. Le champ merchant must poll Query Order every 5 seconds to determine the actual payment result.
  1. If the customer cancels or has not paid within 30 seconds, we recommend exiting the query loop and calling Cancel Payment to reverse the payment transaction. If the customer has already paid, the system automatically issues a refund.
Response codes:
StatusCodeMessage
true200Success
false-1000Internal error
false-1007Identity code is invalid
false-4011Not support the payment method
false-4015This order has been closed
false-4028WeChat Pay is not available
false-4029Alipay is not available
false-4086Unknow identity code