发起支付或预授权


适用于线下POS支付场景

该接口用于通过云端向 POS 设备发起支付或预授权指令。

在调用本接口前,请务必确认 POS 设备处于在线且可用状态,以确保指令能够成功下发并被正常处理。

[!TIP|style:flat]

该接口基于云端调用 POS 设备的方案。

如需通过局域网(LAN)方式调用 POS,请联系我们获取对应的 API 接入说明文档。

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

Method:POST

POST data type:Json

参数 类型 描述 是否必填
user String 设备的TID 必填
sign String 签名 必填
method String v3.POS 必填
time Long 时间戳 必填
  • 参数
Parameter Type Description 是否必填
pay_method String offline 必填
sub_pay_method String point_of_sales 必填
operation String 1.Sales 2.Authorisation; 必填
tid string 设备的TID 必填
order_id string 订单号全部数字构成,并小于20个字符 必填
amount String 金额数字。例如 € 24.99 应该写成24.99,CNY金额>=1,欧元金额>=0.1 必填
tip_amount String 总金额中包含的小费,金额数字。例如 1.02 选填
currency String 货币代码,ISO 4217,例如EUR,CHF 必填
description String 订单描述64字符内 必填
demo String 自定义字段 选填
notify_url String 支付完成后异步通知地址 必填
request_id String 请求id需保持唯一,建议24以上位数字+字母 必填

签名示例:

拼接为URL方式并排序后的字符串

 "amount=12.5&currency=EUR&description=YabandPay test&method=v3.POS&notify_url=https://www.yabandpay.com/notify&operation=1&order_id=202586556498441613&pay_method=offline&request_id=a7z1lox4l6z6mdx1udgn5gtezasze1x0&sub_pay_method=POSPayment&tid=T125119061&time=1555498137&tip_amount=0.5&user=T125119061"

得到的 stringA 使用 secret_key做签名

得到的签名如下:

"b5ac6b37ef2fb3efe7fc7138d39b69fe70d1642b408fc925a2bc526c9e8ba0d6"

提交示例:

 {
  "user": "T125119061",
  "sign": "b5ac6b37ef2fb3efe7fc7138d39b69fe70d1642b408fc925a2bc526c9e8ba0d6",
  "method": "v3.POS",
  "time": 1555498137,
  "data": {
    "operation": "1",
    "tid": "T125119061",
    "amount": "12.5",
    "currency": "EUR",
    "tip_amount": "0.5",
    "description": "YabandPay test",
    "notify_url": "https://www.yabandpay.com/notify",
    "order_id": "202586556498441613",
    "pay_method": "offline",
    "sub_pay_method": "point_of_sales",
    "request_id": "a7z1lox4l6z6mdx1udgn5gtezasze1x0"

  }
}

返回示例:

{
  "status": true,
  "code": "200",
  "data": {
    "order_id": "202586556498441613",
    "trade_id": "4552eeea-1ae8-1e40-3b4b-802dc2f56458",
    "amount": "12",
    "currency": "EUR",
    "tip_amount": "0.5",
    "state": "processing"
  },
  "message": "",
}

更多信息:

返回结果:
  1. 若调用成功,则返回"status": true

  2. 若调用失败,则返回"status": false

我们强烈建议同时使用订单查询异步通知来同步和更新支付状态,以确保支付信息的实时准确性。

返回代码:
Status Code Message
true 200 Success
false -1000 Internal error
false -3001 Required field is missing
false -3002 duplicate request_id
false -403 The signature Error
false -4011 Not support the payment method

results matching ""

    No results matching ""