Add the history for Livret A account (ing)

Signed-off-by: Florent <weboob@flo.fourcot.fr>
Signed-off-by: Romain Bignon <romain@peerfuse.org>
This commit is contained in:
Florent 2012-01-09 16:23:24 +01:00 committed by Romain Bignon
commit 91cfedb247
3 changed files with 45 additions and 8 deletions

View file

@ -32,7 +32,8 @@ class Ing(BaseBrowser):
PAGES = {'.*displayTRAccountSummary.*': pages.AccountsList,
'.*displayLogin.jsf': pages.LoginPage,
'.*displayLogin.jsf.*': pages.LoginPage2,
'.*accountDetail.jsf.*': pages.AccountHistory
'.*accountDetail.jsf.*': pages.AccountHistoryCC,
'.*displayTRHistoriqueLA.*': pages.AccountHistoryLA
}
def __init__(self, *args, **kwargs):
@ -78,8 +79,15 @@ class Ing(BaseBrowser):
return None
def get_history(self, id):
# TODO: It works only with the Compte Courant, Livret A use an another page...
self.location('https://secure.ingdirect.fr/protected/pages/cc/accountDetail.jsf')
account = self.get_account(id)
# The first and the second letter of the label are the account type
if account.label[0:2] == "CC":
self.location('https://secure.ingdirect.fr/protected/pages/cc/accountDetail.jsf')
elif account.label[0:2] == "LA":
# we want "displayTRHistoriqueLA" but this fucking page is not directly available...
self.location('https://secure.ingdirect.fr/general?command=goToAccount&account=%d&zone=COMPTE' % int(id))
else:
raise NotImplementedError()
return self.page.get_operations()
# TODO