为 Plaid 使用 Python 客户端库时出现问题

Problem using Python client library for Plaid

我正在关注 tutorial,但是当我使用 item_public_token_exchange 时出现错误。

itempublic_tokenexchange

exchange_request = ItemPublicTokenExchangeRequest(
    public_token=plaid_token
)
exchange_response = CLIENT.item_public_token_exchange(exchange_request)

错误:

urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='sandbox', port=80): Max retries exceeded with url: /item/public_token/exchange (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x10f1493a0>: Failed to establish a new connection: [Errno 8] nodename nor servname provided, or not known'))

不确定发生了什么。

问题似乎出在您尝试连接到 sandbox 而不是 sandbox.plaid.com。确保将主机设置为 plaid.Environment.Sandbox(或者 sandbox.plaid.com),而不仅仅是 sandbox.