# Path: ccvpn/common.py
# def get_price():
#     return config.MONTHLY_PRICE_EUR
# 
# Path: payments/backends/base.py
# class BackendBase:
#     backend_id = None
#     backend_verbose_name = ""
#     backend_display_name = ""
#     backend_enabled = False
#     backend_has_recurring = False
# 
#     def __init__(self, settings):
#         pass
# 
#     def new_payment(self, payment):
#         """ Initialize a payment and returns an URL to redirect the user.
#         Can return a HTML string that will be sent back to the user in a
#         default template (like a form) or a HTTP response (like a redirect).
#         """
#         raise NotImplementedError()
# 
#     def callback(self, payment, request):
#         """ Handle a callback """
#         raise NotImplementedError()
# 
#     def callback_subscr(self, payment, request):
#         """ Handle a callback (recurring payments) """
#         raise NotImplementedError()
# 
#     def cancel_subscription(self, subscr):
#         """ Cancel a subscription """
#         raise NotImplementedError()
# 
#     def get_info(self):
#         """ Returns some status (key, value) list """
#         return ()
# 
#     def get_ext_url(self, payment):
#         """ Returns URL to external payment view, or None """
#         return None
# 
#     def get_subscr_ext_url(self, subscr):
#         """ Returns URL to external payment view, or None """
#         return None


from django.db import models
from django.conf import settings
from django.utils.translation import ugettext_lazy as _
from jsonfield import JSONField
from datetime import timedelta
from ccvpn.common import get_price
from .backends import BackendBase
    ('error', _("Payment processing failed")),
)

# A Subscription is created with status='new'. When getting back from PayPal,
# it may get upgraded to 'unconfirmed'. It will be set 'active' with the first
# confirmed payment.
# 'unconfirmed' exists to prevent creation of a second Subscription while
# waiting for the first one to be confirmed.
SUBSCR_STATUS_CHOICES = (
    ('new', _("Created")),
    ('unconfirmed', _("Waiting for payment")),
    ('active', _("Active")),
    ('cancelled', _("Cancelled")),
    ('error', _("Error")),
)

SUBSCR_PERIOD_CHOICES = (
    ('3m', _("Every 3 months")),
    ('6m', _("Every 6 months")),
    ('12m', _("Every year")),
)

# All known backends (classes)
BACKENDS = {}
BACKEND_CHOICES = []

# All enabled backends (configured instances)
ACTIVE_BACKENDS = {}
ACTIVE_BACKEND_CHOICES = []


# Path: ccvpn/common.py
# def get_price():
#     return config.MONTHLY_PRICE_EUR
# 
# Path: payments/backends/base.py
# class BackendBase:
#     backend_id = None
#     backend_verbose_name = ""
#     backend_display_name = ""
#     backend_enabled = False
#     backend_has_recurring = False
# 
#     def __init__(self, settings):
#         pass
# 
#     def new_payment(self, payment):
#         """ Initialize a payment and returns an URL to redirect the user.
#         Can return a HTML string that will be sent back to the user in a
#         default template (like a form) or a HTTP response (like a redirect).
#         """
#         raise NotImplementedError()
# 
#     def callback(self, payment, request):
#         """ Handle a callback """
#         raise NotImplementedError()
# 
#     def callback_subscr(self, payment, request):
#         """ Handle a callback (recurring payments) """
#         raise NotImplementedError()
# 
#     def cancel_subscription(self, subscr):
#         """ Cancel a subscription """
#         raise NotImplementedError()
# 
#     def get_info(self):
#         """ Returns some status (key, value) list """
#         return ()
# 
#     def get_ext_url(self, payment):
#         """ Returns URL to external payment view, or None """
#         return None
# 
#     def get_subscr_ext_url(self, subscr):
#         """ Returns URL to external payment view, or None """
#         return None


# Path: payments/models.py
from django.db import models
from django.conf import settings
from django.utils.translation import ugettext_lazy as _
from jsonfield import JSONField
from datetime import timedelta
from ccvpn.common import get_price
from .backends import BackendBase

    ('error', _("Payment processing failed")),
)

# A Subscription is created with status='new'. When getting back from PayPal,
# it may get upgraded to 'unconfirmed'. It will be set 'active' with the first
# confirmed payment.
# 'unconfirmed' exists to prevent creation of a second Subscription while
# waiting for the first one to be confirmed.
SUBSCR_STATUS_CHOICES = (
    ('new', _("Created")),
    ('unconfirmed', _("Waiting for payment")),
    ('active', _("Active")),
    ('cancelled', _("Cancelled")),
    ('error', _("Error")),
)

SUBSCR_PERIOD_CHOICES = (
    ('3m', _("Every 3 months")),
    ('6m', _("Every 6 months")),
    ('12m', _("Every year")),
)

# All known backends (classes)
BACKENDS = {}
BACKEND_CHOICES = []

# All enabled backends (configured instances)
ACTIVE_BACKENDS = {}
ACTIVE_BACKEND_CHOICES = []


for cls in BackendBase.__subclasses__():