]> git.parisson.com Git - teleforma.git/commitdiff
Added basic sherlocks support + sherlocks test environment config
authorGael Le Mignot <gael@pilotsystems.net>
Thu, 3 Jun 2021 09:56:01 +0000 (11:56 +0200)
committerGael Le Mignot <gael@pilotsystems.net>
Thu, 3 Jun 2021 09:56:01 +0000 (11:56 +0200)
19 files changed:
Dockerfile
app/settings.py
app/sherlocks-param/certif.fr.014295303911111.php [new file with mode: 0644]
app/sherlocks-param/parmcom.014295303911111 [new file with mode: 0644]
app/sherlocks-param/parmcom.sherlocks [new file with mode: 0644]
app/sherlocks-param/pathfile.014295303911111 [new file with mode: 0644]
sherlocks/Version.txt [new file with mode: 0644]
sherlocks/bin/README.txt [new file with mode: 0644]
sherlocks/bin/glibc-2.5-42/request [new file with mode: 0755]
sherlocks/bin/glibc-2.5-42/response [new file with mode: 0755]
sherlocks/bin/static/request [new file with mode: 0755]
sherlocks/bin/static/response [new file with mode: 0755]
sherlocks/logo/CB.gif [new file with mode: 0644]
sherlocks/logo/CLEF.gif [new file with mode: 0644]
sherlocks/logo/INTERVAL.gif [new file with mode: 0644]
sherlocks/logo/MASTERCARD.gif [new file with mode: 0644]
sherlocks/logo/PAYLIB.gif [new file with mode: 0644]
sherlocks/logo/VISA.gif [new file with mode: 0644]
teleforma/management/commands/teleforma-send-payment-emails.py

index a03d986726a2eb41662d9425d89bbea6288d329d..6cfcccf428ac5a090b6e5f21ee049e3fb334011b 100644 (file)
@@ -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
index c732499304a334bf1e4a087c415ff91c2fca0337..869873647a2e431472a7227a53ef79e3dbd37d7a 100644 (file)
@@ -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 (file)
index 0000000..34f3ead
--- /dev/null
@@ -0,0 +1,54 @@
+<?php
+/*__DEBUT__
+merchant_id!014295303911111!
+merchant_country!fr!
+certificate_expired!20130607!
+certificate_version!1.0!
+certificate_type!php!
+certificate_data!
+4JdQeLMUTnmwhhozYUrareXsbtGirttNdOFgL7ThURBODEZZ8x95TJO4nGq7gdmVVe
+Wa88K8nzwNVQTsYk93MgwFoq1iGCGrQgQ7BpNpO1NyNYX71YK3YcJpjKeqn6pXlmKf
+MBQzPruglwR9Imbon0PwKhob3OVQtWaRaLcD8BGhcTc79yVBntDufANpJA1jSoly2H
+ep4yLkzLdunBi47QryvVccaTr0ZBer58fvKTsAM6AzhwU9zQvGLvt2TnEKaj0SPL3L
+gUGvn41tyuGZARbm3UY7VHJWNAl0ATYJIG5FmmKUyWDMjN8i6rIgCwDKioK9DAuwYK
+IGAmkPr2lnVqLQbHK9DPPdrQ8QzaHiVXQb6TNicJMTq34UYBrOv9yjaKIhXZ8zLCym
+lfve2fiQOxcafrrr0MSKmMiPK2ZXzOJOWmn3yymZrBMqxccYX3Qlo0YxpaGbDhp6LU
+NMxAMxMNtfVsnel2xCQBOxYM2RlLtqZsbQTdqcHqgAaTDnsULHH8sBR37p6J52Bubw
+Q7PJrYwiHaYstbT88z4LT2LNzSrRfyIyOqCrp14HRybD6pV5CuPUPwUFWwMer62bN5
+7j3wMSLXzr8LGj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093EEB7BD21519DD89924B89396CDCD686A
+EE09413B7882469133DBB2E3C25D4D2B21E2615AA8BE5916B1eFcB1ZxNnOK4rRiC
+YhZYW3QiL6OW9eXqQr1zR6dLlJOiMDbG6OGmKSYrbRLjNxgYF6O0LOphKqjcTtEjC4
+qRYApJkYmWXLLANZn46w0I65L63PlBVrpYPSvFAu25aUMaSwcELNUKcpgFq5tsI1wG
+112316D6A89849A53060B85DFE2F67A52A3DDDB0E9B714251C7AF5E111A7EC556D
+3703B1BA1B7287AFEEC01A25445F9C1C80751021A47897D031eFcB1ZxNnOK4rRiC
+YhZYW3QiL6OW9eXqQr1zR6dLlJOiMDbG6OGmKSYrbRLjNxgYF6O0LOphKqjcTtEjC4
+qRYApJkYmWXLLANZn46w0I65L63PlBVrpYPSvFAu25aUMaSwcELNUKcpgFq5tsI1wG
+1129F1BB98BD51CA9732E36D3338E1A093EEB7BD21519DD89924B89396CDCD686A
+EE09413B7882469133DBB2E3C25D4D2B21E2615AA8BE5916B1eFcB1ZxNnOK4rRiC
+YhZYW3QiL6OW9eXqQr1zR6dLlJOiMDbG6OGmKSYrbRLjNxgYF6O0LOphKqjcTtEjC4
+qRYApJkYmWXLLANZn46w0I65L63PlBVrpYPSvFAu25aUMaSwcELNUKcpgFq5tsI1wG
+1121B981F04A3690866EFFD636ECC013EC84FFFA3F780E00A2F082F4B7936DF67E
+F1B7FFA2278DCE7BB0235F504E710BA7157E7881E729AEA9E1eFcB1ZxNnOK4rRiC
+YhZYW3QiL6OW9eXqQr1zR6dLlJOiMDbG6OGmKSYrbRLjNxgYF6O0LOphKqjcTtEjC4
+qRYApJkYmWXLLANZn46w0I65L63PlBVrpYPSvFAu25aUMaSwcELNUKcpgFq5tsI1wG
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+M_SHERLOCKS_DEMO,19/10/2006,V4,SHERLOCKS,DEMO+++++++++++++++++++++
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++END
+__FIN__*/
+php>
diff --git a/app/sherlocks-param/parmcom.014295303911111 b/app/sherlocks-param/parmcom.014295303911111
new file mode 100644 (file)
index 0000000..f98aac5
--- /dev/null
@@ -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 (file)
index 0000000..dbbc858
--- /dev/null
@@ -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 (file)
index 0000000..e28ea4b
--- /dev/null
@@ -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 (file)
index 0000000..a88e35c
--- /dev/null
@@ -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 (file)
index 0000000..a17d751
--- /dev/null
@@ -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 (executable)
index 0000000..74af8d8
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 (executable)
index 0000000..e8ec955
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 (executable)
index 0000000..375e428
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 (executable)
index 0000000..19ec308
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 (file)
index 0000000..cbbd626
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 (file)
index 0000000..8b791b6
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 (file)
index 0000000..d034e01
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 (file)
index 0000000..9dc0ccf
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 (file)
index 0000000..33ceebb
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 (file)
index 0000000..cd93a68
Binary files /dev/null and b/sherlocks/logo/VISA.gif differ
index 50e21fa807f9c19ed73cc0cc77ee3044d63bd10f..5f24d826e52b79ed7d4857b3ca6ab85e4ecc8741 100644 (file)
@@ -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 #############')