我使用Paypal REST (java)执行定期订阅。
流程看起来是这样的,它正在工作:
我发现,作为一个买家,我可以登录贝宝和手动取消协议任何时候。
问题是:
作为卖方,我可以看到买方x取消了他在'profile >定期付款仪表板‘中的协议,但是我如何用代码查询这些信息呢?假设我有协议Id。在“协议”对象内没有提供此类信息。
请给我指出正确的方向。谢谢
更新:
我的协议对象如下所示:
{
"id": "I-HLK83FVHB5X2",
"description": "item name goes here",
"start_date": "2014-12-04T05:00:00Z",
"plan": {
"payment_definitions": [
{
"type": "TRIAL",
"frequency_interval": "3",
"frequency": "Month",
"cycles": "1",
"amount": {
"currency": "CAD",
"value": "900.00"
},
"charge_models": [
{
"type": "TAX",
"amount": {
"currency": "CAD",
"value": "11.11"
}
},
{
"type": "SHIPPING",
"amount": {
"currency": "CAD",
"value": "0.00"
}
}
]
},
{
"type": "REGULAR",
"frequency_interval": "1",
"frequency": "Month",
"cycles": "0",
"amount": {
"currency": "CAD",
"value": "300.00"
},
"charge_models": [
{
"type": "TAX",
"amount": {
"currency": "CAD",
"value": "22.22"
}
},
{
"type": "SHIPPING",
"amount": {
"currency": "CAD",
"value": "0.00"
}
}
]
}
],
"merchant_preferences": {
"setup_fee": {
"currency": "CAD",
"value": "0.00"
},
"max_fail_attempts": "0",
"auto_bill_amount": "YES"
}
},
"links": [
{
"href": "https://api.sandbox.paypal.com/v1/payments/billing-agreements/I-HLK83FVHB5X2/suspend",
"rel": "suspend",
"method": "POST"
},
{
"href": "https://api.sandbox.paypal.com/v1/payments/billing-agreements/I-HLK83FVHB5X2/re-activate",
"rel": "re_activate",
"method": "POST"
},
{
"href": "https://api.sandbox.paypal.com/v1/payments/billing-agreements/I-HLK83FVHB5X2/cancel",
"rel": "cancel",
"method": "POST"
},
{
"href": "https://api.sandbox.paypal.com/v1/payments/billing-agreements/I-HLK83FVHB5X2/bill-balance",
"rel": "self",
"method": "POST"
},
{
"href": "https://api.sandbox.paypal.com/v1/payments/billing-agreements/I-HLK83FVHB5X2/set-balance",
"rel": "self",
"method": "POST"
}
]
}发布于 2014-12-04 00:15:36
您有两个选项1:设置接收Paypal (即时支付通知),以便他们将通知你,如果协议被取消。
他说:你可以像https://developer.paypal.com/docs/api/#retrieve-an-agreement中提到的那样检索协议细节,它会给你这样的回应
{
"id": "I-0LN988D3JACS",
"state": "Pending",
"description": "New Description",
"plan": {
"payment_definitions": [
{
"type": "REGULAR",
"frequency": "Month",
"amount": {
"currency": "USD",
"value": "100.00"
},
"charge_models": [
{
"type": "TAX",
"amount": {
"currency": "USD",
"value": "12.00"
}
},
{
"type": "SHIPPING",
"amount": {
"currency": "USD",
"value": "10.00"
}
}
],
"cycles": "12",
"frequency_interval": "2"
}
],
"merchant_preferences": {
"setup_fee": {
"currency": "USD",
"value": "0.00"
},
"max_fail_attempts": "0",
"auto_bill_amount": "YES"
}
},
"links": [
{
"href": "https://api.sandbox.paypal.com/v1/payments/billing-agreements/I-0LN988D3JACS/suspend",
"rel": "suspend",
"method": "POST"
},
{
"href": "https://api.sandbox.paypal.com/v1/payments/billing-agreements/I-0LN988D3JACS/re-activate",
"rel": "re_activate",
"method": "POST"
},
{
"href": "https://api.sandbox.paypal.com/v1/payments/billing-agreements/I-0LN988D3JACS/cancel",
"rel": "cancel",
"method": "POST"
},
{
"href": "https://api.sandbox.paypal.com/v1/payments/billing-agreements/I-0LN988D3JACS/bill-balance",
"rel": "self",
"method": "POST"
},
{
"href": "https://api.sandbox.paypal.com/v1/payments/billing-agreements/I-0LN988D3JACS/set-balance",
"rel": "self",
"method": "POST"
}
],
"start_date": "2015-02-19T08:00:00Z",
"agreement_details": {
"outstanding_balance": {
"currency": "USD",
"value": "0.00"
},
"cycles_remaining": "12",
"cycles_completed": "0",
"final_payment_date": "2016-12-19T10:00:00Z",
"failed_payment_count": "0"
}
}https://stackoverflow.com/questions/27281017
复制相似问题