Skip to content

components.payment_gateway.public.exceptions

Classes

InconsistentWorkspaceKeysException

InconsistentWorkspaceKeysException(workspace_keys)

Bases: PaymentGatewayException

Exception raised when the workspace keys are inconsistent

Source code in components/payment_gateway/public/exceptions.py
def __init__(self, workspace_keys: list[str]):
    self.workspace_keys = workspace_keys
    super().__init__(f"Inconsistent workspace keys: {', '.join(workspace_keys)}")

Attributes

workspace_keys instance-attribute
workspace_keys = workspace_keys

PaymentGatewayException

Bases: Exception

Base class for all the Payment Gateway exceptions.

ProviderNotSupportedException

ProviderNotSupportedException(provider, msg=None)

Bases: PaymentGatewayException

Exception raised when a Payment Service Provider is not supported for a given operation.

Typically raised when the credentials are missing for the provider's API client, for example when a PSP can't be used in a given country, or when attempting an operation that is not supported by the provider.

Source code in components/payment_gateway/public/exceptions.py
def __init__(self, provider: PaymentServiceProvider, msg: str | None = None):
    self.provider = provider
    super().__init__(
        f"Provider {provider} is not supported for this operation"
        if msg is None
        else msg
    )

Attributes

provider instance-attribute
provider = provider

WorkspaceNotRegisteredException

WorkspaceNotRegisteredException(workspace_key)

Bases: PaymentGatewayException

Exception raised when a workspace is not registered.

Source code in components/payment_gateway/public/exceptions.py
def __init__(self, workspace_key: str):
    self.workspace_key = workspace_key
    super().__init__(f"Workspace {workspace_key} is not registered")

Attributes

workspace_key instance-attribute
workspace_key = workspace_key