跳转到主要内容

如何使用Webhook检查支付状态

更新于昨天

摘要

您可以在 WATI 帐户中设置 webhook 以接收各种事件的实时更新,包括 支付状态 通知。这允许您的系统在支付被 捕获失败 时自动响应。

💡提示:要启用此 webhook,请访问 WATI 帐户中的 webhooks 部分。

支付状态 webhook 有效负载

当支付处理时,webhook 将发送以下状态值之一:

  • "captured" – 支付已成功完成

  • "failed" – 支付尝试失败

示例 webhook 有效负载(捕获或失败支付)

{
"statuses": [
{
"from": "contact-phone-number",
"id": "ABMAAQVBAXmFlQ",
"payment": {
"reference_id": "your-reference-id",
"sender": "12137725260"
},
"status": "captured", // or "failed"
"timestamp": "1667283493",
"type": "payment"
}
]
}

消息状态 webhook

当-order-message 成功发送给客户时,您还将收到 webhook 事件。

示例 webhook 有效负载(消息已发送)

{
"statuses": [
{
"conversation": {
"expiration_timestamp": 1667297460,
"id": "3fd5f2da086a01a3d8aaa5be596c3974",
"origin": {
"type": "user_initiated"
}
},
"id": "gBEGkYYGMoJXAgmE6nNS5OrwajQ",
"message": {
"recipient_id": "recipient-phone-number"
},
"pricing": {
"billable": true,
"category": "user_initiated",
"pricing_model": "CBP"
},
"recipient_id": "recipient-phone-number",
"status": "sent",
"timestamp": "1667211460",
"type": "message"
}
]
}
这是否解答了您的问题?