Closed eshaham closed 3 years ago
I would like to handle that for Isracard and Bank Hapoalim.
One challenge I have it that I'm not sure I've seen a case where a transaction in foreign currency is converted to ILS.
In my Isracard account, I see that some of my transactions are converted to ILS, but the "Original Currency" column is also ILS:
(Isracard)
Note: My credit card is set to transfer money from my מט"ח
account for foreign currency
Do you have an example of such case?
@asfktz actually, I don't spend in foreign currency in my isracard account, but I believe that @erezd ran into it when he was setting up the scraper for amex, so perhaps he could provide an example / screenshot.
as for bank hapoalim, I'm not sure we need to implement this feature for checking accounts. if I'm not mistaken, an amount in a foreign currency cannot be transferred to an ILS checking account, but you actually need to either convert it first, or setup an additional checking account in that foreign currency. but I could be wrong.
Hi @asfktz, following eshaham/israeli-ynab-updater#22 you mentioned that the transaction contain the following information:
{
"currencyId": "USD",
"currentPaymentCurrency": "USD",
}
can't we use those fields to figure original and charged currency?
Regarding the banks I think we can scrape also the foreign accounts, I can add the Leumi account if needed
@asfktz I would like to promote the support for charged currency. Please take a look at #155, I added new field to leumi-card
named chargedCurrency
in charged-currency branch. If you can add their support for Isracard
it would be great.
Better late than never.
I'm working on the chargedCurrency
field for Isracard
.
First here are examples of the two transaction types
(It charges my foreign currency account directly)
{
"specificDate": null,
"cardIndex": "0",
"dealsInbound": null,
"supplierId": null,
"supplierName": null,
"dealSumType": null,
"paymentSumSign": null,
"purchaseDate": null,
"fullPurchaseDate": null,
"moreInfo": null,
"horaatKeva": null,
"voucherNumber": "0069338",
"voucherNumberRatz": null,
"solek": null,
"purchaseDateOutbound": "13/05",
"fullPurchaseDateOutbound": "13/05/2019",
"currencyId": "USD",
"currentPaymentCurrency": "USD",
"city": "1650485163",
"supplierNameOutbound": "NOTION SO",
"fullSupplierNameOutbound": "NOTION SO",
"paymentDate": "15/05",
"fullPaymentDate": "15/05/2019",
"isShowDealsOutbound": "_",
"adendum": null,
"voucherNumberRatzOutbound": "804475868",
"isShowLinkForSupplierDetails": null,
"dealSum": null,
"paymentSum": null,
"fullSupplierNameHeb": null,
"dealSumOutbound": "5.00",
"paymentSumOutbound": "5.00",
"isHoraatKeva": "false",
"stage": null,
"returnCode": null,
"message": null,
"returnMessage": null,
"displayProperties": null,
"tablePageNum": "0",
"isError": "false",
"isCaptcha": "false",
"isButton": "false",
"siteName": null,
"clientIpAddress": null
}
{
"specificDate": null,
"cardIndex": "0",
"dealsInbound": null,
"supplierId": null,
"supplierName": null,
"dealSumType": null,
"paymentSumSign": null,
"purchaseDate": null,
"fullPurchaseDate": null,
"moreInfo": null,
"horaatKeva": null,
"voucherNumber": "0012655",
"voucherNumberRatz": null,
"solek": null,
"purchaseDateOutbound": "14/06",
"fullPurchaseDateOutbound": "14/06/2019",
"currencyId": "NIS",
"currentPaymentCurrency": "NIS",
"city": "G.CO/HELPP",
"supplierNameOutbound": "GOOGLE BLINKIS",
"fullSupplierNameOutbound": "GOOGLE BLINKIST",
"paymentDate": "16/06",
"fullPaymentDate": "16/06/2019",
"isShowDealsOutbound": "_",
"adendum": null,
"voucherNumberRatzOutbound": "917339015",
"isShowLinkForSupplierDetails": null,
"dealSum": null,
"paymentSum": null,
"fullSupplierNameHeb": null,
"dealSumOutbound": "79.90",
"paymentSumOutbound": "79.90",
"isHoraatKeva": "false",
"stage": null,
"returnCode": null,
"message": null,
"returnMessage": null,
"displayProperties": null,
"tablePageNum": "0",
"isError": "false",
"isCaptcha": "false",
"isButton": "false",
"siteName": null,
"clientIpAddress": null
}
Take a look at the converted transaction (example 2),
In the GUI, you can see that the original amount is $22
and it is converted to 72.90 ILS
.
Now, getting the chargedCurrency
is easy, we can use currencyId
or currentPaymentCurrency
.
But, we use currencyId
for the originalCurrency
already:
So, we need to find a way to get the real originalCurrency
and originalAmount
.
The problem is that while we can see it in the GUI, the API response does not return anything that can be used as originalCurrency
and originalAmount
(maybe it rendered server side?)
Any ideas? @eshaham @esakal
@asfktz It's weird that they specify ILS for the original amount, although the transaction was originally USD. I would probably stick with the currency of what they claim to be the original amount, because, as can be seen in your first example, it can be in other currencies.
OK, so I added chargedCurrency
, and for Isracard, its always the same as originalCurrency
I feel a bit awkward knowing that the originalCurrency & originalAmount is wrong. We know that know, but I don't think it will be clear for anyone else.
I wish there was a way to at least tell that this transaction's currency is converted
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Has there been any consensus regarding this issue?
I just ran into it, with a card that had GBP transactions that were charged in USD. For example:
"currencyId": "USD",
"currentPaymentCurrency": "GBP",
"dealSumOutbound": "5.60",
"fullSupplierNameOutbound": "TFL TRAVEL CH",
"paymentSumOutbound": "7.59",
}
The result of this with the current isracard scraper is: originalAmount = -5.6, chargedAmount = -7.59, originalCurrency = USD
This is wrong, because the original currency is GBP and not USD.
@esakal can you please re-open this issue?
@sagiba I re-opened this one but reading the thread I'm a bit confuse about what can/should be done here.
@esakal, we need to change originalCurrency to map to currentPaymentCurrency instead of currencyId, and add another field, chargeCurrency, that maps to currencyId.
I can take care of this after we agree on #418, because I first want to add some test coverage on the conversion logic here.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
In some cases when users have a foreign currency account in their banks, transactions in that foreign currency get charged directly against the foreign currency bank account, and conversion to
ILS
is not needed.Currently this module always assumes
chargedAmount
is returned inILS
. We should introduce a newchargedCurrency
property to transactions that will hold the actual currency used.