PayPal Rest API - 更新计费计划返回 URL [英] PayPal Rest API - Update Billing Plan Return URL

查看:14
本文介绍了PayPal Rest API - 更新计费计划返回 URL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在使用 PayPal Rest API 并成功创建并激活了 BillingPlan,但我在更新所述计划的 return_url 时遇到问题.我认为这与我使用的 JSON 路径有关,尽管我不确定为什么!?

I have been using the PayPal Rest API and have successfully created and activated a BillingPlan but I'm having trouble updating said plan's return_url. I think it's something to do with the JSON path I'm using although I'm not sure why!?

反正我是调用更新计划方法:https://developer.paypal.com/docs/api/#update-a-plan

Anyway, I am calling the update plan method: 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 应该非常像:

I'm using the C# SDK but my request JSON should look very much like:

{
    "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"}

{"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.

To sum up - I want to change the billing plan return_url from http://example.com to http://example.com/payment/return.

我已将 path 更改为各种内容,但无济于事.有人可以帮忙吗??

I've changed the path to various things to no avail. Can anyone help??

推荐答案

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

You cannot update the plan, once it is set to active. The reason for that restriction is that because there could be possible agreements based on that plan, modifying it would affect the already agreed billing agreements.

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

However, I agree with your problem statement, that changing the Return URL should not be an issue as this is not a part of agreement, but more of a configuration change. It would be nice to somehow allow updating similar settings in Plan, even after active. I will let the API team know about that.

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

however, in the mean time, there is no way you would be able to do that. Alternatively, you could possibly create a new plan, and use that instead. Not the answer you are looking for, but a probable solution.

这篇关于PayPal Rest API - 更新计费计划返回 URL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆