From c571da92addd5aebf7024afccf77fa2705be2e9b Mon Sep 17 00:00:00 2001 From: Paul Nicolas Date: Tue, 20 Feb 2024 18:37:40 +0100 Subject: [PATCH] only euros are supported right now --- .../cmd/connectors/internal/connectors/atlar/currencies.go | 6 +++--- .../internal/connectors/atlar/task_fetch_transactions.go | 4 ++++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/components/payments/cmd/connectors/internal/connectors/atlar/currencies.go b/components/payments/cmd/connectors/internal/connectors/atlar/currencies.go index 99636be6e6..a0af6168e1 100644 --- a/components/payments/cmd/connectors/internal/connectors/atlar/currencies.go +++ b/components/payments/cmd/connectors/internal/connectors/atlar/currencies.go @@ -1,7 +1,7 @@ package atlar -import "github.com/formancehq/payments/cmd/connectors/internal/connectors/currency" - var ( - supportedCurrenciesWithDecimal = currency.ISO4217Currencies + supportedCurrenciesWithDecimal = map[string]int{ + "EUR": 2, // Euro + } ) diff --git a/components/payments/cmd/connectors/internal/connectors/atlar/task_fetch_transactions.go b/components/payments/cmd/connectors/internal/connectors/atlar/task_fetch_transactions.go index deb18307c3..260ce4885a 100644 --- a/components/payments/cmd/connectors/internal/connectors/atlar/task_fetch_transactions.go +++ b/components/payments/cmd/connectors/internal/connectors/atlar/task_fetch_transactions.go @@ -72,6 +72,10 @@ func ingestPaymentsBatch( batch := ingestion.PaymentBatch{} for _, item := range pagedTransactions.Payload.Items { + if _, ok := supportedCurrenciesWithDecimal[*item.Amount.Currency]; !ok { + continue + } + raw, err := json.Marshal(item) if err != nil { return err