0

我们使用 Recurly.js。现在 PayPal Payments pro 可用于 Recurly Hosted Payment Pages 和 Recurly.js。我根据给定的文档Recurly.jsPaypal Payment Pro集成了 Paypal

现在面临错误 >>> 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>
4

1 回答 1

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

于 2015-08-06T08:07:48.977 回答