From: Gael Le Mignot Date: Thu, 3 Jun 2021 09:56:01 +0000 (+0200) Subject: Added basic sherlocks support + sherlocks test environment config X-Git-Tag: 2.1~66^2^2~45 X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=3055a580ce2b4e4f0324a9243f833d2c1f76f281;p=teleforma.git Added basic sherlocks support + sherlocks test environment config --- diff --git a/Dockerfile b/Dockerfile index a03d9867..6cfcccf4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -53,6 +53,9 @@ COPY lib /srv/lib COPY bin/build/local/setup_lib.sh /srv RUN /srv/setup_lib.sh +COPY sherlocks /srv/sherlocks +RUN ln -s /srv/app/sherlocks-param /srv/sherlocks/param + WORKDIR /srv/src/teleforma COPY setup.py /srv/src/teleforma COPY teleforma /srv/src/teleforma diff --git a/app/settings.py b/app/settings.py index c7324993..86987364 100644 --- a/app/settings.py +++ b/app/settings.py @@ -347,6 +347,18 @@ POSTMAN_SHOW_USER_AS = show_user_as ALLOWED_HOSTS = ['localhost', 'crfpa.dockdev.pilotsystems.net'] +# Sherlock's online payment +PAYMENT_SHERLOCKS_PATH='/srv/sherlocks' + +PAYMENT_PARAMETERS = { 'merchant_id' : { 'Semestrielle': "014295303911111", + 'Estivale': "014295303911111", + 'Pré-estivale': "014295303911111", }, + 'merchant_country': 'fr', + 'currency_code': '978', + 'language': 'fr' +} + + if DEBUG_TOOLBAR: def show_toolbar(request): return True diff --git a/app/sherlocks-param/certif.fr.014295303911111.php b/app/sherlocks-param/certif.fr.014295303911111.php new file mode 100644 index 00000000..34f3ead4 --- /dev/null +++ b/app/sherlocks-param/certif.fr.014295303911111.php @@ -0,0 +1,54 @@ + diff --git a/app/sherlocks-param/parmcom.014295303911111 b/app/sherlocks-param/parmcom.014295303911111 new file mode 100644 index 00000000..f98aac50 --- /dev/null +++ b/app/sherlocks-param/parmcom.014295303911111 @@ -0,0 +1,36 @@ +############################################################################### +# +# Fichier des paramètres du commercant +# +# Remarque : Ce fichier paramètre est sous la responsabilité du +# commercant +# +############################################################################### + + +# URL de retour automatique de la reponse du paiement + +#AUTO_RESPONSE_URL!http://! + +# URL de retour suite a paiement refuse + +CANCEL_URL!http://! + +# URL de retour suite a paiement accepte + +RETURN_URL!http://! + +# Code devise ( 978=EURO ) + +CURRENCY!978! + +# Logo du commercant + +LOGO2!commercant.gif! + +# Liste des moyens de paiement acceptés + +PAYMENT_MEANS!CB,2,VISA,2,MASTERCARD,2! + + +# END OF FILE diff --git a/app/sherlocks-param/parmcom.sherlocks b/app/sherlocks-param/parmcom.sherlocks new file mode 100644 index 00000000..dbbc8581 --- /dev/null +++ b/app/sherlocks-param/parmcom.sherlocks @@ -0,0 +1,65 @@ +############################################################################### +# +# Fichier des paramètres sherlocks credit lyonnais +# +# Remarque : Ce fichier paramètre est sous la responsabilité du +# Credit Lyonnais +# +############################################################################### + + +# Logo + +ADVERT!banniere_lcl.png! + +# couleur du fond d'ecran (blanc) + +BGCOLOR!ffffff! + +# Mode d'affichage des blocs de paiment + +BLOCK_ALIGN!center! + +# Ordre d'affichage des blocs de paiement + +BLOCK_ORDER!1,2,3,4,5,6,7,8! + +# Mode de securite + +CONDITION!SSL! + +# Liste des cartes acceptées par le commercant + +CARD_LIST!CB,VISA,MASTERCARD! + +# flag d'edition des libelles des blocs de paiement + +HEADER_FLAG!yes! + +# Code langage de l'acheteur (fr=francais) + +LANGUAGE!fr! + +# Logo Crédit Lyonnais + +LOGO!sherlocks3f.gif! + +# Code pays du commercant + +MERCHANT_COUNTRY!fr! + +# Code langage du commercant + +MERCHANT_LANGUAGE!fr! + +# Passage en une seule frame securisée au moment du paiement + +TARGET!_top! + +# Couleur du text (noir) + +TEXTCOLOR!000000! + + +# END OF FILE + diff --git a/app/sherlocks-param/pathfile.014295303911111 b/app/sherlocks-param/pathfile.014295303911111 new file mode 100644 index 00000000..e28ea4b2 --- /dev/null +++ b/app/sherlocks-param/pathfile.014295303911111 @@ -0,0 +1,46 @@ +######################################################################### +# +# Pathfile +# +# Liste des fichiers parametres utilises par le module de paiement +# +######################################################################### +# +# +#------------------------------------------------------------------------- +# Activation (YES) / Désactivation (NO) du mode DEBUG +#------------------------------------------------------------------------- +# +DEBUG!NO! +# +# ------------------------------------------------------------------------ +# Chemin vers le répertoire des logos depuis le web alias +# Exemple pour le répertoire www.merchant.com/sherlocks/payment/logo/ +# indiquer: +# ------------------------------------------------------------------------ +# +D_LOGO!/static/payment/logo/! +# +# -------------------------------------------------------------------------- +# Fichiers paramètres liés a l'api sherlocks paiement +# -------------------------------------------------------------------------- +# +# fichier des paramètres sherlocks +# +F_DEFAULT!/srv/sherlocks/param/parmcom.sherlocks! +# +# fichier paramètre commercant +# +F_PARAM!/srv/sherlocks/param/parmcom! +# +# certificat du commercant +# +F_CERTIFICATE!/srv/sherlocks/param/certif! +# +# type du certificat +# +F_CTYPE!php! +# +# -------------------------------------------------------------------------- +# end of file +# -------------------------------------------------------------------------- diff --git a/sherlocks/Version.txt b/sherlocks/Version.txt new file mode 100644 index 00000000..a88e35c7 --- /dev/null +++ b/sherlocks/Version.txt @@ -0,0 +1,7 @@ +api sherlocks_617_PLUGIN_linux64-2.6.18.tar créée le 03/02/16 à 18:53:49 + +type d'api = PLUGIN +offre = CL +OS = linux64 2.6.18 +version = p617 +processeur = x86_64 diff --git a/sherlocks/bin/README.txt b/sherlocks/bin/README.txt new file mode 100644 index 00000000..a17d751e --- /dev/null +++ b/sherlocks/bin/README.txt @@ -0,0 +1,3 @@ +La solution Plug-In est fournie dans 2 versions : +- La version glibc-2.5-42 qui a pour pre-requis l'installation de glibc >= 2.5 sur la machine +- La version static qui est independante de la librairie glibc diff --git a/sherlocks/bin/glibc-2.5-42/request b/sherlocks/bin/glibc-2.5-42/request new file mode 100755 index 00000000..74af8d8e Binary files /dev/null and b/sherlocks/bin/glibc-2.5-42/request differ diff --git a/sherlocks/bin/glibc-2.5-42/response b/sherlocks/bin/glibc-2.5-42/response new file mode 100755 index 00000000..e8ec9555 Binary files /dev/null and b/sherlocks/bin/glibc-2.5-42/response differ diff --git a/sherlocks/bin/static/request b/sherlocks/bin/static/request new file mode 100755 index 00000000..375e4284 Binary files /dev/null and b/sherlocks/bin/static/request differ diff --git a/sherlocks/bin/static/response b/sherlocks/bin/static/response new file mode 100755 index 00000000..19ec308a Binary files /dev/null and b/sherlocks/bin/static/response differ diff --git a/sherlocks/logo/CB.gif b/sherlocks/logo/CB.gif new file mode 100644 index 00000000..cbbd626d Binary files /dev/null and b/sherlocks/logo/CB.gif differ diff --git a/sherlocks/logo/CLEF.gif b/sherlocks/logo/CLEF.gif new file mode 100644 index 00000000..8b791b61 Binary files /dev/null and b/sherlocks/logo/CLEF.gif differ diff --git a/sherlocks/logo/INTERVAL.gif b/sherlocks/logo/INTERVAL.gif new file mode 100644 index 00000000..d034e015 Binary files /dev/null and b/sherlocks/logo/INTERVAL.gif differ diff --git a/sherlocks/logo/MASTERCARD.gif b/sherlocks/logo/MASTERCARD.gif new file mode 100644 index 00000000..9dc0ccfd Binary files /dev/null and b/sherlocks/logo/MASTERCARD.gif differ diff --git a/sherlocks/logo/PAYLIB.gif b/sherlocks/logo/PAYLIB.gif new file mode 100644 index 00000000..33ceebb6 Binary files /dev/null and b/sherlocks/logo/PAYLIB.gif differ diff --git a/sherlocks/logo/VISA.gif b/sherlocks/logo/VISA.gif new file mode 100644 index 00000000..cd93a68f Binary files /dev/null and b/sherlocks/logo/VISA.gif differ diff --git a/teleforma/management/commands/teleforma-send-payment-emails.py b/teleforma/management/commands/teleforma-send-payment-emails.py index 50e21fa8..5f24d826 100644 --- a/teleforma/management/commands/teleforma-send-payment-emails.py +++ b/teleforma/management/commands/teleforma-send-payment-emails.py @@ -25,6 +25,10 @@ class Command(BaseCommand): help = "Send emails to students that must pay" language_code = 'fr_FR' + def add_arguments(self, parser): + parser.add_argument('period_name') + 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 } @@ -36,8 +40,8 @@ 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] - period_name = args[-2] + log_file = options['log_file'] + period_name = options['period_name'] logger = Logger(log_file) logger.logger.info('########### Processing #############')