我正在集成使用plaid + stripe api来获取付款,但是在获取帐户id和public_token之后,我无法从plaid中获取stripe_bank_account_token来调用curl请求
我正在使用php,这里是请求
curl https://tartan.plaid.com/exchange_token \
-d client_id="[Plaid client ID]" \
-d secret="[Plaid secret]" \
-d public_token="[Plaid Link public_token]" \
-d account_id="[Plaid Link account_id]"响应为{“沙盒”:true,"access_token":"test_chase“}
我拿不到
{
"sandbox": true,
"access_token": "[Plaid API access token]",
"stripe_bank_account_token": "btok_5gr1QIfvhgEKdYSr17rH",
"account_id": "[Plaid Account ID]"
}此响应
发布于 2016-09-20 11:54:52
您需要确保传递的客户端ID和Secret不是沙箱凭据,而是您的实际客户端ID和secret,因为它们连接到您的条纹帐户。
发布于 2017-11-28 16:30:11
我也有同样的问题,我使用this解决了它,根据前端请求中缺少的selectAccount链接,它应该是这样的:
<script>
var linkHandler = Plaid.create({
env: 'sandbox',
selectAccount: true, /* this is what i have added */
clientName: 'Stripe/Plaid Test',
key: '[Plaid 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();
};
</script>在响应中,它们返回一个account_id,该work将在最后一个请求中使用,该请求不适用于您。
我希望这能有所帮助。
https://stackoverflow.com/questions/39528628
复制相似问题