0

我有一些代码如下,在条纹和格子之间交换令牌,但我的代码抛出错误为bad public_token.

我在我的应用程序中使用了来自 nugget 的以下 Package 用于 C#

Install-Package Stripe-Plaid-Link

库参考 https://github.com/asciutto990/Stripe-and-Plaid-Link-.NET

public async Task<ActionResult> PlaidAsync(string account_id, string public_token)
{
    var plaidApi = new PlaidApi();
    try
    {
        var response = await plaidApi.ExchangeTokenAsync(new ExchangeTokenInput
        {
            PublicToken = public_token,
            AccountId = account_id,
        });
        var bankToken = response.StripeBankAccountToken;
        var accountId = response.AccountId;
        var sandbox = response.Sandbox;
        var accessToken = response.AccessToken;
    }
    catch (PlaidException e)
    {
        var errorMessage = e.Message;               
    }
    return View();
}
4

1 回答 1

0

从 Plaid API V2(沙盒)开始,遵循 Plaid Doc 中给出的 6 个步骤:https ://plaid.com/docs/stripe/#step1

对于步骤:3,在调用中添加 api 版本

apiVersion: 'v2',

此事件成功后,调用 plaid APIhttps://sandbox.plaid.com/item/public_token/exchange以获取访问令牌。

之后调用 plaid APIhttps://sandbox.plaid.com/processor/stripe/bank_account_token/create获取银行账户令牌

API 的另一个参考参考 https://documenter.getpostman.com/view/4675947/RWMLHkHR?version=latest#64d97a2b-071b-4826-838c-a8acec7d33ec

于 2019-08-08T10:29:11.263 回答