我们使用 Recurly.js。现在 PayPal Payments pro 可用于 Recurly Hosted Payment Pages 和 Recurly.js。我根据给定的文档Recurly.js和Paypal 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>