diff --git a/aleksis/apps/tezor/apps.py b/aleksis/apps/tezor/apps.py index a5af98e35bf1d586fd015df471427724cf82fe71..e2418d22ae90194be7a08dc54cf77f006d7dd065 100644 --- a/aleksis/apps/tezor/apps.py +++ b/aleksis/apps/tezor/apps.py @@ -49,4 +49,15 @@ class DefaultConfig(AppConfig): "endpoint": "https://api.paypal.com", }) + if prefs["payments__pledge_enabled"]: + variants["paypal"] = ("djp_sepa.PaymentPledgeProvider", { + }) + + + if prefs["payments__sdd_creditor_identifier"]: + variants["paypal"] = ("djp_sepa.DirectDebitProvider", { + "creditor": prefs["payments__sdd_creditor"], + "creditor_identifier": prefs["payments__sdd_creditor_identifier"], + }) + return variants diff --git a/aleksis/apps/tezor/preferences.py b/aleksis/apps/tezor/preferences.py index adf2b2925cd7dee7659c63a522c50335096482fa..9cf77979b91a0dd5809f0b961532537a4f965299 100644 --- a/aleksis/apps/tezor/preferences.py +++ b/aleksis/apps/tezor/preferences.py @@ -72,3 +72,36 @@ class PaypalCapture(BooleanPreference): verbose_name = _("PayPal - Use Authorize & Capture") default = False required = False + + +@site_preferences_registry.register +class EnablePledge(BooleanPreference): + """Payment pledge payment backend - enable or not.""" + + section = payments + name = "pledge_enabled" + verbose_name = _("Enabledp ledged payments") + default = False + required = False + + +@site_preferences_registry.register +class SDDCreditor(StringPreference): + """SEPA direct debit backend - creditor name.""" + + section = payments + name = "sdd_creditor" + verbose_name = _("SEPA Direct Debit - Creditor name") + default = "" + required = False + + +@site_preferences_registry.register +class SDDCreditorIdentifier(StringPreference): + """SEPA direct debit backend - creditor identifier.""" + + section = payments + name = "sdd_creditor_identifier" + verbose_name = _("SEPA Direct Debit - Creditor identifier") + default = "" + required = False diff --git a/pyproject.toml b/pyproject.toml index b57f3a3339f3dd319a39945c85c6f4e6a278d9e2..9010b7ca7bd84b933a18ba567f71e91a962c364a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -33,6 +33,7 @@ python = "^3.9" aleksis-core = "^2.7" django-payments = "^0.15.0" pycountry = "22.1.10" +django-payments-sepa = "^1.0.dev0" [tool.poetry.dev-dependencies] aleksis-builddeps = "*"