Commit f7cbb9b3 authored by sinopsysHK's avatar sinopsysHK Committed by Vincent A

[americanexpress] get correct accounts currency

get correct accounts currency from users session locales rather than
static so it works for other currencies than EUR
parent f712ff5c
......@@ -52,7 +52,7 @@ class AmericanExpressBrowser(LoginBrowser):
js_posted = URL(r'/account-data/v1/financials/transactions\?limit=1000&offset=(?P<offset>\d+)&statement_end_date=(?P<end>[0-9-]+)&status=posted',
js_periods = URL(r'/account-data/v1/financials/statement_periods', JsonPeriods)
currency_page = URL(r'', CurrencyPage)
currency_page = URL(r'<locale>\w\w-\w\w)/axp-balance-summary.json', CurrencyPage)
no_card = URL(r'',
r'', NoCardPage)
......@@ -93,7 +93,8 @@ class AmericanExpressBrowser(LoginBrowser):
# get currency
loc = self.session.cookies.get_dict(domain="")['axplocale'].lower()
currency =
for acc in accounts:
......@@ -143,7 +143,7 @@ class JsonBalances2(LoggedPage, JsonPage):
class CurrencyPage(LoggedPage, JsonPage):
def get_currency(self):
return self.doc['currency']
return self.doc['localeSettings']['currency_code']
class JsonPeriods(LoggedPage, JsonPage):
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment