You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

exceptions.py 931B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. class PaymentError(Exception):
  2. pass
  3. class TransactionDeclined(PaymentError):
  4. pass
  5. class GatewayError(PaymentError):
  6. pass
  7. class InvalidGatewayRequestError(PaymentError):
  8. pass
  9. class InsufficientPaymentSources(PaymentError):
  10. """
  11. Exception for when a user attempts to checkout without specifying enough
  12. payment sources to cover the entire order total.
  13. Eg. When selecting an allocation off a giftcard but not specifying a
  14. bankcard to take the remainder from.
  15. """
  16. pass
  17. class RedirectRequired(PaymentError):
  18. """
  19. Exception to be used when payment processsing requires a redirect
  20. """
  21. def __init__(self, url):
  22. self.url = url
  23. class UnableToTakePayment(PaymentError):
  24. """
  25. Exception to be used for ANTICIPATED payment errors (eg card number wrong,
  26. expiry date has passed). The message passed here will be shown to the end
  27. user.
  28. """
  29. pass