Skip to content

components.payment_gateway.public.banking_documents

This module defines the public API for the banking documents subcomponent.

Only business logic classes are 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

SepaMandateLogic

SepaMandateLogic()

This class is the public interface to the SEPA mandate logic.

Source code in components/payment_gateway/subcomponents/banking_documents/protected/business_logic/sepa_mandate_logic.py
def __init__(self) -> None:
    self.queries = SepaMandateQueries()
    self.actions = SepaMandateActions()

Attributes

actions instance-attribute
actions = SepaMandateActions()
queries instance-attribute
queries = SepaMandateQueries()

Functions

declare_sepa_mandate
declare_sepa_mandate(
    session,
    /,
    account_holder_id,
    provider,
    external_id,
    sepa_creditor_identifier,
    debtor_name,
    debtor_iban,
    debtor_country,
    unique_mandate_reference,
    issued_at,
    status,
)

Declare a SEPA mandate.

Source code in components/payment_gateway/subcomponents/banking_documents/protected/business_logic/sepa_mandate_logic.py
@obs.api_call()
def declare_sepa_mandate(
    self,
    session: Session,
    /,
    account_holder_id: AccountHolderId,
    provider: PaymentServiceProvider,
    external_id: str,
    sepa_creditor_identifier: str,
    debtor_name: str,
    debtor_iban: str,
    debtor_country: str,
    unique_mandate_reference: str,
    issued_at: datetime,
    status: SepaMandateStatus,
) -> SepaMandateId:
    """
    Declare a SEPA mandate.
    """
    return self.actions.declare_sepa_mandate(
        session,
        account_holder_id=account_holder_id,
        provider=provider,
        external_id=external_id,
        sepa_creditor_identifier=sepa_creditor_identifier,
        debtor_name=debtor_name,
        debtor_iban=debtor_iban,
        debtor_country=debtor_country,
        unique_mandate_reference=unique_mandate_reference,
        issued_at=issued_at,
        status=status,
    )
get_sepa_mandate
get_sepa_mandate(session, /, id)

Get a SEPA mandate by ID.

Source code in components/payment_gateway/subcomponents/banking_documents/protected/business_logic/sepa_mandate_logic.py
@obs.api_call()
def get_sepa_mandate(
    self,
    session: Session,
    /,
    id: SepaMandateId,
) -> SepaMandate:
    """
    Get a SEPA mandate by ID.
    """
    return self.queries.get_sepa_mandate(
        session,
        id=id,
    )
get_sepa_mandate_by_external_id
get_sepa_mandate_by_external_id(
    session, /, provider, external_id
)

Get a SEPA mandate by its external ID.

Source code in components/payment_gateway/subcomponents/banking_documents/protected/business_logic/sepa_mandate_logic.py
@obs.api_call()
def get_sepa_mandate_by_external_id(
    self,
    session: Session,
    /,
    provider: PaymentServiceProvider,
    external_id: str,
) -> SepaMandate:
    """
    Get a SEPA mandate by its external ID.
    """
    return self.queries.get_sepa_mandate_by_external_id(
        session,
        provider=provider,
        external_id=external_id,
    )
update_sepa_mandate_status
update_sepa_mandate_status(
    session, /, sepa_mandate_id, status
)

Update the status of a specific SEPA mandate.

Source code in components/payment_gateway/subcomponents/banking_documents/protected/business_logic/sepa_mandate_logic.py
@obs.api_call()
def update_sepa_mandate_status(
    self,
    session: Session,
    /,
    sepa_mandate_id: SepaMandateId,
    status: SepaMandateStatus,
) -> None:
    """
    Update the status of a specific SEPA mandate.
    """
    self.actions.update_sepa_mandate_status(
        session,
        sepa_mandate_id=sepa_mandate_id,
        status=status,
    )