api-error:在接受PayPal付款之前,请在Recurly中使用参考交易配置PayPal帐户

时间:2015-08-06 08:00:40

标签: php recurly

我们使用Recurly.js。现在,PayPal支付专业版可用于Recurly Hosted Payment Pages和Recurly.js.I根据给定的文档Recurly.jsPaypal Payment Pro整合Paypal {/ p>

现在面临错误>>> api-error:在接受PayPal付款之前,请在Recurly中使用参考交易配置PayPal帐户。

我将paypal payment pro整合到我的重复账户中,其状态为(绿色信号)。

但是运行时我得到了这些错误。 我该怎么办?

重复示例代码

<script>
      // Configure recurly.js
      recurly.configure({ publicKey: '***************', api: 'https://api.recurly.com/js/v1' });


      // On form submit, we stop submission to go get the token
      $('form').on('submit', function (event) {
        event.preventDefault();

        // Reset the errors display
        $('#errors').text('');
        $('input').removeClass('error');

        // Disable the submit button
        $('button').prop('disabled', true);

        var form = this;

        // Now we call recurly.paypal with an object containing a 'description' property. 
        // This will open a new window, beginning the PayPal billing agreement flow. 
        // to tokenize the credit card information, then injects the token into the
        // data-recurly="token" field above
        recurly.paypal({ description: 'test' }, function (err, token) {
          if (err) {
            // Let's handle any errors using the function below
            alert(err);
          } else {
            // set the hidden field above to the token we get back from Recurly
            $('#recurly-token').val(token.id);

            // Now we submit the form!
            form.submit();
          }
        });
      });

      // A simple error handling function to expose errors to the customer
      function error (err) {
        console && console.error(err);
        $('#errors').text('There was a problem intializing the PayPal transaction! Please try again in a few moments.');
        $('button').prop('disabled', false);
      }
    </script>

1 个答案:

答案 0 :(得分:0)

您是否已通过正在使用的页面recurly.configure内的recurly文件?

务必在页面的任何位置拨打recurly.configure。一个例子是:

recurly.configure('sc-ABCDEFGHI123456789');

正如文件所述:

not-configured  This error appears when you try to perform an operation without first calling recurly.configure.

来源:

https://docs.recurly.com/js/#errors