Models
components.payment_gateway.internal.models.base_model ¶
BaseModel ¶
Bases: BaseModel
Base class for all models in the Payment Gateway component.
get_metabase_history_question_number ¶
Returns the Metabase history question number for this model.
This ensures that model histories are available from all backends.
Source code in components/payment_gateway/internal/models/base_model.py
components.payment_gateway.internal.models.brokers ¶
webhook_log ¶
WebhookLogModelBroker ¶
Bases: BaseModelBroker
get_webhook_log
classmethod
¶
Source code in components/payment_gateway/internal/models/brokers/webhook_log.py
list_webhook_logs_by_external_id
classmethod
¶
Get webhook logs by transfer external ID.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
external_id
|
str
|
The Adyen transfer ID to search for |
required |
Returns:
| Type | Description |
|---|---|
list[WebhookLog]
|
list[WebhookLog]: List of webhook log records |
Source code in components/payment_gateway/internal/models/brokers/webhook_log.py
components.payment_gateway.internal.models.helpers ¶
components.payment_gateway.internal.models.provider_entity_mixin ¶
ProviderEntityMixin ¶
Mixin for models that need to track workspace and external provider identifiers. Provides workspace_key and external_id columns with a unique constraint.
components.payment_gateway.internal.models.webhook_log ¶
WebhookLog ¶
Bases: BaseModel
Used to log incoming webhooks from payment providers (Adyen, Revolut ...).
We expect both issuing and relayed authorization webhooks from Adyen:
- Issuing webhooks are used to notify us of events on the balance platform. See https://docs.adyen.com/issuing/webhook-types ⧉ for more information about the expected payloads.
- Relayed authorization webhooks use a different format that is currently undocumented; recording their payload there will help us understand how to implement this feature. See https://docs.adyen.com/issuing/authorisation/relayed-authorisation/ ⧉ for more information.
We expect transfer Revolut webhooks: - TransactionCreated: Notifies of new transactions - TransactionStateChanged: Notifies of transaction state updates See https://developer.revolut.com/docs/business/webhooks-v-2 ⧉
__table_args__
class-attribute
instance-attribute
¶
account_external_id ¶
The Adyen account ID for balance platform transfer events.
Source code in components/payment_gateway/internal/models/webhook_log.py
amount ¶
The Adyen amount for balance platform transfer events.
Source code in components/payment_gateway/internal/models/webhook_log.py
events ¶
Return all events of a specific webhook log.
Source code in components/payment_gateway/internal/models/webhook_log.py
is_adyen_transfer ¶
is_revolut ¶
payload
class-attribute
instance-attribute
¶
Raw JSON payload of the webhook.
payload_type ¶
payment_date ¶
The booking date of the received event for balance platform transfer events.
Source code in components/payment_gateway/internal/models/webhook_log.py
payment_instrument_external_id ¶
The Adyen payment instrument ID for balance platform transfer events.
Source code in components/payment_gateway/internal/models/webhook_log.py
revolut_event_type ¶
sequence_number ¶
Source code in components/payment_gateway/internal/models/webhook_log.py
source
class-attribute
instance-attribute
¶
The source of the webhook, usually the name of the controller receiving the webhook.
status
class-attribute
instance-attribute
¶
Whether the webhook was successfully processed or not at the controller level.
transaction_rules ¶
Return all transaction rules of a specific webhook log
Source code in components/payment_gateway/internal/models/webhook_log.py
transfer_external_id ¶
Source code in components/payment_gateway/internal/models/webhook_log.py
transfer_type ¶
Transfer type of this Adyen webhook between internalTransfer, bankTransfer and payment