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 ¶
ExtentedWebhookLogQueryResult
module-attribute
¶
ExtentedWebhookLogQueryResult = tuple[
WebhookLog,
UUID | None,
UUID | None,
UUID | None,
UUID | None,
UUID | None,
WebhookLogTransferStatus,
]
WebhookLogModelBroker ¶
Bases: BaseModelBroker
get_webhook_log
classmethod
¶
Source code in components/payment_gateway/internal/models/brokers/webhook_log.py
list_extended_webhook_logs_in_period
classmethod
¶
list_extended_webhook_logs_in_period(
session,
/,
*,
start_date,
end_date,
account_id=None,
card_holder_id=None,
status_filter=None,
)
Return a list of webhook logs with extended information about the transfer.
Args: - start_date: Start date to fetch event from (inclusive) - end_date: End date to fetch event from (inclusive) - account_id: Filter by account id - card_holder_id: Filter by card holder id - status_filter: Filter transfers based on their processing status. Can be: - WebhookLogTransferStatus.received: Webhook log status is not "ok" - WebhookLogTransferStatus.interrupted: Webhook log status is "ok" but internal id is not found - WebhookLogTransferStatus.processed: Means transfer was processed successfully
- Tuple of
- WebhookLog model
- Payment id
- Bank transfer id
- Account transfer id
- Account id
- Card holder id
- Transfer status
Source code in components/payment_gateway/internal/models/brokers/webhook_log.py
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 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 | |
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.webhook_log ¶
WebhookLog ¶
Bases: BaseModel
Used to log incoming webhooks from Adyen.
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.
__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_transfer ¶
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
sequence_number ¶
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 ¶
The Adyen transfer ID for balance platform transfer events.
Source code in components/payment_gateway/internal/models/webhook_log.py
transfer_type ¶
Transfer type of this Adyen webhook between internalTransfer, bankTransfer and payment