Skip to content

Commit

Permalink
Merge pull request #27 from cpainchaud/patch-1
Browse files Browse the repository at this point in the history
FIX problème de détection des dernières transactions
  • Loading branch information
dmachard authored Oct 26, 2023
2 parents 3bef8eb + 763cd27 commit 9d4016c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions creditagricole_particuliers/operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,10 @@ def get_operations(self, count, startIndex=None, limit=30, sleep=None):
url += "/%s/particulier/operations/synthese/detail-comptes/" % self.session.regional_bank_url
url += "jcr:content.n3.operations.json?grandeFamilleCode=%s&compteIdx=%s" % (self.grandeFamilleCode, self.compteIdx)
url += "&idDevise=EUR"
url += "&dateDebut=%s" % ts_date_debut
if startIndex is not None:
url += "&startIndex=%s" % requests.utils.quote(startIndex)
else:
url += "&dateDebut=%s" % ts_date_debut
url += "&dateFin=%s" % ts_date_fin
url += "&count=%s" % limit

Expand All @@ -135,7 +135,7 @@ def get_operations(self, count, startIndex=None, limit=30, sleep=None):
for op in rsp["listeOperations"]:
self.list_operations.append( Operation(op) )

if nextCount > 0 and 'nextSetStartIndex' in rsp:
if nextCount > 0 and 'nextSetStartIndex' in rsp and 'hasNext' in rsp and rsp['hasNext'] is True:
if sleep is not None and (isinstance(sleep, int) or isinstance(sleep, float)):
time.sleep(sleep)
self.get_operations(nextCount, rsp["nextSetStartIndex"])

0 comments on commit 9d4016c

Please sign in to comment.