【发布时间】:2018-03-25 04:02:30
【问题描述】:
在 Stripe 网站上关注 Plaid integration tutorial 后,我无法让格子链接正常工作。
我尝试用环境键替换“env”和“key”变量,如下所示:
<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: ENV['PLAID_ENV'],
clientName: 'Divco',
key: ENV['PLAID_PUBLIC_KEY'],
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();
};
当我放弃“花哨”的环境变量,直接插入我的密钥时,我没有问题。我觉得我打错了一些东西……但为了我的生活,我找不到它。
【问题讨论】:
标签: ruby-on-rails ruby stripe-payments plaid