israeli-bank-scrapers icon indicating copy to clipboard operation
israeli-bank-scrapers copied to clipboard

fix(isracard): use the correct value for `originalCurrency`

Open daniel-hauser opened this issue 7 months ago • 5 comments

Transactions in isracard has the wrong originalCurrency. The correct mapping of the currencies should be:

  • originalCurrency = currentPaymentCurrency
  • chargedCurrency = currencyId

Attached is an example transaction that should have originalCurrency: "USD", chargedCurrency: "ILS" but before the code in this PR it's originalCurrency: "ILS" with no chargedCurrency

The isracard transaction object:

{
    ...
    "currencyId": "NIS",
    "currentPaymentCurrency": "USD",
    ...
    "fullSupplierNameOutbound": "UBER   TRIP",
    ...
    "dealSumOutbound": "66.66",
    "paymentSumOutbound": "248.24",
    ...
}

The israeli-bank-scrapers transaction object (diff before and after the change):

{
         ...
	"originalAmount": -66.66,
-	"originalCurrency": "ILS",
+	"originalCurrency": "USD",
+	"chargedCurrency": "ILS",
	"chargedAmount": -248.24,
	"description": "UBER   TRIP",
	...
}

daniel-hauser avatar Jul 02 '24 19:07 daniel-hauser