# HG changeset patch # User Daniele Nicolodi # Date 1462431878 0 # Node ID af2e222f2dad3f297d79f1fcbed5b062e65defef # Parent 453c9fe6f7f99d19d62c117665ffd795dd912632 Adapt to server side changes diff -r 453c9fe6f7f9 -r af2e222f2dad bnpparibas.py --- a/bnpparibas.py Tue Jan 12 02:26:14 2016 +0100 +++ b/bnpparibas.py Thu May 05 07:04:38 2016 +0000 @@ -324,7 +324,7 @@ v = self.validate(r) return v['data'] - def records(self): + def records0(self): # required to set some cookies required by the next call url = urljoin(URL, 'fr/connexion/virements-services/releves-en-ligne') r = self.session.get(url) @@ -368,16 +368,32 @@ return documents + def records(self): + url = urljoin(URL, 'fr/connexion/mes-outils/dematerialisation') + r = self.session.get(url) + self.validate(r) + + url = urljoin(URL, 'demat-wspl/rest/listerDocuments') + r = self.session.get(url) + v = self.validate(r) + + data = r.json()['data'] + documents = data['listerDocumentDemat']['mapReleves']['Comptes chèques']['listeDocument'] + return documents + + def document(self, x): url = urljoin(URL, 'demat-wspl/rest/consultationDocumentDemat') params = {'consulted': x['consulted'], 'familleDoc': x['famDoc'], - 'ibanCrypte': self.iban, + 'ibanCrypte': x['ibanCrypte'], 'idDocument': x['idDoc'], - 'idLocalisation': 'undefined', + 'dateDocument': x['dateDoc'], 'typeCpt': x['typeCompte'], 'typeDoc': x['typeDoc'], 'viDocDocument': x['viDocDocument'], + 'idLocalisation': x['idLocalisation'], + 'ikpiPersonne': '', 'typeFamille': 'R001'} r = self.session.get(url, params=params) self.validate(r)