scg*_*ugh 24 c# rest json paypal paypal-rest-sdk
我一直在使用PayPal Rest API并成功创建并激活了一个,BillingPlan
但我无法更新所述计划return_url
.我认为这与我正在使用的JSON路径有关,虽然我不确定为什么!?
无论如何,我正在调用更新计划方法:https://developer.paypal.com/docs/api/#update-a-plan
A BillingPlan
遵循以下格式:
{
"id": "P-94458432VR012762KRWBZEUA",
"state": "ACTIVE",
"name": "T-Shirt of the Month Club Plan",
"description": "Template creation.",
"type": "FIXED",
...
"merchant_preferences": {
"setup_fee": {
"currency": "USD",
"value": "1"
},
"max_fail_attempts": "0",
"return_url": "http://example.com",
"cancel_url": "http://example.com",
"auto_bill_amount": "YES",
"initial_fail_amount_action": "CONTINUE"
},
...
}
Run Code Online (Sandbox Code Playgroud)
我正在使用C#SDK,但我的请求JSON看起来非常像:
{
"path": "merchant_preferences",
"value": {
"return_url": "http://example.com/payment/return"
},
"op": "replace"
}
Run Code Online (Sandbox Code Playgroud)
我一直得到以下方面的回应:
{"name":"BUSINESS_VALIDATION_ERROR","details":[{"field":"validation_error","issue":"提供的路径无效."}],"message":"验证错误.","information_link": " https://developer.paypal.com/webapps/developer/docs/api/#BUSINESS_VALIDATION_ERROR","debug_id":"2ae68f9f0aa72 "}
总结一下 - 我想将结算方案return_url
从更改http://example.com
为http://example.com/payment/return
.
我已经改变了path
各种各样的事情无济于事.谁能帮忙?
Jay*_*Pal 11
一旦设置为活动,您就无法更新计划.这种限制的原因是因为可能存在基于该计划的协议,修改它会影响已经商定的计费协议.
但是,我同意您的问题陈述,更改返回URL不应该是一个问题,因为这不是协议的一部分,而是更多的配置更改.如果允许更新计划中的类似设置,即使在激活之后,也会很高兴.我会让API团队了解这一点.
然而,与此同时,你无法做到这一点.或者,您可以创建一个新计划,然后使用它.不是您正在寻找的答案,而是一个可能的解决方案.