Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged

Conversation

daniel-hauser
Copy link
Contributor

@daniel-hauser daniel-hauser commented Jul 2, 2024

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 daniel-hauser changed the title fix(isracard): Use the correct value for originalCurrency fix(isracard): use the correct value for originalCurrency Jul 2, 2024
@daniel-hauser
Copy link
Contributor Author

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

@baruchiro
Copy link
Collaborator

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
Copy link
Collaborator

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

I'm not paying with my Isracard on Dollars.

Copy link
Collaborator

@baruchiro baruchiro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's been approved, but I prefer someone who will reproduce this issue and approve your fix.

@esakal
Copy link
Collaborator

esakal commented Jul 11, 2024

@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
Copy link
Contributor Author

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

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

@baruchiro baruchiro merged commit 79d71a9 into eshaham:master Sep 2, 2024
6 checks passed
Copy link

github-actions bot commented Sep 2, 2024

🎉 This PR is included in version 5.1.2 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants