【发布时间】:2023-03-23 16:56:01
【问题描述】:
我一直在使用 PayPal Rest API 并成功创建并激活了 BillingPlan,但我无法更新所述计划的 return_url。我认为这与我正在使用的 JSON 路径有关,虽然我不确定为什么!?
反正我是调用更新计划方法:https://developer.paypal.com/docs/api/#update-a-plan
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"
},
...
}
我正在使用 C# SDK,但我的请求 JSON 应该看起来很像:
{
"path": "merchant_preferences",
"value": {
"return_url": "http://example.com/payment/return"
},
"op": "replace"
}
我不断收到以下回复:
{"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 更改为各种无济于事的东西。谁能帮忙??
【问题讨论】:
-
我不完全确定你的问题是什么,你能说得更具体点吗?
-
尝试在
"path"前加上"/",即"path": "/merchant_preferences"。 -
另外,一旦计划生效,您显然无法更新此内容,请参阅github.com/paypal/PayPal-Python-SDK/issues/73
-
@dbc 尝试了
"/"前缀无济于事,但您认为该计划处于活动状态可能是一个很好的观点。我将在接下来的几天内进行调查。也许我可以停用、更新和重新激活。
标签: c# json rest paypal paypal-rest-sdk