support Banque BCP which uses same website than caissedepargne
This commit is contained in:
parent
ffe79d1b6b
commit
9a9f061beb
2 changed files with 19 additions and 11 deletions
|
|
@ -33,16 +33,17 @@ __all__ = ['CaisseEpargne']
|
|||
class CaisseEpargne(Browser):
|
||||
DOMAIN = 'www.caisse-epargne.fr'
|
||||
PROTOCOL = 'https'
|
||||
CERTHASH = ['dfff27d6db1fcdf1cea3ab8e3c1ca4f97c971262e95be49f3385b40c97fe640c', '9894ab2088630f341de821a09f1286c525f854f62ac186bd442368b4692c5969']
|
||||
PAGES = {'https://[^/]+.caisse-epargne.fr/particuliers/ind_pauthpopup.aspx.*': LoginPage,
|
||||
'https://[^/]+.caisse-epargne.fr/Portail.aspx': IndexPage,
|
||||
'https://[^/]+.caisse-epargne.fr/login.aspx': ErrorPage,
|
||||
'https://[^/]+.caisse-epargne.fr/Pages/logout.aspx.*': ErrorPage,
|
||||
'https://[^/]+.caisse-epargne.fr/page_hs_dei_.*.aspx': UnavailablePage,
|
||||
CERTHASH = ['dfff27d6db1fcdf1cea3ab8e3c1ca4f97c971262e95be49f3385b40c97fe640c', '9894ab2088630f341de821a09f1286c525f854f62ac186bd442368b4692c5969', '0e0fa585a8901c206c4ebbc7ee33e00e17809d7086f224e1b226c46165a4b5ac']
|
||||
PAGES = {'https://[^/]+/particuliers/ind_pauthpopup.aspx.*': LoginPage,
|
||||
'https://[^/]+/Portail.aspx': IndexPage,
|
||||
'https://[^/]+/login.aspx': ErrorPage,
|
||||
'https://[^/]+/Pages/logout.aspx.*': ErrorPage,
|
||||
'https://[^/]+/page_hs_dei_.*.aspx': UnavailablePage,
|
||||
}
|
||||
|
||||
def __init__(self, nuser, *args, **kwargs):
|
||||
self.nuser = nuser
|
||||
self.DOMAIN = kwargs.pop('domain', self.DOMAIN)
|
||||
Browser.__init__(self, *args, **kwargs)
|
||||
|
||||
def _certhash(self, domain, port=443):
|
||||
|
|
@ -72,7 +73,7 @@ class CaisseEpargne(Browser):
|
|||
|
||||
self._ua_handlers['_cookies'].cookiejar.clear()
|
||||
if not self.is_on_page(LoginPage):
|
||||
self.location('https://www.caisse-epargne.fr/particuliers/ind_pauthpopup.aspx?mar=101®=&fctpopup=auth&cv=0', no_login=True)
|
||||
self.location(self.buildurl('/particuliers/ind_pauthpopup.aspx?mar=101®=&fctpopup=auth&cv=0'), no_login=True)
|
||||
|
||||
self.page.login(self.username)
|
||||
if not self.page.login2(self.nuser, self.password):
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@
|
|||
from weboob.capabilities.bank import CapBank, AccountNotFound
|
||||
from weboob.tools.backend import Module, BackendConfig
|
||||
from weboob.tools.value import Value, ValueBackendPassword
|
||||
from weboob.tools.ordereddict import OrderedDict
|
||||
|
||||
from .browser import CaisseEpargne
|
||||
|
||||
|
|
@ -35,15 +36,21 @@ class CaisseEpargneModule(Module, CapBank):
|
|||
VERSION = '1.1'
|
||||
DESCRIPTION = u'Caisse d\'Épargne'
|
||||
LICENSE = 'AGPLv3+'
|
||||
CONFIG = BackendConfig(ValueBackendPassword('login', label='Identifiant client', masked=False),
|
||||
website_choices = OrderedDict([(k, u'%s (%s)' % (v, k)) for k, v in sorted({
|
||||
'www.caisse-epargne.fr': u'Caisse d\'Épargne',
|
||||
'www.banquebcp.fr': u'Banque BCP',
|
||||
}.iteritems(), key=lambda k_v: (k_v[1], k_v[0]))])
|
||||
CONFIG = BackendConfig(Value('website', label='Banque', choices=website_choices, default='www.caisse-epargne.fr'),
|
||||
ValueBackendPassword('login', label='Identifiant client', masked=False),
|
||||
ValueBackendPassword('password', label='Code personnel', regexp='\d+'),
|
||||
Value('nuser', label='User ID (optional)', default=''))
|
||||
BROWSER = CaisseEpargne
|
||||
|
||||
def create_default_browser(self):
|
||||
return self.create_browser(self.config['nuser'].get(),
|
||||
self.config['login'].get(),
|
||||
self.config['password'].get())
|
||||
return self.create_browser(nuser=self.config['nuser'].get(),
|
||||
username=self.config['login'].get(),
|
||||
password=self.config['password'].get(),
|
||||
domain=self.config['website'].get())
|
||||
|
||||
def iter_accounts(self):
|
||||
with self.browser:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue