简体   繁体   English

PayPal 智能按钮(订阅)使用 paypal.FUNDING.CARD 按钮 update_client_config_error

[英]PayPal Smart Buttons (Subscription) using paypal.FUNDING.CARD button update_client_config_error

I'm implementing the Paypal Smart buttons to my website for subscription, with the following code:我正在为我的网站实现 Paypal 智能按钮进行订阅,代码如下:

paypal.Buttons({
    commit: false,
       createSubscription: function(data, actions) {
         return actions.subscription.create({
           plan_id: 'P-4688500211745173CL4LO52Y'
         });
       },
       onCancel: function (data) {
       },
       onApprove: function(data, actions) {
       }
  }).render('#paypal-button-container');

I subscribed via Debit Or Credit Card (paypal.FUNDING.CARD button).我通过借记卡或信用卡订阅(paypal.FUNDING.CARD 按钮)。 It returns the JSON data for subscription:它返回 JSON 数据以供订阅:

{
  billingToken: "BA-28952229JX1690450"
  facilitatorAccessToken: "A21AAF2g9HmhCrpdlvKv82KzTOL7s- 
  h7udVM63Jx6PoEQJvhRHUKZXuxdEewBWbAlh7Tta44GREGBKPqydgSaWBdTZBInLTMA"
  orderID: "91D07990YA8971453"
  subscriptionID: "I-EN0D6RAEFN8R"
}

But when I need to downgrade or upgrade the current subscription using https://api.sandbox.paypal.com/v1/billing/subscriptions/I-EN0D6RAEFN8R/revise API endpoint base on the PayPal docs. But when I need to downgrade or upgrade the current subscription using https://api.sandbox.paypal.com/v1/billing/subscriptions/I-EN0D6RAEFN8R/revise API endpoint base on the PayPal docs. https://developer.paypal.com/docs/business/subscriptions/add-capabilities/revise-subscriptions/ https://developer.paypal.com/docs/business/subscriptions/add-capabilities/revise-subscriptions/

The PayPal window automatically close and I get the error: "Uncaught Error: Api: /smart/api/billagmt/subscriptions/I-EN0D6RAEFN8R/cartid returned status code: 500 (Corr ID: e0a949aefc835)" The PayPal window automatically close and I get the error: "Uncaught Error: Api: /smart/api/billagmt/subscriptions/I-EN0D6RAEFN8R/cartid returned status code: 500 (Corr ID: e0a949aefc835)"

This is my code to revise subscription:这是我修改订阅的代码:

paypal.Buttons({
    commit: false,
       createSubscription: function(data, actions) {
         return actions.subscription.revise('I-EN0D6RAEFN8R', {
           plan_id: 'P-0P5665289K689682KL4MD5PQ'
         });
       },
       onCancel: function (data) {
       },
       onApprove: function(data, actions) {
       }
  }).render('#paypal-button-container');

Note: Subscribing via PayPal Account (paypal.FUNDING.PAYPAL button) doesn't have the error that I'm encountering when I subscribe via PayPal Credit Or Debit Card.注意:通过 PayPal 帐户(paypal.FUNDING.PAYPAL 按钮)订阅没有我通过 PayPal 信用卡或借记卡订阅时遇到的错误。 I can also upgrade or downgrade the subscription plan using the revise code above.我还可以使用上面的修订代码升级或降级订阅计划。

Anybody experienced the same issue?有人遇到过同样的问题吗?

The behavior makes sense, you need to log into a PayPal account to approve revising a subscription.这种行为是有道理的,您需要登录 PayPal 帐户来批准修改订阅。

When there is nothing to log into, there is no way to approve a revision on the client side.当没有什么可以登录时,无法在客户端批准修订。 Your own authorized server-side API call is necessary to modify/cancel it.您自己的授权服务器端 API 调用是修改/取消它所必需的。 You can have the user sign up again (new profile) and cancel the original one.您可以让用户重新注册(新配置文件)并取消原始配置文件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM