1
0
mirror of https://gitlab.com/animath/si/plateforme.git synced 2025-06-21 10:38:25 +02:00

Make Sympa + payment support optional

Signed-off-by: Emmy D'Anello <emmy.danello@animath.fr>
This commit is contained in:
Emmy D'Anello
2024-06-07 16:35:08 +02:00
parent 2a775cedc1
commit c12972b718
10 changed files with 56 additions and 25 deletions

View File

@ -3,6 +3,7 @@
import json
from django.conf import settings
from django.core.management import BaseCommand
from ...models import Payment
@ -15,6 +16,9 @@ class Command(BaseCommand):
help = "Vérifie si les paiements Hello Asso initiés sont validés ou non. Si oui, valide les inscriptions."
def handle(self, *args, **options):
if not settings.PAYMENT_MANAGEMENT:
return
for payment in Payment.objects.exclude(valid=True).filter(checkout_intent_id__isnull=False).all():
checkout_intent = payment.get_checkout_intent()
if checkout_intent is not None and 'order' in checkout_intent:

View File

@ -1,6 +1,7 @@
# Copyright (C) 2024 by Animath
# SPDX-License-Identifier: GPL-3.0-or-later
from django.conf import settings
from django.core.management import BaseCommand
from ...models import Payment
@ -13,5 +14,8 @@ class Command(BaseCommand):
help = "Envoie un mail de rappel à toustes les participant⋅es qui n'ont pas encore payé ou déclaré de paiement."
def handle(self, *args, **options):
if not settings.PAYMENT_MANAGEMENT:
return
for payment in Payment.objects.filter(valid=False).filter(registrations__team__participation__valid=True).all():
payment.send_remind_mail()