Adapters
components.payment_gateway.subcomponents.accounts.adapters.account_balance_adapter ¶
Adapter contract for fetching account balances from PSPs.
Each PSP implementation is responsible for fan-out: JPM returns all entitled
accounts in a single call, Revolut needs one call per currency, etc. The
caller is handed back a flat list of AccountBalance and decides what to
do with it.
components.payment_gateway.subcomponents.accounts.adapters.account_balance_adapter_registry ¶
AccountBalanceAdapterRegistry ¶
Registry of adapters that expose account balances per PSP.
Source code in components/payment_gateway/subcomponents/accounts/adapters/account_balance_adapter_registry.py
create
classmethod
¶
Build adapters for every PSP available in the current environment.
Source code in components/payment_gateway/subcomponents/accounts/adapters/account_balance_adapter_registry.py
create_null
classmethod
¶
create_null(
*,
track_jpmorgan_requests=None,
jpmorgan_responses=None,
track_revolut_requests=None,
revolut_responses=None,
revolut_simulator=None
)
Null registry for tests.
Source code in components/payment_gateway/subcomponents/accounts/adapters/account_balance_adapter_registry.py
get_account_balance_adapter ¶
Source code in components/payment_gateway/subcomponents/accounts/adapters/account_balance_adapter_registry.py
components.payment_gateway.subcomponents.accounts.adapters.adyen ¶
adyen_provider_account_adapter ¶
AdyenProviderAccountAdapter ¶
Bases: ProviderAccountAdapter
Adapter for fetching a single Adyen balance account.
Adyen exposes a balance account directly by its id (BA…) via the Balance
Platform Configuration API. Amounts are already in minor units, so they are
passed through unchanged.
Source code in components/payment_gateway/subcomponents/accounts/adapters/adyen/adyen_provider_account_adapter.py
create
classmethod
¶
Normal factory.
Source code in components/payment_gateway/subcomponents/accounts/adapters/adyen/adyen_provider_account_adapter.py
create_null
classmethod
¶
Null factory.
Source code in components/payment_gateway/subcomponents/accounts/adapters/adyen/adyen_provider_account_adapter.py
get_account ¶
Source code in components/payment_gateway/subcomponents/accounts/adapters/adyen/adyen_provider_account_adapter.py
helpers ¶
to_balance_account_info ¶
Convert our account model into an Adyen BalanceAccountInfo for API creation calls.
Source code in components/payment_gateway/subcomponents/accounts/adapters/adyen/helpers.py
components.payment_gateway.subcomponents.accounts.adapters.jpmorgan ¶
jpmorgan_account_balance_adapter ¶
JPMorganAccountBalanceAdapter ¶
Bases: AccountBalanceAdapter
Source code in components/payment_gateway/subcomponents/accounts/adapters/jpmorgan/jpmorgan_account_balance_adapter.py
create
classmethod
¶
Source code in components/payment_gateway/subcomponents/accounts/adapters/jpmorgan/jpmorgan_account_balance_adapter.py
create_null
classmethod
¶
Source code in components/payment_gateway/subcomponents/accounts/adapters/jpmorgan/jpmorgan_account_balance_adapter.py
list_account_balances ¶
Source code in components/payment_gateway/subcomponents/accounts/adapters/jpmorgan/jpmorgan_account_balance_adapter.py
components.payment_gateway.subcomponents.accounts.adapters.provider_account_adapter ¶
Adapter contract for fetching a single Provider Account, with its balances.
A Provider Account (AKA PSP Account) is a virtual account (not a real Bank Account with an IBAN and KYC and stuff) that can hold a balance.
Transfers can typically occur between accounts on the same PSP without fees or delays.
Usually not accessible from outside the PSP, although some can function as Bank Accounts if properly KYC'd.
Example: an Adyen balance account (BA...), mapped to an Account via its external_id.
Business context — Alan Flex (🇪🇸): Flex is Alan's flexible-benefits product. Each client company gets its own Provider Account (today an Adyen balance account) that the company pre-funds; that balance backs its employees' Flex card spending.
components.payment_gateway.subcomponents.accounts.adapters.provider_account_adapter_registry ¶
ProviderAccountAdapterRegistry ¶
Registry of adapters that fetch a single account by its PSP id.
Source code in components/payment_gateway/subcomponents/accounts/adapters/provider_account_adapter_registry.py
create
classmethod
¶
Build adapters for every PSP available in the current environment.
Source code in components/payment_gateway/subcomponents/accounts/adapters/provider_account_adapter_registry.py
create_null
classmethod
¶
Null registry for tests.
Source code in components/payment_gateway/subcomponents/accounts/adapters/provider_account_adapter_registry.py
get_account_adapter ¶
Source code in components/payment_gateway/subcomponents/accounts/adapters/provider_account_adapter_registry.py
components.payment_gateway.subcomponents.accounts.adapters.revolut ¶
revolut_account_balance_adapter ¶
RevolutAccountBalanceAdapter ¶
Bases: AccountBalanceAdapter
Fetches account balances from Revolut.
Revolut exposes one account per currency for a given business account, so a
single get_accounts call returns the balances for all of them. A
dedicated RevolutBusinessApiClient is resolved (and cached) per
workspace, since each workspace maps to its own Revolut business account.