pretix-stripe2/pretix_stripe2/__init__.py

34 lines
885 B
Python
Raw Permalink Normal View History

2020-09-04 17:56:10 +10:00
from django.apps import AppConfig
from django.utils.functional import cached_property
from django.utils.translation import gettext_lazy as _
2020-09-04 17:58:25 +10:00
__version__ = '1.0'
2020-09-04 17:56:10 +10:00
class StripeApp(AppConfig):
2020-09-04 17:58:25 +10:00
name = 'pretix_stripe2'
verbose_name = _("Stripe2")
2020-09-04 17:56:10 +10:00
class PretixPluginMeta:
2020-09-04 17:58:25 +10:00
name = _("Stripe2")
author = _("Lee Yingtong Li")
version = __version__
2020-09-04 17:56:10 +10:00
category = 'PAYMENT'
description = _("This plugin allows you to receive credit card payments " +
"via Stripe")
def ready(self):
from . import signals, tasks # NOQA
@cached_property
def compatibility_errors(self):
errs = []
try:
import stripe # NOQA
except ImportError:
errs.append("Python package 'stripe' is not installed.")
return errs
2020-09-04 17:58:25 +10:00
default_app_config = 'pretix_stripe2.StripeApp'