PayPal沙盒订阅“很抱歉,我们无法使用您选择的付款方式来设置您的订阅”

问题描述

使用正常的PayPal购买/付款产品测试沙盒,它可以与我生成的测试信用卡一起很好地工作。但是当我尝试测试订阅时,就会出现此错误

“很抱歉,我们无法使用您选择的付款方式来设置您的订阅。请尝试其他方式。”

<div id="paypal-button-container"></div>
<script src="https://www.paypal.com/sdk/js?client-id=xxxxxxxxxxxxxxxxxxx&vault=true" data-sdk-integration-source="button-factory"></script>
<script>
  paypal.Buttons({
      style: {
          shape: 'rect',color: 'blue',layout: 'vertical',label: 'subscribe',},createSubscription: function(data,actions) {
        return actions.subscription.create({
          'plan_id': 'P-xxxxxxxxxxx'
        });
      },onApprove: function(data,actions) {
        alert(data.subscriptionID);
      }
  }).render('#paypal-button-container');
</script>

enter image description here

解决方法

我认为在创建计划时它与setup_fee有关。当我将其设置为null时,我将得到与您相同的错误。但是当我给它一些价值时,它就会起作用。

如果这对您有用,请告诉我。