事件 WebHook
设置 WebHook,以便从 Access Worldpay 接收状态更新。
什么是 WebHook?
Access Worldpay WebHook 可为您提供关于请求状态的实时信息。设置 WebHook 意味着当您的请求发生状态变化时,您就会自动收到更新。
加入 Worldpay
请联系您的实施经理,添加 WebHook URL 并根据您的要求启用或禁用
注释:WebHook 目的地 (URL) 必须使用加密连接 (https
),并且必须具有由可信的证书颁发机构签名的证书。
接收 WebHook
网络访问
WebHook 来源于以下 IP 地址集和 HTTPS 端口;443。确保您的 Web 应用防火墙 (WAF) 允许接收以下地址的 WebHook。完整 IP 集必须列入每个环境的白名单中。
34.246.73.11
52.215.22.123
52.31.61.0
18.130.125.132
35.176.91.145
52.56.235.128
18.185.7.67
18.185.134.117
18.185.158.215
34.246.73.11 52.215.22.123 52.31.61.0 18.130.125.132 35.176.91.145 52.56.235.128 18.185.7.67 18.185.134.117 18.185.158.215
验证
我们强烈建议您执行以下校验之一,以确保收到的 WebHook 来自 Worldpay 并且未被篡改。
活动确认
使用 HTTP(S) 响应代码 200
进行响应,以确认您收到了该事件。
警告:不发送确认可造成队列中后续事件的延迟(或丢失)。
- 如果在 10 秒内没有收到
200
事件确认响应,则我们会重试该事件,直到收到确认为止。 - 重试间隔会随尝试次数而延长,时间间隔会从每个事件 15 分钟延长到 2 小时。
- 重试机制在出现以下情况之一后停止重新发送每个事件;收到确认 (
200
),或在尝试发送该事件一周之后。
支持的事件
支付事件
我们已(您客户的发卡机构)请求处理您的客户支付的许可。
{
"eventId": "bb55ca5a-e05c-47e1-8e94-e88bac1a0a17",
"eventTimestamp": "2018-06-13T14:18:13.407",
"eventDetails": {
"classification": "payment",
"transactionReference": "AuthOrder001",
"type": "sentForAuthorization",
"date": "2017-11-03",
"amount": {
"value": 100,
"currencyCode": "EUR"
},
"_links":{
"payment":{
"href":""
}
}
}
}
支付已批准,并在您的客户的账户中预留了资金。
{
"eventId": "bb55ca5a-e05c-47e1-8e94-e88bac1a0a17",
"eventTimestamp": "2018-06-13T14:18:13.407",
"eventDetails": {
"classification": "payment",
"transactionReference": "AuthOrder001",
"type": "authorized",
"date": "2017-11-03",
"amount": {
"value": 100,
"currencyCode": "EUR"
},
"_links":{
"payment":{
"href":""
}
}
}
}
您或 Access Worldpay 请求移除客户账户中的储备金,并将其转入您的 Worldpay 账户。
{
"eventId": "bb55ca5a-e05c-47e1-8e94-e88bac1a0a17",
"eventTimestamp": "2018-06-13T14:18:13.407",
"eventDetails": {
"classification": "payment",
"transactionReference": "AuthOrder001",
"type": "sentForSettlement",
"date": "2017-11-03",
"reference": null,
"amount": {
"value": 100,
"currencyCode": "EUR"
},
"_links":{
"payment":{
"href":""
}
}
}
}
您在发送交易进行结算之前停止了该交易。
{
"eventId": "bb55ca5a-e05c-47e1-8e94-e88bac1a0a17",
"eventTimestamp": "2018-06-13T14:18:13.407",
"eventDetails": {
"classification": "payment",
"transactionReference": "AuthOrder001",
"type": "cancelled",
"date": "2017-11-03",
"amount": {
"value": 100,
"currencyCode": "EUR"
},
"_links":{
"payment":{
"href":""
}
}
}
}
支付未完成。您的客户可能想重新尝试支付。
{
"eventId": "bb55ca5a-e05c-47e1-8e94-e88bac1a0a17",
"eventTimestamp": "2018-06-13T14:18:13.407",
"eventDetails": {
"classification": "payment",
"transactionReference": "AuthOrder001",
"type": "error",
"date": "2017-11-03",
"_links":{
"payment":{
"href":""
}
}
}
}
该授权周期在做出结算或取消请求之前已结束。
{
"eventId": "bb55ca5a-e05c-47e1-8e94-e88bac1a0a17",
"eventTimestamp": "2018-06-13T14:18:13.407",
"eventDetails": {
"classification": "payment",
"transactionReference": "AuthOrder001",
"type": "expired",
"date": "2017-11-03",
"amount": {
"value": 100,
"currencyCode": "EUR"
},
"_links":{
"payment":{
"href":""
}
}
}
}
您的支付请求已被第三方拒绝。
{
"eventId": "bb55ca5a-e05c-47e1-8e94-e88bac1a0a17",
"eventTimestamp": "2018-01-01T10:30:06.123",
"eventDetails": {
"classification": "payment",
"transactionReference": "AuthOrder001",
"type": "refused",
"date": "2017-11-13",
"octReference": "123456",
"_links":{
"payment":{
"href":""
}
}
}
}
您已请求将资金退回至客户的账户。
如果需要在线授权,这还将包含 refund.onlineRefundAuthorization
。请参见
注释:通过
{
"eventId": "bb55ca5a-e05c-47e1-8e94-e88bac1a0a17",
"eventTimestamp": "2020-10-29T14:40:05.171",
"eventDetails": {
"classification": "payment",
"transactionReference": "AuthOrder001",
"type": "sentForRefund",
"date": "2020-10-29",
"reference": null,
"refund": {
"onlineRefundAuthorization": "987654"
},
"octReference": "123456",
"amount": {
"value": 100,
"currencyCode": "EUR"
},
"_links": {
"payment": {
"href": ""
}
}
}
}
无法处理退款,款项已退回您的账户。
如果需要在线授权,这还将包含 refund.refusal.code
和 refund.refusal.description
。请参见
{
"eventId": "bb55ca5a-e05c-47e1-8e94-e88bac1a0a17",
"eventTimestamp": "2020-10-29T11:06:07.636",
"eventDetails": {
"classification": "payment",
"transactionReference": "AuthOrder001",
"type": "refundFailed",
"date": "2020-10-29",
"reference": null,
// We only return `reference` in the production environment.
"refund": {
"refusal": {
"code": "5",
"description": "Do not honor"
}
},
"amount": {
"value": 100,
"currencyCode": "EUR"
},
"_links": {
"payment": {
"href": ""
}
}
}
}
支出事件
- 对于
基本付款 支出,则使用sentForRefund
支付事件。 - 支付
error
事件会被同时分享给支付和支出相关的事件。
以下事件会被提供给
您的 Fast Access 付款请求已被支付。
{
"eventId": "bb55ca5a-e05c-47e1-8e94-e88bac1a0a17",
"eventTimestamp": "2018-06-13T14:18:13.407",
"eventDetails": {
"classification": "payout",
"transactionReference": "AuthOrder001",
"type": "disbursed",
"date": "2017-11-03",
"amount": {
"value": 100,
"currencyCode": "EUR"
}
}
}
您的 Fast Access 付款请求已被发送至 Visa Direct,响应待处理。尚未完成的请求通常会在 45 分钟内更新为已批准或已拒绝。
如果在 48 小时内未收到响应,则会返回错误。
{
"eventId": "bb55ca5a-e05c-47e1-8e94-e88bac1a0a17",
"eventTimestamp": "2018-06-13T14:18:13.407",
"eventDetails": {
"classification": "payout",
"transactionReference": "AuthOrder001",
"type": "pending",
"date": "2017-11-03",
"amount": {
"value": 100,
"currencyCode": "EUR"
}
}
}
您的 Fast Access 付款请求被拒绝。
{
"eventId": "bb55ca5a-e05c-47e1-8e94-e88bac1a0a17",
"eventTimestamp": "2018-06-13T14:18:13.407",
"eventDetails": {
"classification": "payout",
"transactionReference": "AuthOrder001",
"type": "refused",
"date": "2017-11-03",
"amount": {
"value": 100,
"currencyCode": "EUR"
}
}
}
Access Payouts 收到了您的 Fast Access 付款请求。
{
"eventId": "bb55ca5a-e05c-47e1-8e94-e88bac1a0a17",
"eventTimestamp": "2018-06-13T14:18:13.407",
"eventDetails": {
"classification": "payout",
"transactionReference": "AuthOrder001",
"type": "requested",
"date": "2017-11-03",
"amount": {
"value": 100,
"currencyCode": "EUR"
}
}
}
Visa Direct 已批准了您的 Fast Access 付款请求。
如果您客户的发卡机构启用了 Fast Access,他们应会在 30 分钟内收到资金;如未启用,则会在 3-5 个工作日内收到资金。
{
"eventId": "bb55ca5a-e05c-47e1-8e94-e88bac1a0a17",
"eventTimestamp": "2018-06-13T14:18:13.407",
"eventDetails": {
"classification": "payout",
"transactionReference": "AuthOrder001",
"type": "approved",
"date": "2017-11-03",
"amount": {
"value": 100,
"currencyCode": "EUR"
}
}
}
WebHook 值
键值 | 描述 |
---|---|
eventId | 该事件的独特识别码。 |
eventTimestamp | 事件日期。 |
eventDetails | 包含事件信息的对象。 |
classification | 事件类别,这可以是 |
transactionReference | 您在支付中提供的交易参考号。 |
type | 事件状态。例如,cancelled 或 sentForAuthorization 。 |
date | 您首次提交支付的日期。 |
reference | 您为部分结算或部分退款提供的独特参考号。 |
refund.onlineRefundAuthorization | 发卡机构为在线退款提供的授权代码。 注释:作为 Visa 和 Mastercard 指令的一部分返回的附加信息,用于确保所有购物退货都提交在线授权。截至 2022 年 4 月,将逐步推广至所有地区。 |
refund.refusal.code | 在线退款授权拒绝代码。 |
refund.refusal.description | 在线退款授权拒绝描述。 |
octReference | 用于对账和报告的单一消息 OCT 的 VISA 交易标识号。可在 sentForRefund 或 refused 支付事件中返回。注释:自 2021 年 4 月中旬起推出 |
amount | 包含值和 currencyCode 的对象。 |
value | 授权、部分退款或全部或部分结算金额。这是包含 2 个小数位的整数,e.g. 250 应为 2.50. |
currencyCode | |
_links | 当前未使用 |