@@ -512,13 +512,15 @@ def _find_highest_supported_command(self, *segment_classes, **kwargs):
512
512
else :
513
513
return version_map .get (max_version .header .version )
514
514
515
- def get_transactions (self , account : SEPAAccount , start_date : datetime .date = None , end_date : datetime .date = None ):
515
+ def get_transactions (self , account : SEPAAccount , start_date : datetime .date = None , end_date : datetime .date = None ,
516
+ include_pending = False ):
516
517
"""
517
518
Fetches the list of transactions of a bank account in a certain timeframe.
518
519
519
520
:param account: SEPA
520
521
:param start_date: First day to fetch
521
522
:param end_date: Last day to fetch
523
+ :param include_pending: Include pending transactions (might lack some data like booking day)
522
524
:return: A list of mt940.models.Transaction objects
523
525
"""
524
526
@@ -535,7 +537,10 @@ def get_transactions(self, account: SEPAAccount, start_date: datetime.date = Non
535
537
date_end = end_date ,
536
538
touchdown_point = touchdown ,
537
539
),
538
- lambda responses : mt940_to_array ('' .join ([seg .statement_booked .decode ('iso-8859-1' ) for seg in responses ])),
540
+ lambda responses : mt940_to_array ('' .join (
541
+ [seg .statement_booked .decode ('iso-8859-1' ) for seg in responses ] +
542
+ ([seg .statement_pending .decode ('iso-8859-1' ) for seg in responses ] if include_pending else [])
543
+ )),
539
544
'HIKAZ' ,
540
545
# Note 1: Some banks send the HIKAZ data in arbitrary splits.
541
546
# So better concatenate them before MT940 parsing.
0 commit comments