【问题标题】:What is the name of the post variable what is sending from paypal webhooks?从 paypal webhook 发送的 post 变量的名称是什么?
【发布时间】:2015-11-20 08:30:15
【问题描述】:

Paypal webhooks 向我发送了一个 post 变量,但它的名称是什么? 我什么都找不到。

【问题讨论】:

  • 你检查过文档吗?
  • 是的,我有。但我找不到这个。上面写着,我得到了 json 格式的响应。我会读这篇文章,但是没有变量名我怎么能做到这一点?

标签: paypal webhooks paypal-webhooks


【解决方案1】:

发布的变量取决于触发的事件。要实际查看 PayPal 发送的帖子,请按照以下步骤操作:

1. Go to developer.paypal.com--> Dashboard and login . 
2. In left move to "WebHooks Simulator" and put your url you want to receive the post to after selecting the event type and it will show you the data posted after clicking on submit . 

您将看到如下所示的内容:

【讨论】:

  • 我已经用过了。但是,如果我使用该帖子处理我的 webhook-url,我不会得到任何信息。我会读那个后变量。但是名字是什么? $_POST[....]?我在文档中没有找到任何信息。
【解决方案2】:

发送 webhook 时,它会发送标头以及有效负载。该文档分布在下面的两个链接之间。没有很好解释的是“资源”字段的实际内容。例如,如果 webhook 用于销售事件类型,则资源的内容与从 GET /v1/payments/sale/ 获取信息相同

第一个链接解释了主要的有效载荷。第二个链接解释了标题。 https://developer.paypal.com/docs/api/#retrieve-a-webhook-event https://developer.paypal.com/docs/integration/direct/rest-webhooks-overview/

【讨论】:

    【解决方案3】:
    $bodyReceived = file_get_contents('php://input');
    

    【讨论】:

    • 请编辑您的答案,为您的代码建议提供一些上下文。请在此处查看 StackOverflow 上的 How to Write a Good Answer
    猜你喜欢
    • 2020-06-23
    • 2018-10-02
    • 2011-07-29
    • 1970-01-01
    • 1970-01-01
    • 2022-01-22
    • 1970-01-01
    • 2012-10-16
    • 2019-08-02
    相关资源
    最近更新 更多