Model brokers
components.payment_gateway.subcomponents.transfers.models.brokers.account_transfer ¶
AccountTransferModelBroker ¶
Bases: BaseModelBroker
Model broker for the AccountTransfer model.
aggregate_account_transfer_balance
classmethod
¶
aggregate_account_transfer_balance(
session,
/,
transfer_history_id,
*,
effective_date,
creation_date,
)
Source code in components/payment_gateway/subcomponents/transfers/models/brokers/account_transfer.py
find_account_transfer_by_id
classmethod
¶
Source code in components/payment_gateway/subcomponents/transfers/models/brokers/account_transfer.py
get_account_transfer
classmethod
¶
Source code in components/payment_gateway/subcomponents/transfers/models/brokers/account_transfer.py
get_account_transfer_by_external_id
classmethod
¶
Source code in components/payment_gateway/subcomponents/transfers/models/brokers/account_transfer.py
list_account_transfers_for_accounts
classmethod
¶
list_account_transfers_for_accounts(
session,
/,
account_ids,
*,
start_effective_date=None,
end_effective_date=None,
)
Find all the account transfers for the given accounts and optional time period.
Note: this will include TransferEvents that are out of bounds of the given time period. If at some point we want a function that returns only the events in the given time period, we should create a new method based on this ⧉ and not forget to add the .outerjoin.
Source code in components/payment_gateway/subcomponents/transfers/models/brokers/account_transfer.py
list_account_transfers_for_transfer_histories
classmethod
¶
list_account_transfers_for_transfer_histories(
session,
/,
transfer_history_ids,
*,
start_effective_date=None,
end_effective_date=None,
order_by_created_at=False,
)
Find all the account transfers for the given transfer histories and optional time period.
Note: this will include TransferEvents that are out of bounds of the given time period. If at some point we want a function that returns only the events in the given time period, we should create a new method based on this ⧉ and not forget to add the .outerjoin.
Source code in components/payment_gateway/subcomponents/transfers/models/brokers/account_transfer.py
record_account_transfer
classmethod
¶
record_account_transfer(
session,
/,
*,
effective_date,
direction,
reference,
provider,
external_id,
account_id,
transfer_history_id,
raw=None,
)
Source code in components/payment_gateway/subcomponents/transfers/models/brokers/account_transfer.py
search_account_transfers
classmethod
¶
search_account_transfers(
session,
/,
*,
account_ids=None,
transfer_history_ids=None,
start_effective_date=None,
end_effective_date=None,
order_by_created_at=False,
)
Find all the account transfers for the given time period.
Note: this will include TransferEvents that are out of bounds of the given time period. If at some point we want a function that returns only the events in the given time period, we should create a new method based on this ⧉ and not forget to add the .outerjoin.
Source code in components/payment_gateway/subcomponents/transfers/models/brokers/account_transfer.py
components.payment_gateway.subcomponents.transfers.models.brokers.bank_transfer ¶
BankTransferModelBroker ¶
Bases: BaseModelBroker
Model broker for the BankTransfer model.
aggregate_bank_transfer_balance
classmethod
¶
aggregate_bank_transfer_balance(
session,
/,
transfer_history_id,
*,
effective_date,
creation_date,
)
Source code in components/payment_gateway/subcomponents/transfers/models/brokers/bank_transfer.py
find_bank_transfer_by_id
classmethod
¶
Source code in components/payment_gateway/subcomponents/transfers/models/brokers/bank_transfer.py
get_bank_transfer
classmethod
¶
Source code in components/payment_gateway/subcomponents/transfers/models/brokers/bank_transfer.py
get_bank_transfer_by_external_id
classmethod
¶
Source code in components/payment_gateway/subcomponents/transfers/models/brokers/bank_transfer.py
list_bank_transfers_for_accounts
classmethod
¶
list_bank_transfers_for_accounts(
session,
/,
account_ids,
*,
start_effective_date=None,
end_effective_date=None,
)
Find all the bank transfers for the given transfer histories and optional time period.
Note: this will include TransferEvents that are out of bounds of the given time period. If at some point we want a function that returns only the events in the given time period, we should create a new method based on this ⧉ and not forget to add the .outerjoin.
Source code in components/payment_gateway/subcomponents/transfers/models/brokers/bank_transfer.py
list_bank_transfers_for_transfer_histories
classmethod
¶
list_bank_transfers_for_transfer_histories(
session,
/,
transfer_history_ids,
*,
start_effective_date=None,
end_effective_date=None,
order_by_created_at=False,
)
Find all the bank transfers for the given transfer histories and optional time period.
Note: this will include TransferEvents that are out of bounds of the given time period. If at some point we want a function that returns only the events in the given time period, we should create a new method based on this ⧉ and not forget to add the .outerjoin.
Source code in components/payment_gateway/subcomponents/transfers/models/brokers/bank_transfer.py
record_bank_transfer
classmethod
¶
record_bank_transfer(
session,
/,
*,
effective_date,
direction,
provider,
external_id,
account_id,
transfer_history_id,
sepa_mandate_id=None,
sepa_beneficiary_id=None,
raw=None,
)
Source code in components/payment_gateway/subcomponents/transfers/models/brokers/bank_transfer.py
search_bank_transfers
classmethod
¶
search_bank_transfers(
session,
/,
*,
account_ids=None,
transfer_history_ids=None,
start_effective_date=None,
end_effective_date=None,
order_by_created_at=False,
)
Find all the bank transfers in a transfer history for the given time period.
Note: this will include TransferEvents that are out of bounds of the given time period. If at some point we want a function that returns only the events in the given time period, we should create a new method based on this ⧉ and not forget to add the .outerjoin.
Source code in components/payment_gateway/subcomponents/transfers/models/brokers/bank_transfer.py
components.payment_gateway.subcomponents.transfers.models.brokers.card_transfer ¶
CardTransferModelBroker ¶
Bases: BaseModelBroker
Model broker for the CardTransfer model.
aggregate_card_transfer_balance
classmethod
¶
aggregate_card_transfer_balance(
session,
/,
transfer_history_id,
*,
effective_date,
creation_date,
)
Source code in components/payment_gateway/subcomponents/transfers/models/brokers/card_transfer.py
find_card_transfer_by_id
classmethod
¶
Source code in components/payment_gateway/subcomponents/transfers/models/brokers/card_transfer.py
get_card_transfer
classmethod
¶
Source code in components/payment_gateway/subcomponents/transfers/models/brokers/card_transfer.py
get_card_transfer_by_external_id
classmethod
¶
Source code in components/payment_gateway/subcomponents/transfers/models/brokers/card_transfer.py
list_card_transfers_for_accounts
classmethod
¶
list_card_transfers_for_accounts(
session,
/,
account_ids,
*,
start_effective_date=None,
end_effective_date=None,
)
Find all the card transfers for the given accounts and optional time period.
Note: this will include TransferEvents that are out of bounds of the given time period. If you only want the events that happened within a time period, you should use the find_by_event_date method.
Source code in components/payment_gateway/subcomponents/transfers/models/brokers/card_transfer.py
list_card_transfers_for_cards
classmethod
¶
Source code in components/payment_gateway/subcomponents/transfers/models/brokers/card_transfer.py
list_card_transfers_for_transfer_histories
classmethod
¶
list_card_transfers_for_transfer_histories(
session,
/,
transfer_history_ids,
*,
start_effective_date=None,
end_effective_date=None,
)
Find all the card transfers for the given transfer histories and optional time period.
Note: this will include TransferEvents that are out of bounds of the given time period. If you only want the events that happened within a time period, you should use the find_by_event_date method.
Source code in components/payment_gateway/subcomponents/transfers/models/brokers/card_transfer.py
list_card_transfers_for_transfer_histories_by_event_date
classmethod
¶
list_card_transfers_for_transfer_histories_by_event_date(
session,
/,
transfer_history_ids,
*,
start_effective_date=None,
end_effective_date=None,
order_by_created_at=False,
)
Find all the card transfers attached to given accounts with events that happened for the given time period.
Source code in components/payment_gateway/subcomponents/transfers/models/brokers/card_transfer.py
record_card_transfer
classmethod
¶
record_card_transfer(
session,
/,
*,
effective_date,
mcc,
merchant_id,
city,
country,
name,
provider,
external_id,
card_id,
account_id,
postal_code=None,
transfer_history_id=None,
raw=None,
)
Source code in components/payment_gateway/subcomponents/transfers/models/brokers/card_transfer.py
search_card_transfers
classmethod
¶
search_card_transfers(
session,
/,
*,
account_ids=None,
transfer_history_ids=None,
start_effective_date=None,
end_effective_date=None,
order_by_created_at=False,
)
Find all the card transfers attached to given accounts for the given time period.
Note: this will include TransferEvents that are out of bounds of the given time period. If you only want the events that happened within a time period, you should use the find_by_event_date method.
Source code in components/payment_gateway/subcomponents/transfers/models/brokers/card_transfer.py
components.payment_gateway.subcomponents.transfers.models.brokers.internal_transfer ¶
InternalTransferModelBroker ¶
Bases: BaseModelBroker
Model broker for the InternalTransfer model.
aggregate_internal_transfer_balance
classmethod
¶
aggregate_internal_transfer_balance(
session,
/,
transfer_history_id,
*,
effective_date,
creation_date,
)
Source code in components/payment_gateway/subcomponents/transfers/models/brokers/internal_transfer.py
create_internal_transfer
classmethod
¶
create_internal_transfer(
session,
/,
*,
transfer_history_id,
effective_date,
amount,
description,
reference,
)
Source code in components/payment_gateway/subcomponents/transfers/models/brokers/internal_transfer.py
find_internal_transfer_by_id
classmethod
¶
Source code in components/payment_gateway/subcomponents/transfers/models/brokers/internal_transfer.py
get_internal_transfer
classmethod
¶
Source code in components/payment_gateway/subcomponents/transfers/models/brokers/internal_transfer.py
list_internal_transfers_by_reference
classmethod
¶
Source code in components/payment_gateway/subcomponents/transfers/models/brokers/internal_transfer.py
list_internal_transfers_for_transfer_histories
classmethod
¶
list_internal_transfers_for_transfer_histories(
session,
/,
transfer_history_ids,
*,
start_effective_date=None,
end_effective_date=None,
order_by_created_at=False,
)
Find all the internal transfers for the given transfer histories and optional time period.
Note: this will include TransferEvents that are out of bounds of the given time period. If at some point we want a function that returns only the events in the given time period, we should create a new method based on this ⧉ and not forget to add the .outerjoin.
Source code in components/payment_gateway/subcomponents/transfers/models/brokers/internal_transfer.py
components.payment_gateway.subcomponents.transfers.models.brokers.transfer_event ¶
TransferEventModelBroker ¶
Bases: BaseModelBroker
Model broker for the TransferEvent model.
get_transfer_event_by_external_id
classmethod
¶
Source code in components/payment_gateway/subcomponents/transfers/models/brokers/transfer_event.py
record_transfer_event
classmethod
¶
record_transfer_event(
session,
/,
effective_date,
received,
reserved,
balance,
status,
provider,
external_id,
raw=None,
)
Source code in components/payment_gateway/subcomponents/transfers/models/brokers/transfer_event.py
components.payment_gateway.subcomponents.transfers.models.brokers.transfer_history ¶
TransferHistoryModelBroker ¶
Bases: BaseModelBroker
Model broker for the TransferHistory model.
create_transfer_history
classmethod
¶
Source code in components/payment_gateway/subcomponents/transfers/models/brokers/transfer_history.py
get_transfer_history
classmethod
¶
Source code in components/payment_gateway/subcomponents/transfers/models/brokers/transfer_history.py
get_transfer_history_by_private_ref
classmethod
¶
Source code in components/payment_gateway/subcomponents/transfers/models/brokers/transfer_history.py
list_transfer_histories
classmethod
¶
Source code in components/payment_gateway/subcomponents/transfers/models/brokers/transfer_history.py
record_transfer_history
classmethod
¶
Source code in components/payment_gateway/subcomponents/transfers/models/brokers/transfer_history.py
components.payment_gateway.subcomponents.transfers.models.brokers.transfer_update ¶
TransferUpdateModelBroker ¶
Bases: BaseModelBroker
get_transfer_updates_by_bank_transfer_id
classmethod
¶
Get all transfer updates for a given bank transfer ID, ordered by sequence number descending.
Source code in components/payment_gateway/subcomponents/transfers/models/brokers/transfer_update.py
record_transfer_update
classmethod
¶
record_transfer_update(
session,
/,
*,
transfer_id,
transfer_type,
direction,
sequence_number,
occurred_at,
amount,
currency,
status,
provider,
external_transfer_id,
raw=None,
external_transaction_id=None,
)
Create a transfer update if it doesn't exist, else do nothing (idempotent).
It's OK to just ignore the updated fields if the row already exists, as the PSPs should send the same information on every occurrence of the event, and there's nothing we can do with inconsistent updates. So we just record the first one and ignore the rest.
Returns:
| Name | Type | Description |
|---|---|---|
TransferUpdate |
TransferUpdate
|
The transfer update model instance. |
bool |
bool
|
True if the transfer update was created, False if it already existed. |