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
28 lines
744 B
Go
28 lines
744 B
Go
package client
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/formancehq/payments/internal/connectors/metrics"
|
|
"github.com/plaid/plaid-go/v34/plaid"
|
|
)
|
|
|
|
func (c *client) ListTransactions(ctx context.Context, accessToken string, cursor string, pageSize int) (plaid.TransactionsSyncResponse, error) {
|
|
ctx = context.WithValue(ctx, metrics.MetricOperationContextKey, "list_transactions")
|
|
|
|
request := plaid.NewTransactionsSyncRequest(accessToken)
|
|
if cursor != "" {
|
|
request.SetCursor(cursor)
|
|
}
|
|
if pageSize > 0 {
|
|
request.SetCount(int32(pageSize))
|
|
}
|
|
|
|
resp, _, err := c.client.PlaidApi.TransactionsSync(ctx).TransactionsSyncRequest(*request).Execute()
|
|
if err != nil {
|
|
return plaid.TransactionsSyncResponse{}, wrapSDKError(err)
|
|
}
|
|
|
|
return resp, nil
|
|
}
|