我正在搜索Recurlyjs正常Paypal签出流的实现示例。除了Paypal令牌之外,我还应该请求用户提供计费信息,但不清楚如何将它们合并使用。
下面是提到正常工作流的文档,但没有详细信息:https://docs.recurly.com/docs/paypal-payments
以下是贝宝快速流的示例:https://github.com/recurly/recurly-js-examples/blob/master/public/paypal/index.html。看起来我需要向表单和merge_token_fields添加额外的字段,但是找不到合适的函数。
<section>
<form method="post" action="/api/subscriptions/new">
<button id="subscribe">Subscribe with PayPal</button>
<div name="recurly-[additional-fields]></div> // TODO: fix this
<input type="hidden" id="recurly-token" name="recurly-token">
</form>
<script>
var form = $('form');
recurly.configure('PUBLIC_KEY');
var paypal = recurly.PayPal({
display: { displayName: 'My product' }
});
paypal.on('token', function (token) {
$('#recurly-token').val(token.id);
merge_token_fields(); // TODO: fix this
form[0].submit();
});
form.on('submit', function (event) {
event.preventDefault();
paypal.start();
});
</script>
</section>发布于 2018-02-20 21:28:32
您想要遵循的步骤: 1)获取Paypal令牌2)从API收集计费地址(可以在recurly.js表单上完成并传递给API) 3),将Paypal账单协议传递给帐户4)随后请求将计费地址传递给帐户作为计费信息更新
https://stackoverflow.com/questions/48555940
复制相似问题