Commit 76445cc7 authored by Damien Mat's avatar Damien Mat Committed by ntome

[bnporc] Fixed old url used for HistoryPage

Commit 246836bbf162dcd1fac9a56b844a058a771ff51f updated the url used for
comings and history.
For some connections the former url is still used. We don't knwow which
ones do. It cannot be declared in the same URL object since it is used in a .go() method that
might raise a BrowserUnavailable.

Closes: 12950@zendesk, 25845@sibi
parent e3433c67
......@@ -37,7 +37,7 @@ from weboob.tools.capabilities.bank.transactions import sorted_transactions
from weboob.tools.json import json
from weboob.browser.exceptions import ServerError
from weboob.browser.elements import DataError
from weboob.exceptions import BrowserIncorrectPassword
from weboob.exceptions import BrowserIncorrectPassword, BrowserUnavailable
from weboob.tools.value import Value, ValueBool
from weboob.tools.capabilities.bank.investments import create_french_liquidity
......@@ -100,6 +100,7 @@ class BNPParibasBrowser(JsonBrowserMixin, LoginBrowser):
loan_details = URL(r'caraccomptes-wspl/rpc/(?P<loan_type>.*)', LoanDetailsPage)
ibans = URL(r'rib-wspl/rpc/comptes', AccountsIBANPage)
history = URL(r'rop2-wspl/rest/releveOp', HistoryPage)
history_old = URL(r'rop-wspl/rest/releveOp', HistoryPage)
transfer_init = URL(r'virement-wspl/rest/initialisationVirement', TransferInitPage)
lifeinsurances = URL(r'mefav-wspl/rest/infosContrat', LifeInsurancesPage)
......@@ -280,14 +281,21 @@ class BNPParibasBrowser(JsonBrowserMixin, LoginBrowser):
if not self.card_to_transaction_type:
self.list_detail_card.go()
self.card_to_transaction_type = self.page.get_card_to_transaction_type()
self.history.go(data=JSON({
data = JSON({
"ibanCrypte": account.id,
"pastOrPending": 1,
"triAV": 0,
"startDate": (datetime.now() - relativedelta(years=1)).strftime('%d%m%Y'),
"endDate": datetime.now().strftime('%d%m%Y')
}))
})
try:
self.history.go(data=data)
except BrowserUnavailable:
# old url is still used for certain connections bu we don't know which one is,
# so the same HistoryPage is attained by the old url in another URL object
data[1]['startDate'] = (datetime.now() - relativedelta(years=3)).strftime('%d%m%Y')
# old url authorizes up to 3 years of history
self.history_old.go(data=data)
if coming:
return sorted_transactions(self.page.iter_coming())
......
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