mirror of
https://github.com/hanzo-fi/payments.git
synced 2026-10-30 20:31:20 +00:00
* feat(models): add bank bridge models * feat(storage): add bank bridge migrations and functions * feat(engine): add bank bridge workflows * feat(connectors): add plaid bank bridge connector * feat(events): add bank bridge events * feat(api): add bank bridge router * feat(*): bank bridge boilerplate * fix nil pointer crash * add more check when getting link attempts + change enum * fix tests * remove print * fixes after reviews * add specific table for access tokens * fixes after reviews * fix go mod tidy * remove indexes + null default * plaid: add tests * *: add more tests * fix after rebase
22 lines
574 B
Go
22 lines
574 B
Go
package client
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/formancehq/payments/internal/connectors/metrics"
|
|
"github.com/plaid/plaid-go/v34/plaid"
|
|
)
|
|
|
|
func (c *client) ListAccounts(ctx context.Context, accessToken string) (plaid.AccountsGetResponse, error) {
|
|
ctx = context.WithValue(ctx, metrics.MetricOperationContextKey, "list_accounts")
|
|
|
|
request := plaid.NewAccountsGetRequest(accessToken)
|
|
|
|
resp, _, err := c.client.PlaidApi.AccountsGet(ctx).AccountsGetRequest(*request).Execute()
|
|
if err != nil {
|
|
return plaid.AccountsGetResponse{}, wrapSDKError(err)
|
|
}
|
|
|
|
return resp, nil
|
|
}
|