2017-06-19 90 views
1

贝宝REST API文档说结算协议对象包含信息关于它的结算方案https://developer.paypal.com/docs/api/payments.billing-agreements#agreement(ID,名称,描述,状态等)如何获取特定结算协议的结算计划的编号?

然而,有一个协议的ID,我不能得到的ID与之相关的计划。

我用一个example for PayPal Node.js SDK得到一个协议的细节,并得到这个响应(截断以提高可读性):

{ 
    "id": "I-UR6MTL02G0UE", 
    "state": "Active", 
    "description": "Agreement for Basic (EUR) plan", 
    "payer": { 
    ... 
    }, 
    "plan": { 
    "payment_definitions": [ 
     { 
     "type": "REGULAR", 
     "frequency": "Month", 
     "amount": { 
      "currency": "EUR", 
      "value": "7.99" 
     }, 
     "cycles": "0", 
     "charge_models": [ 
      { 
      "type": "TAX", 
      "amount": { 
       "currency": "EUR", 
       "value": "0.00" 
      } 
      }, 
      { 
      "type": "SHIPPING", 
      "amount": { 
       "currency": "EUR", 
       "value": "0.00" 
      } 
      } 
     ], 
     "frequency_interval": "1" 
     } 
    ], 
    "merchant_preferences": { 
     ... 
    } 
    }, 
    "start_date": "2017-06-19T07:00:00Z", 
    "shipping_address": { 
    ... 
    }, 
    "agreement_details": { 
    ... 
    }, 
    "httpStatusCode": 200 
} 

正如你可以在​​部分我已经得到的信息只能看到它的付款定义,但我需要得到它的ID。那么我怎么能做到这一点?

+0

我看到了休息的API,它确实返回你的ID。检查出来https://developer.paypal.com/docs/integration/direct/billing-plans-and-agreements/ –

+0

谢谢。我已经检查过这个文档。出于某种原因,只有在创建协议时才会返回ID。但是,当我试图在稍后获得协议的细节时,事实并非如此。 – poohitan

回答

1

似乎目前由于PayPal REST API中存在问题,目前看起来不可能(请参阅Github上的问题https://github.com/paypal/PayPal-node-SDK/issues/272)。

不知道它的修复速度有多快。也许他们甚至不打算修复它,因为我发现三年前在他们的Github上创建了类似的问题。

+0

问题已移至此处:https://github.com/paypal/PayPal-REST-API-issues/issues/92 –