【问题标题】:How to get payment Details at PayPal Subscription with php?如何使用 php 在 PayPal 订阅中获取付款详细信息?
【发布时间】:2021-06-06 18:51:09
【问题描述】:

我正在使用 PayPal 和 php 设置订阅。到目前为止,我知道如果事件PAYMENT.SALE.COMPLETED 被称为付款成功。要在我的 webhook 上处理付款,我需要有关付款的更多详细信息(谁付款?什么计划或订阅?)。我怎样才能获得更多详细信息?是关于IDs吗?

这是一个测试事件的事件主体:

{
  "id": "WH-2WR32451HC0233532-67976317FL4543714",
  "create_time": "2014-10-23T17:23:52Z",
  "resource_type": "sale",
  "event_type": "PAYMENT.SALE.COMPLETED",
  "summary": "A successful sale payment was made for $ 0.48 USD",
  "resource": {
    "parent_payment": "PAY-1PA12106FU478450MKRETS4A",
    "update_time": "2014-10-23T17:23:04Z",
    "amount": {
      "total": "0.48",
      "currency": "USD"
    },
    "payment_mode": "ECHECK",
    "create_time": "2014-10-23T17:22:56Z",
    "clearing_time": "2014-10-30T07:00:00Z",
    "protection_eligibility_type": "ITEM_NOT_RECEIVED_ELIGIBLE,UNAUTHORIZED_PAYMENT_ELIGIBLE",
    "protection_eligibility": "ELIGIBLE",
    "links": [
    ...
    ],
    "id": "80021663DE681814L",
    "state": "completed"
  },
  "links": [
...

【问题讨论】:

    标签: events paypal payment subscription


    【解决方案1】:

    一个真实的(非 webhook-test-simulator)事件应该有支付对应的订阅的订阅 ID(I-#### 号)。您应该在订阅创建时将该 ID 存储在您自己的用户配置文件中。

    另一种方法是在订阅创建时传递您自己的custom_id

    您可以在沙盒模式下测试所有这些。

    【讨论】:

      猜你喜欢
      • 2018-04-05
      • 2020-10-16
      • 2021-09-28
      • 2017-02-16
      • 2023-04-06
      • 2015-07-22
      • 2011-12-01
      • 2014-02-23
      • 2018-08-30
      相关资源
      最近更新 更多