eshaham / israeli-bank-scrapers

Provide scrapers for all major Israeli banks and credit card companies
MIT License
567 stars 152 forks source link

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

Open daniel-hauser opened 2 weeks ago

daniel-hauser commented 2 weeks ago

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


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 commented 2 weeks ago

@baruchiro / @eshaham / @esakal Can you please review? Thanks!

baruchiro commented 2 weeks ago

I know it sounds lazy, but I feel I need more focus to understand it (because I'm taking these reviews sometimes from my phone between things).

Can you edit the description with a "before and after" example, so the change will be thrown דוך to my eyes?

baruchiro commented 1 week ago

@galbarm @daniel-hauser Can you check if in your Dollar transactions there is a mistake?

I'm not paying with my Isracard on Dollars.

esakal commented 1 week ago

@daniel-hauser I"m not sure if this is ok or not

CleanShot 2024-07-11 at 08 25 23

the amount is in $ but the currency is nis. this is the outcome of the test CleanShot 2024-07-11 at 08 27 37

is this what you expected?

Note that with this change for transactions whose original currency is ILS, the returned value for the original currency is now empty instead of ILS. this is intentionally?

daniel-hauser commented 1 week ago

@esakal Can you share the following values from your transaction (in the isracard website)?

{
    ...
    "currencyId": ,
    "currentPaymentCurrency": ,
    ...
    "fullSupplierNameOutbound": ,
    ...
    "dealSumOutbound": ,
    "paymentSumOutbound": ,
    ...
}