【发布时间】:2019-11-22 20:36:39
【问题描述】:
我在 django 中使用了 stripe,但我是 plaid 的新手。现在我想将 plaid 与我的 django 应用程序连接起来,而不是用 plaid + stripe 付款。
我参考了下面的文档,但我不明白如何工作 文档链接: https://plaid.com/docs/stripe/ https://stripe.com/docs/ach#using-plaid
我在下面的代码中进行了测试,但接下来我不知道该怎么做
<button id='linkButton'>Open Plaid Link</button>
<script src="https://cdn.plaid.com/link/v2/stable/link-initialize.js"></script>
<script>
var linkHandler = Plaid.create({
env: 'sandbox',
clientName: 'Stripe/Plaid Test',
key: '1bde1c39022bbcecaccde8cc92182d',
product: ['auth'],
selectAccount: true,
onSuccess: function(public_token, metadata) {
// Send the public_token and account ID to your app server.
console.log('public_token: ' + public_token);
console.log('account ID: ' + metadata.account_id);
},
onExit: function(err, metadata) {
// The user exited the Link flow.
if (err != null) {
// The user encountered a Plaid API error prior to exiting.
}
},
});
// Trigger the Link UI
document.getElementById('linkButton').onclick = function() {
linkHandler.open();
};
</script>
【问题讨论】: