【问题标题】:PayPal Subscription get transaction listPayPal订阅获取交易清单
【发布时间】:2020-03-06 22:18:11
【问题描述】:

我正在建立一个在线商店。 目前我在https://api.sandbox.paypal.com

我创建了订阅并且客户批准了它。 一切都按照文档中的描述进行。这里

https://developer.paypal.com/docs/api/subscriptions/v1/#subscriptions

现在我需要获得此订阅的实际付款,以便将我的门户与贝宝付款同步。

我猜我需要List transactions for subscription,就像这里所说的那样:

https://developer.paypal.com/docs/api/subscriptions/v1/#subscriptions_transactions

但是当我调用这条路径时

/v1/billing/subscriptions/I-T99999999999/transactions?start_time=2014-11-11T05:09:16.000Z&end_time=2020-11-11T05:09:16.000Z

我得到一个空数组作为响应。即使没有交易,我也希望有这样的结构:

{
  "transactions": [],
  "links": [
    {
      "href": "https://api.paypal.com/v1/billing/subscriptions/I-T99999999999/transactions?start_time=2014-11-11T05:09:16.000Z&end_time=2020-11-11T05:09:16.000Z",
      "rel": "self",
      "method": "GET"
    }
  ]
}

但是我得到了没有错误的空响应。

【问题讨论】:

    标签: php paypal-subscriptions


    【解决方案1】:

    我面临同样的问题,但我发现了我认为可以解决的问题。

    我可以通过从计费协议中调用已弃用的方法列出订阅交易。

    v1/payments/billing-agreements/{{0}}/transactions?start_date={{1}}&end_date={{2}}

    文档链接:

    https://developer.paypal.com/docs/api/payments.billing-agreements/v1/#billing-agreements_transactions

    您将收到如下示例响应:

    {
        "agreement_transaction_list": [{
            "transaction_id": "I-WBT8MCXV1XD5",
            "status": "Created",
            "transaction_type": "Recurring Payment",
            "payer_name": "Test Payer",
            "time_stamp": "2019-11-17T01:36:59Z",
            "time_zone": "GMT"
        }, {
            "transaction_id": "2V3487226T084702S",
            "status": "Updated",
            "transaction_type": "Recurring Payment",
            "amount": {
                "currency": "BRL",
                "value": "-24.90"
            },
            "fee_amount": {
                "currency": "BRL",
                "value": "0.00"
            },
            "net_amount": {
                "currency": "BRL",
                "value": "-24.90"
            },
            "payer_email": "test@email.com",
            "payer_name": "John Doe's Test Store",
            "time_stamp": "2019-11-17T01:37:01Z",
            "time_zone": "GMT"
        }]
    }
    

    【讨论】:

    • 很高兴看到其他人正在使用贝宝订阅 API。老实说,我虽然它被遗弃了。
    • 我正在使用 transactions_get (developer.paypal.com/docs/api/sync/v1/#transactions_get),它没有被弃用。
    • 我还在 paypal-support.com 上创建了一个案例,他们已经同意这完全是他们的错。 PayPal 开发人员目前正在解决这个问题。
    猜你喜欢
    • 2017-04-13
    • 2018-01-26
    • 1970-01-01
    • 2020-09-07
    • 2018-03-13
    • 2019-03-02
    • 2014-07-20
    • 2020-02-27
    • 2013-02-13
    相关资源
    最近更新 更多