components.payment_gateway.public.accounts ¶
This module defines the public API for the accounts subcomponent.
Only business logic is exposed here. Basic entities and enums are exposed in separate modules to avoid loading the entire subcomponent with its models and dependencies when they are not needed.
Classes¶
AccountActions ¶
This class contains all the actions used to manage the lifecycle of an account.
Implements the following Nullable patterns: - Nullables: https://www.jamesshore.com/v2/projects/nullables/testing-without-mocks#nullables ⧉ - Parameterless instantiation: https://www.jamesshore.com/v2/projects/nullables/testing-without-mocks#instantiation ⧉
Source code in components/payment_gateway/subcomponents/accounts/protected/business_logic/actions/account_actions.py
Attributes¶
Functions¶
activate_account ¶
Activate an account.
Note
This operation is currently only supported for Adyen.
Source code in components/payment_gateway/subcomponents/accounts/protected/business_logic/actions/account_actions.py
create
classmethod
¶
Normal factory
Source code in components/payment_gateway/subcomponents/accounts/protected/business_logic/actions/account_actions.py
create_account ¶
Create an account for an account holder.
This will create a new account on the PSP workspace linked to the given account holder.
Note
This operation is currently only supported for Adyen.
Source code in components/payment_gateway/subcomponents/accounts/protected/business_logic/actions/account_actions.py
create_null
classmethod
¶
Null factory
Source code in components/payment_gateway/subcomponents/accounts/protected/business_logic/actions/account_actions.py
deactivate_account ¶
Deactivate an account.
Source code in components/payment_gateway/subcomponents/accounts/protected/business_logic/actions/account_actions.py
declare_account ¶
Declare an account for an account holder.
The account must exist in the PSP workspace.
Source code in components/payment_gateway/subcomponents/accounts/protected/business_logic/actions/account_actions.py
terminate_account ¶
Terminate an account.
The operation is idempotent, i.e. it has no effect on already terminated entities.
Accounts in terminal state cannot be modified or used anymore. Any
attempt to use or retrieve a terminated account will raise an
AccountTerminatedException.
Source code in components/payment_gateway/subcomponents/accounts/protected/business_logic/actions/account_actions.py
update_account ¶
Update the balance account description and reference.
New description/name for the account will be truncated to 300 characters. New optional reference for the account will be truncated to 150 characters.
Source code in components/payment_gateway/subcomponents/accounts/protected/business_logic/actions/account_actions.py
AccountHolderActions ¶
This class contains all the actions related to account holders.
Implements the following Nullable patterns: - Nullables: https://www.jamesshore.com/v2/projects/nullables/testing-without-mocks#nullables ⧉ - Parameterless instantiation: https://www.jamesshore.com/v2/projects/nullables/testing-without-mocks#instantiation ⧉
Source code in components/payment_gateway/subcomponents/accounts/protected/business_logic/actions/account_holder_actions.py
Attributes¶
adyen_account_holders_client
property
¶
Ensures the Adyen client is available when accessing it.
adyen_legal_entities_client
property
¶
Ensures the Adyen client is available when accessing it.
Functions¶
create
classmethod
¶
Normal factory
Source code in components/payment_gateway/subcomponents/accounts/protected/business_logic/actions/account_holder_actions.py
create_null
classmethod
¶
Null factory
Source code in components/payment_gateway/subcomponents/accounts/protected/business_logic/actions/account_holder_actions.py
declare_account_holder ¶
Declare an account holder.
The account holder must exist in the PSP workspace.
Source code in components/payment_gateway/subcomponents/accounts/protected/business_logic/actions/account_holder_actions.py
terminate_account_holder ¶
Terminate an account holder.
The operation is idempotent, i.e. it has no effect on already terminated entities.
Account holders in terminal state cannot be modified or used anymore.
Any attempt to use or retrieve a terminated account holder will raise an
AccountHolderTerminatedException.
Source code in components/payment_gateway/subcomponents/accounts/protected/business_logic/actions/account_holder_actions.py
update_account_holder_legal_name ¶
Update the legal name of an account holder.
This method updates the legal name of an account holder in both the database and the third party API.
Source code in components/payment_gateway/subcomponents/accounts/protected/business_logic/actions/account_holder_actions.py
AccountHolderNotFoundException ¶
Bases: PaymentAccountException
Exception raised when trying to use a non-existing Account Holder.
AccountHolderQueries ¶
This class contains all the queries related to account holders.
Functions¶
get_account_holder ¶
Get an account holder entity from its ID.
Source code in components/payment_gateway/subcomponents/accounts/protected/business_logic/queries/account_holder_queries.py
get_account_holder_id_by_external_id ¶
Get an account holder entity from its external ID.
Source code in components/payment_gateway/subcomponents/accounts/protected/business_logic/queries/account_holder_queries.py
AccountHolderTerminatedException ¶
Bases: PaymentAccountException
Exception raised when trying to use a terminated Account Holder.
AccountNotFoundException ¶
Bases: PaymentAccountException
Exception raised when trying to use a non-existing Account.
AccountQueries ¶
This class contains all the queries related to accounts.
Functions¶
get_account ¶
Get an account entity from its ID.
Source code in components/payment_gateway/subcomponents/accounts/protected/business_logic/queries/account_queries.py
get_account_id_by_external_id ¶
Get an account ID by its external ID.
Source code in components/payment_gateway/subcomponents/accounts/protected/business_logic/queries/account_queries.py
get_account_ids_for_account_holder ¶
Get all the account IDs for an account holder.
Source code in components/payment_gateway/subcomponents/accounts/protected/business_logic/queries/account_queries.py
get_accounts_for_account_holder ¶
Get all the accounts for an account holder.
Source code in components/payment_gateway/subcomponents/accounts/protected/business_logic/queries/account_queries.py
AccountTerminatedException ¶
Bases: PaymentAccountException
Exception raised when trying to use a terminated Account.
InvalidAccountStatusTransitionException ¶
Bases: PaymentAccountException, ValueError
Exception raised when attempting an invalid Account status transition.
PaymentAccountException ¶
Bases: PaymentGatewayException
Base class for all Account exceptions.
SepaBeneficiaryLogic ¶
This class is the public interface to the SEPA beneficiaries logic.
Functions¶
declare_sepa_beneficiary ¶
declare_sepa_beneficiary(
session,
/,
account_id,
external_id,
issued_at,
name,
iban,
status=SepaBeneficiaryStatus.enabled,
)
Declare a new SEPA beneficiary on the given account.
Source code in components/payment_gateway/subcomponents/accounts/protected/business_logic/sepa_beneficiaries.py
get_sepa_beneficiary ¶
Get a SEPA beneficiary entity from its ID.
Source code in components/payment_gateway/subcomponents/accounts/protected/business_logic/sepa_beneficiaries.py
get_sepa_beneficiary_by_external_id ¶
Find a SEPA beneficiary by its external ID.
Source code in components/payment_gateway/subcomponents/accounts/protected/business_logic/sepa_beneficiaries.py
set_sepa_beneficiary_status ¶
Update the status of the given SEPA beneficiary.