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.
Attributes¶
Classes¶
PadPaymentMandate
dataclass
¶
PaymentMandate
dataclass
¶
Public read-only view of a PaymentMandate (base — SEPA or PAD).
Attributes¶
PaymentMandateActions ¶
Actions for payment mandate operations.
Source code in components/payment_gateway/subcomponents/banking_documents/protected/business_logic/actions/payment_mandate_actions.py
Functions¶
create
classmethod
¶
create_null
classmethod
¶
find_sepa_payment_mandate_by_umr_and_creditor ¶
Find a SEPA payment mandate by its (umr, creditor) pair.
This pair is unique per SEPA definition.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
session
|
Session
|
Database session. |
required |
umr
|
str
|
Unique Mandate Reference. |
required |
creditor_legal_entity_id
|
LegalEntityId
|
ID of the creditor legal entity. |
required |
Returns:
| Type | Description |
|---|---|
SepaPaymentMandate | None
|
SepaPaymentMandate or None if no mandate matches. |
Source code in components/payment_gateway/subcomponents/banking_documents/protected/business_logic/actions/payment_mandate_actions.py
set_status ¶
Append a status log entry; no-op if current status already matches.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
session
|
Session
|
Database session. |
required |
payment_mandate_id
|
PaymentMandateId
|
ID of the payment mandate. |
required |
status
|
PaymentMandateStatus
|
Target status. |
required |
reason
|
str | None
|
Optional free-text comment. |
None
|
Raises:
| Type | Description |
|---|---|
PaymentMandateNotFoundException
|
If no mandate exists with the given ID. |
Source code in components/payment_gateway/subcomponents/banking_documents/protected/business_logic/actions/payment_mandate_actions.py
upsert_sepa_payment_mandate ¶
upsert_sepa_payment_mandate(
session,
/,
*,
unique_key,
debtor_financial_instrument_id,
creditor_legal_entity_id,
payment_type,
umr,
scheme,
valid_until=None,
consent_captured_at=None,
)
Create-or-update a SEPA payment mandate, keyed by (umr, creditor).
Capturing consent is one-way: once consent_captured_at is set on an
existing mandate it is immutable, and status stays ENABLED. The only
update permitted is granting consent on a previously PENDING mandate
(consent goes None -> not-None, status flips PENDING -> ENABLED).
Any other field divergence on update is silently ignored.
On create, status is ENABLED if consent_captured_at is set, else PENDING.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
session
|
Session
|
Database session. |
required |
unique_key
|
str
|
Namespaced unique identifier |
required |
debtor_financial_instrument_id
|
FinancialInstrumentId
|
ID of the financial instrument to debit from. |
required |
creditor_legal_entity_id
|
LegalEntityId
|
ID of the legal entity authorized to collect. |
required |
payment_type
|
PaymentMandatePaymentType
|
Recurring vs one-off payment authorization. |
required |
umr
|
str
|
Unique Mandate Reference (max 35 chars, Latin only). |
required |
scheme
|
SepaPaymentMandateScheme
|
SEPA scheme (CORE or B2B). |
required |
valid_until
|
datetime | None
|
Mandate validity end date. Defaults to
|
None
|
consent_captured_at
|
datetime | None
|
Timestamp of signature or explicit consent. |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
PaymentMandateId |
PaymentMandateId
|
ID of the created or updated mandate. |
Raises:
| Type | Description |
|---|---|
FinancialInstrumentNotFoundException
|
If the debtor FI does not exist (create only). |
FinancialInstrumentTerminatedException
|
If the debtor FI is terminated (create only). |
LegalEntityNotFoundException
|
If the creditor LE does not exist (create only). |
LegalEntityTerminatedException
|
If the creditor LE is terminated (create only). |
Source code in components/payment_gateway/subcomponents/banking_documents/protected/business_logic/actions/payment_mandate_actions.py
59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 | |
SepaMandateActions ¶
Sepa Mandate Actions
Functions¶
declare_sepa_mandate ¶
declare_sepa_mandate(
session,
/,
workspace_key,
external_id,
account_holder_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/actions/sepa_mandate_actions.py
update_sepa_mandate_status ¶
Update the status of a specific SEPA mandate.
Source code in components/payment_gateway/subcomponents/banking_documents/protected/business_logic/actions/sepa_mandate_actions.py
SepaMandateQueries ¶
Sepa Mandate Queries
Functions¶
get_sepa_mandate ¶
Get a SEPA mandate by ID.
Source code in components/payment_gateway/subcomponents/banking_documents/protected/business_logic/queries/sepa_mandate_queries.py
get_sepa_mandate_by_external_id ¶
Get a SEPA mandate by its external ID.
Source code in components/payment_gateway/subcomponents/banking_documents/protected/business_logic/queries/sepa_mandate_queries.py
SepaPaymentMandate
dataclass
¶
SepaPaymentMandate(
id,
unique_key,
payment_type,
consent_captured_at,
status,
status_history,
umr,
scheme,
valid_until,
)
Bases: PaymentMandate
Public read-only view of a SEPA payment mandate.