CCrypto VPN public website https://vpn.ccrypto.org/
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.
 
 
 
 
 
 

57 lines
1.6 KiB

  1. from django.utils.translation import ugettext_lazy as _
  2. class BackendBase:
  3. backend_id = None
  4. backend_verbose_name = ""
  5. backend_display_name = ""
  6. backend_enabled = False
  7. backend_has_recurring = False
  8. def __init__(self, settings):
  9. pass
  10. def new_payment(self, payment):
  11. """ Initialize a payment and returns an URL to redirect the user.
  12. Can return a HTML string that will be sent back to the user in a
  13. default template (like a form) or a HTTP response (like a redirect).
  14. """
  15. raise NotImplementedError()
  16. def callback(self, payment, request):
  17. """ Handle a callback """
  18. raise NotImplementedError()
  19. def callback_subscr(self, payment, request):
  20. """ Handle a callback (recurring payments) """
  21. raise NotImplementedError()
  22. def cancel_subscription(self, subscr):
  23. """ Cancel a subscription """
  24. raise NotImplementedError()
  25. def get_info(self):
  26. """ Returns some status (key, value) list """
  27. return ()
  28. def get_ext_url(self, payment):
  29. """ Returns URL to external payment view, or None """
  30. return None
  31. def get_subscr_ext_url(self, subscr):
  32. """ Returns URL to external payment view, or None """
  33. return None
  34. class ManualBackend(BackendBase):
  35. """ Manual backend used to store and display informations about a
  36. payment processed manually.
  37. More a placeholder than an actual payment beckend, everything raises
  38. NotImplementedError().
  39. """
  40. backend_id = 'manual'
  41. backend_verbose_name = _("Manual")