Skip to content

Exceptions

PaymentException

Bases: PaymentGatewayException

Base class for all Payment exceptions.

Note

Naming breaks the usual naming convention Payment[Subcomponent]Exception to avoid repetition of the word "Payment" in the exception name.

PaymentRequestDuplicateAtProvider

PaymentRequestDuplicateAtProvider(*, reference, provider)

Bases: PaymentException

The provider reports the request as a duplicate of an earlier submission (e.g. Revolut error 3020). Callers must reconcile from the existing PaymentRequest rather than treat this as a submission failure.

Source code in components/payment_gateway/subcomponents/payments/protected/exceptions.py
def __init__(self, *, reference: str, provider: str) -> None:
    super().__init__(
        f"{provider} reported reference {reference!r} as a duplicate request"
    )
    self.reference = reference
    self.provider = provider

provider instance-attribute

provider = provider

reference instance-attribute

reference = reference

PaymentRequestNotFoundException

Bases: PaymentException

Exception raised when trying to use fetch non-existing PaymentRequest object.