Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

exceptions.py 949B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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
  12. specifying enough payment sources to cover the entire order
  13. total.
  14. Eg. When selecting an allocation off a giftcard but not specifying
  15. a bankcard to take the remainder from.
  16. """
  17. pass
  18. class RedirectRequired(PaymentError):
  19. """
  20. Exception to be used when payment processsing requires a redirect
  21. """
  22. def __init__(self, url):
  23. self.url = url
  24. class UnableToTakePayment(PaymentError):
  25. """
  26. Exception to be used for ANTICIPATED payment errors (eg card number wrong, expiry date
  27. has passed). The message passed here will be shown to the end user.
  28. """
  29. pass