我在开发中的应用程序中启用了 INVOICING.INVOICE.PAID webhook。尝试在沙盒环境中支付发票后(使用买方测试用户),Webhook 通知已成功传递,但该消息不包含实际发票数据。
正如您在下面的 JSON 中所见,resource.invoice 属性为空。
如何获取实际数据并找到已付款发票的 ID?
我收到的 webhook 通知:
{
"id": "WH-6L999276D66321518-9G54023288302824Y",
"create_time": "2017-01-18T22:58:08Z",
"resource_type": "invoices",
"event_type": "INVOICING.INVOICE.PAID",
"summary": "An invoice has been paid",
"resource": {
"invoice": null
},
"status": "PENDING",
"transmissions": [
{
"webhook_url": "https://6fbe15c2.ngrok.io/scc/webhooks",
"response_headers": {
"Content-Length": "34",
"SERVER_INFO": "",
"Content-Type": "text/plain",
"HTTP/1.1 404 Not Found": ""
},
"transmission_id": "945c0220-ddd1-11e6-bc94-77339302725b",
"status": "PENDING",
"timestamp": "2017-01-18T22:58:08Z"
}
],
"links": [
{
"href": "https://api.sandbox.paypal.com/v1/notifications/webhooks-events/WH-6L999276D66321518-9G54023288302824Y",
"rel": "self",
"method": "GET",
"encType": "application/json"
},
{
"href": "https://api.sandbox.paypal.com/v1/notifications/webhooks-events/WH-6L999276D66321518-9G54023288302824Y/resend",
"rel": "resend",
"method": "POST",
"encType": "application/json"
}
],
"event_version": "1.0"
}