Hosted Payment Page
适用于:信用卡的预授权和直接购买
YabandPay的托管支付页面 (HPP) 是一个现成的支付页面,由 YabandPay 全面维护。它使商家能够通过在 YabandPay 系统上托管敏感的 PCI 数据来安全地接受付款。该表单可以作为 iframe 或重定向页面嵌入到商家的结帐流程中。
[!TIP|style:flat]
预授权有效期有30天,超过30天预授权订单将自动过期。
API URL:https://mapi.yabandpay.com/Payments
Method:POST
POST data type:Json
参数 | 类型 | 描述 | 是否必填 |
---|---|---|---|
user | String | 收银员账号的UID | 必填 |
sign | String | 签名 | 必填 |
method | String | v3.CreateCardPayments | 必填 |
time | Long | 时间戳 | 必填 |
- 参数
Parameter | Type | Description | 是否必填 |
---|---|---|---|
pay_method | String | online | 必填 |
sub_pay_method | String | Cards HPP | 必填 |
operation | String | 1.Sales 2.Authorisation; | 必填 |
order_id | String | 商户的订单ID | 必填 |
3ds_initiate | String | 3ds设置。 01. 开启3ds验证; 02. 不开启3ds验证 | 必填 |
amount | String | 金额数字。例如 € 24.99 应该写成24.99 | 必填 |
currency | String | 货币代码,ISO 4217,例如EUR,CHF | 必填 |
description | String | 订单描述 | 必填 |
form_type | String | 返回的url类型,默认01。 01.completed, 02.iframe | 选填 |
demo | String | 自定义字段 | 选填 |
timeout | String | 过期时间0-1440 分钟,如不设置默认1440分钟 | 必填 |
redirect_url | String | 支付完成后跳转地址 | 选填 |
notify_url | String | 支付完成后异步通知地址 | 必填 |
request_id | String | 请求id需保持唯一,建议24以上位数字+字母 | 必填 |
签名示例:
拼接为URL方式并排序后的字符串
"3ds_initiate=01&amount=1¤cy=EUR&description=test&form_type=01&method=v3.CreateCardPayments¬ify_url=https://www.yabandpay.com/notify&operation=1&order_id=203040950640690239603690&pay_method=online&redirect_url=https://www.yabandpay.com/redirect_url&request_id=x7f6dketj52aq5809w5t0rjhp56vmwnz&sub_pay_method=Cards HPP&time=1720683857&timeout=0&user=016683"
得到的 stringA 使用 secret_key做签名
得到的签名如下:
"a5491dcc4b3e0a5edce808074486ffff2fea479054a2f56d8e2a76a4f9808d5f"
提交示例:
{
"user": "016683",
"sign": "a5491dcc4b3e0a5edce808074486ffff2fea479054a2f56d8e2a76a4f9808d5f",
"method": "v3.CreateCardPayments",
"time": 1720680417,
"data": {
"description": "test",
"form_type": "01",
"3ds_initiate": "01",
"timeout": "0",
"pay_method": "online",
"sub_pay_method": "Cards HPP",
"operation": "1",
"order_id": "203040950640690239603690",
"amount": "1",
"currency": "EUR",
"redirect_url": "https://www.yabandpay.com/redirect_url",
"notify_url": "https://www.yabandpay.com/notify",
"request_id": "tscqf7ki76o7aem4z1yl1xs72f89fptl"
}
}
返回示例:
{
"status": true,
"code": "200",
"data": {
"order_id": "203040950640690239603690",
"trade_id": "160899f3-f6d9-a8d8-ab5b-82eacdab9c5b",
"amount": "1.00",
"currency": "EUR",
"url": "https://pay.yabandpay.com/payments/callback/order/MTYwODk5ZjMtZjZkOS1hOGQ4LWFiNWItODJlYWNkYWI5YzVi",
"state": "processing"
},
"message": "",
"response_id": "202407111544200649155078"
}
更多信息:
返回结果:
若调用成功,则返回
"status": true
若调用失败,则返回
"status": fales
你需要跳转返回的url
。用户在此url
输入卡号信息并完成支付后,会同步跳转回redirect_url
。我们强烈建议同时使用订单查询和异步通知来同步和更新支付状态,以确保支付信息的实时准确性。 a) 如果订单状态state
为paid
,即支付成功; b) 如果订单状态state
为authorized
,即预授权成功。 预授权成功后如需要请款调用预授权请款接口。
返回代码:
Status | Code | Message |
---|---|---|
true | 200 | |
fales | -1000 | Internal error |
fales | -403 | The signature Error |
fales | -2001 | The user not exist |
fales | -3001 | Required field is missing |
fales | -4118 | Incorrect request ID |