我在 django 中使用条纹,但我是格子的新手。现在我想将格子与我的 django 应用程序连接起来,而不是用格子 + 条纹支付。
我参考了以下文档,但我不明白如何使用文档链接: 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>