【问题标题】:Adding custom parameter to PayPal's smart button向 PayPal 智能按钮添加自定义参数
【发布时间】:2021-02-09 19:10:00
【问题描述】:

我正在使用 Paypal 进行订阅,但是我尝试创建的自定义值没有从 PayPal 的 IPN 接收到。

因此,我一定是做错了什么。据我所知,我正确地传递了值?

这是我的代码,我正在尝试用我自己的值传递custom

  paypal.Buttons({
      style: {
          shape: 'rect',
          color: 'gold',
          layout: 'vertical',
          label: 'subscribe'
      },
      createSubscription: function(data, actions) {
        return actions.subscription.create({
            'plan_id': 'P-000',
            'custom': 'custom value'  // the custom parameter attempt
        });
      },
      onApprove: function(data, actions) {
        alert(data.subscriptionID);
      }
  }).render('#paypal-button-container');

【问题讨论】:

    标签: javascript paypal paypal-ipn paypal-subscriptions


    【解决方案1】:

    参数在此处记录为custom_idhttps://developer.paypal.com/docs/api/subscriptions/v1/#subscriptions-create-request-body

    custom 等未知参数名称将被忽略

    【讨论】:

      猜你喜欢
      • 2021-07-21
      • 2013-05-30
      • 2021-03-23
      • 2014-11-23
      • 2020-10-19
      • 2020-06-28
      • 2021-12-13
      • 2020-03-04
      • 2020-03-23
      相关资源
      最近更新 更多