gpt4 book ai didi

c# - PayPal Rest API - 更新计费计划返回 URL

转载 作者:IT老高 更新时间:2023-10-28 12:54:06 26 4
gpt4 key购买 nike

我一直在使用 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":"Invalid Path provided."}],"message":"Validation Error.","information_link":"https://developer.paypal.com/webapps/developer/docs/api/#BUSINESS_VALIDATION_ERROR","debug_id":"2ae68f9f0aa72"}

总结 - 我想将计费计划 return_urlhttp://example.com 更改为 http://example.com/payment/return.

我已将 path 更改为各种无济于事的东西。谁能帮忙??

最佳答案

一旦设置为事件,您将无法更新该计划。该限制的原因是因为可能存在基于该计划的可能协议(protocol),修改它会影响已经商定的计费协议(protocol)。

但是,我同意您的问题陈述,即更改返回 URL 不应该是一个问题,因为这不是协议(protocol)的一部分,而是更多的配置更改。以某种方式允许更新计划中的类似设置会很好,即使在事件之后也是如此。我会让 API 团队知道这一点。

但是,与此同时,您无法做到这一点。或者,您可以创建一个新计划,然后使用它。不是您正在寻找的答案,而是一个可能的解决方案。

关于c# - PayPal Rest API - 更新计费计划返回 URL,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29631597/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com