|
|
@ -305,12 +305,25 @@ class NordigenClient(BaseClient, AggregatorClient):
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
path = f"accounts/{account_id}/transactions"
|
|
|
|
path = f"accounts/{account_id}/transactions"
|
|
|
|
response = await self.call(path, schema="Transactions")
|
|
|
|
response = await self.call(path, schema="Transactions")
|
|
|
|
parsed = response["booked"]
|
|
|
|
|
|
|
|
self.normalise_transactions(parsed, state="booked")
|
|
|
|
source = "booked"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# If requisition is specified, try to get the object
|
|
|
|
|
|
|
|
# If present, take the transaction source from there,
|
|
|
|
|
|
|
|
# pending or booked.
|
|
|
|
|
|
|
|
if req:
|
|
|
|
|
|
|
|
requisition = self.instance.get_requisition(req)
|
|
|
|
|
|
|
|
if requisition:
|
|
|
|
|
|
|
|
source = requisition.transaction_source
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
parsed = response[source]
|
|
|
|
|
|
|
|
self.normalise_transactions(parsed, state=source)
|
|
|
|
|
|
|
|
|
|
|
|
if process:
|
|
|
|
if process:
|
|
|
|
await self.process_transactions(account_id, parsed, req=req)
|
|
|
|
await self.process_transactions(account_id, parsed, req=req)
|
|
|
|
if pending:
|
|
|
|
if pending:
|
|
|
|
|
|
|
|
if process:
|
|
|
|
|
|
|
|
raise Exception("Cannot process and get pending")
|
|
|
|
parsed_pending = response["pending"]
|
|
|
|
parsed_pending = response["pending"]
|
|
|
|
self.normalise_transactions(parsed_pending, state="pending")
|
|
|
|
self.normalise_transactions(parsed_pending, state="pending")
|
|
|
|
parsed_pending.extend(parsed)
|
|
|
|
parsed_pending.extend(parsed)
|
|
|
|