From: Gael Le Mignot Date: Wed, 10 May 2023 14:49:52 +0000 (+0200) Subject: Mostly working payment X-Git-Tag: 2.8.1-ae~38 X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=78c3f13e220978d75ad29b850ed9456039ef8f9d;p=teleforma.git Mostly working payment --- diff --git a/app/settings.py b/app/settings.py index 0603cf3a..21084fc7 100644 --- a/app/settings.py +++ b/app/settings.py @@ -348,14 +348,14 @@ REST_FRAMEWORK = { ] } -# Sherlock's online payment -PAYMENT_SHERLOCKS_PATH = '/opt/sherlocks2' -PAYMENT_PARAMETERS = {'merchant_id': {'Semestrielle': "040109417200053", - 'Estivale': "040109417200054", }, - 'merchant_country': 'fr', - 'currency_code': '978', - 'language': 'fr' +SHERLOKS_URL = "https://sherlocks-payment-webinit-simu.secure.lcl.fr/paymentInit" + +PAYMENT_PARAMETERS = { 'merchantId' : "002001000000003", + '_key': "002001000000003_KEY1", + 'keyVersion': '1', + 'currencyCode': '978', } +SHERLOKS_USE_TRANSACTION_ID = True LOGGING = { 'version': 1, diff --git a/teleforma/management/commands/teleforma-send-payment-emails.py b/teleforma/management/commands/teleforma-send-payment-emails.py index 4d24a0b4..bdb024b9 100644 --- a/teleforma/management/commands/teleforma-send-payment-emails.py +++ b/teleforma/management/commands/teleforma-send-payment-emails.py @@ -8,6 +8,7 @@ from django.utils import translation from teleforma.models import * import logging import datetime +from django.core.exceptions import ObjectDoesNotExist class Logger: """A logging object""" @@ -25,9 +26,12 @@ class Command(BaseCommand): help = "Send emails to students that must pay" language_code = 'fr_FR' + def add_arguments(self, parser): + parser.add_argument('log_file') + def email(self, student, kind, payment): site = Site.objects.get_current() - ctx_dict = {'site': site, 'organization': settings.TELEFORMA_ORGANIZATION, 'student': student, 'payment': payment, 'period': student.period } + ctx_dict = {'site': site, 'organization': settings.TELEFORMA_ORGANIZATION, 'student': student, 'payment': payment } subject_template = 'payment/email_%s_subject.txt' % kind message_template = 'payment/email_%s.txt' % kind subject = render_to_string(subject_template, ctx_dict) @@ -36,7 +40,7 @@ class Command(BaseCommand): send_mail(subject, message, settings.DEFAULT_FROM_EMAIL, [student.user.email], fail_silently=False) def handle(self, *args, **options): - log_file = args[-1] + log_file = options['log_file'] logger = Logger(log_file) logger.logger.info('########### Processing #############') @@ -44,18 +48,25 @@ class Command(BaseCommand): translation.activate(self.language_code) today = datetime.date.today() - + for student in students: - if student.is_subscribed and student.user.email: + try: + user = student.user + except ObjectDoesNotExist: + logger.logger.warning('missing user object for %s' % student.pk) + continue + + if student.is_subscribed and user.email and user.is_active : for payment in student.payments.filter(type = 'online').exclude(online_paid = True).filter(scheduled__lte = today): if payment.scheduled == today: self.email(student, 'initial', payment) - logger.logger.info('initial email send for %s on %d' % (student.user.username, payment.id)) + logger.logger.info('initial email send for %s on %d' % (user.username, payment.id)) else: delta = today - payment.scheduled delta = delta.days if delta % 7 == 0: self.email(student, 'reminder', payment) - logger.logger.info('reminder email send for %s on %d' % (student.user.username, payment.id)) + logger.logger.info('reminder email send for %s on %d' % (user.username, payment.id)) + logger.logger.info('############## Done #################') diff --git a/teleforma/templates/admin/base.html b/teleforma/templates/admin/base.html deleted file mode 100644 index 888f3fb4..00000000 --- a/teleforma/templates/admin/base.html +++ /dev/null @@ -1,217 +0,0 @@ -{% load admin_static %}{% load suit_tags %}{% load url from future %} - - - - {% block title %}{{ title }} | {{ 'ADMIN_NAME'|suit_conf }}{% endblock %} - - - - - {% block extrastyle %}{% endblock %} - {% if LANGUAGE_BIDI %}{% endif %} - - - - - {% if 'SHOW_REQUIRED_ASTERISK'|suit_conf %} - - {% endif %} - {% block extrahead %}{% endblock %} - {% block blockbots %} - {% endblock %} - - - -{% load i18n %} - - - - -
- - - {% block container %} -
- - {% block header %} - {% if not is_popup %} - - - {% endif %} - - {% endblock %} - - -
- - {% block content-center %} -
- - {% if not is_popup %} - {% block breadcrumbs %} - - {% endblock %} - {% endif %} - - {% block messages %} - {% if messages %} - - {% for message in messages %} -
- - {{ message }} -
- {% endfor %} - {% endif %} - {% endblock messages %} - - -
- {% block pretitle %}{% endblock %} - {% block content_title %}{% if title %} -

{{ title }}

- {% endif %}{% endblock %} - {% block content %} - {% block object-tools %}{% endblock %} - {{ content }} - {% endblock %} - {% block sidebar_content %} - {% block sidebar %}{% endblock %} - {% endblock %} -
- -
- {% endblock %} - - - {% block content-left %} - {% if not is_popup %} -
- {% block quick-search %} - {% with 'SEARCH_URL'|suit_conf as search_url %} - {% if search_url %} - - {% endif %} - {% endwith %} - {% endblock %} - - {% include 'suit/menu.html' %} - -
- {% endif %} - {% endblock %} - -
-
- {% endblock %} - - {% if not is_popup %} - -
- {% endif %} - -
- -{% block footer %} - {% if not is_popup %} - - {% endif %} -{% endblock %} - - - {% block extrajs %}{% endblock %} - - - diff --git a/teleforma/templates/payment/email_initial.txt b/teleforma/templates/payment/email_initial.txt index e733a715..fe026290 100644 --- a/teleforma/templates/payment/email_initial.txt +++ b/teleforma/templates/payment/email_initial.txt @@ -7,5 +7,7 @@ Suite à votre inscription à la formation avocat étranger, une échéance de Pour effectuer votre paiement, veuillez cliquer sur l’URL suivante : https://{{ site.domain }}{{ payment_url }} +Après avoir cliqué sur le lien, vous arrivez sur la page de notre site mentionnant vos échéances et il ne vous reste plus qu’à cliquer sur le logo de votre carte bancaire pour accéder au formulaire de paiement correspondant. + Cordialement, L’équipe du Pré-Barreau diff --git a/teleforma/templates/payment/payment_start.html b/teleforma/templates/payment/payment_start.html index a3dfd1b4..b5b794ae 100644 --- a/teleforma/templates/payment/payment_start.html +++ b/teleforma/templates/payment/payment_start.html @@ -8,8 +8,22 @@ {% payment_summary payment %} - {% autoescape off %} - {{ sherlock_info }} - {% endautoescape %} +
+
+ Vous utilisez le formulaire sécurisé standard SSL, afin de poursuivre le paiement merci de sélectionner une carte ci-dessous : +
+
+ + + +
+ +   + +   + +
+ {% endblock %} diff --git a/teleforma/templates/receipt/receipt_pdf.html b/teleforma/templates/receipt/receipt_pdf.html index aa2cfdd6..c35ffd1e 100644 --- a/teleforma/templates/receipt/receipt_pdf.html +++ b/teleforma/templates/receipt/receipt_pdf.html @@ -25,7 +25,7 @@