]> _ Git - dtlc.git/commitdiff
wip #8016 @2 master
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 11 Mar 2026 17:08:24 +0000 (18:08 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 11 Mar 2026 17:08:24 +0000 (18:08 +0100)
.docker/production/docker-compose.yml
framework/application/configs/application.ini
framework/application/controllers/DevisController.php
framework/application/controllers/PaymentController.php
framework/application/controllers/SogecommerceController.php
framework/library/CubeIT/Payment/Sogecommerce.php

index d3d1d3861ea2c8f15ab6201fd85ad60c76556a33..3c8deba5e396a3404286f653712fb4f7b0594982 100644 (file)
@@ -6,6 +6,7 @@ services:
         volumes:
             - '/home/dtlc/www/:/usr/local/apache2/htdocs'
             - '/home/dtlc/www/:/application/'
+            - '/data/dtlc/tmp:/tmp'
             - './config/httpd/httpd.conf:/usr/local/apache2/conf/httpd.conf'
         environment:
             VIRTUAL_HOST: www.detouteslescouleurs.com,detouteslescouleurs.com
@@ -43,6 +44,7 @@ services:
             - './config/php.ini:/etc/php/7.4/fpm/conf.d/99-overrides.ini'
             # Web path
             - '/home/dtlc/www:/application'
+            - '/data/dtlc/tmp:/tmp'
         ports:
           - '39944:22'
         networks:
index 81bac8c714574c7be3b4e4d9ed3a28dab8a52d47..3897120ce8485b2570c47e689452c52edab2992b 100644 (file)
@@ -53,16 +53,13 @@ mail.transport = mandrill
 mandrill.username = "De toutes les couleurs"
 mandrill.password = QigtHBMVpBYo3n29DAZWrQ
 
-sogenactif.return = payment
-sogenactif.url = https://payment-webinit.sogenactif.com/paymentInit
-sogenactif.key = eEOyKndhH8_kP3SuMM74bZpxOQexiieBlfDW4oJe3t8
-sogenactif.key_version = 4
-sogenactif.merchant = 210667707380001
-
 sogecommerce.url = https://sogecommerce.societegenerale.eu/vads-payment/
 sogecommerce.site_id = 54215295
 sogecommerce.key = gLAsQjFhDOBFPXBH
 
+sogecommerce_15.url = https://sogecommerce.societegenerale.eu/vads-payment/
+sogecommerce_15.site_id = 14830145
+sogecommerce_15.key = QR0U2hBm4cygZop5
 
 [testing : production]
 seo.robots = false
@@ -76,23 +73,22 @@ httpauth.ip_whitelist[] = 176.134.43.17
 httpauth.excludepath[] = /devis
 httpauth.excludepath[] = /payment/auto
 httpauth.excludepath[] = /sogecommerce/auto
+httpauth.excludepath[] = /sogecommerce/auto15
 httpauth.excludepath[] = /images
 
 database.params.host = dtlc-dev-mariadb
-sogenactif.url = https://payment-webinit.simu.sips-atos.com/paymentInit
-sogenactif.key = 002001000000001_KEY1
-sogenactif.key_version = 1
-sogenactif.merchant = 002001000000001
 
 sogecommerce.mode = TEST
 sogecommerce.key = M36rdUrUHlN15u4x
 
+sogecommerce_15.mode = TEST
+sogecommerce_15.key = gm2pxqSJWNDgq6nI
+
 mail.transport = postal
 postal.username = dtlc/dtlc-dev
 postal.password = BeHsGbUhvMAbNsT3xpkELVUV
 postal.server = postal.cubedesigners.com
 
-
 webhost = dev.detouteslescouleurs.com
 
-mail.subjectPrefix = "/!\ Site de développement | "
\ No newline at end of file
+mail.subjectPrefix = "/!\ TEST | "
\ No newline at end of file
index b03ff6c1ae05325ae9a29817eb5ef777376d9fb3..a6e301a0d7c91fda0e6cef579ad894cfbb0ab9fa 100644 (file)
@@ -49,18 +49,12 @@ class DevisController extends CubeIT_Controller_PageController
             $currency = 978;
             if ($this->view->devis->magasin == 'paris11') {
                 $this->view->magasin = 11;
-                $sgc = new CubeIT_Payment_Sogecommerce();
-                $this->view->paymentForm = $sgc->getForm($this->view->devis->id, $amounts['ttc'], $currency, $this->view->devis->email, 'fr');
-                $this->view->paymentAddForm = '<iframe name="sogecommerceIframe" id="sogecommerceIframe"></iframe><script>$(function(){$("#sogecommerce").submit()})</script>';
             } else {
                 $this->view->magasin = 15;
-                $sogenactif = new CubeIT_Payment_Sogenactif();
-                $form = $sogenactif->getForm($this->view->devis->id, $amounts['ttc'], $currency, $this->view->devis->email, 'fr');
-                $this->view->paymentForm = $form;
-                $submit = new CubeIT_Form_Element_Html('image');
-                $submit->setLabel($this->view->link($this->view->image('/images/devis/cartes.png'), '#', array('class' => 'submit')));
-                $this->view->paymentForm->addElement($submit);
             }
+            $sgc = new CubeIT_Payment_Sogecommerce(null, $this->view->magasin);
+            $this->view->paymentForm = $sgc->getForm($this->view->devis->id, $amounts['ttc'], $currency, $this->view->devis->email, 'fr');
+            $this->view->paymentAddForm = '<iframe name="sogecommerceIframe" id="sogecommerceIframe"></iframe><script>$(function(){$("#sogecommerce").submit()})</script>';
         }
 
 
@@ -129,7 +123,7 @@ class DevisController extends CubeIT_Controller_PageController
         $response = $this->getResponse();
         $response->setHeader('Content-type', CubeIT_Files::getMimeType('file.pdf'))
             ->setBody(file_get_contents($f));
-          //  ->setBody(file_get_contents('https://extranet.cubedesigners.com/tools/phantomjs?url=' . urlencode($url) . '&pageformat=' . $format));
+        //  ->setBody(file_get_contents('https://extranet.cubedesigners.com/tools/phantomjs?url=' . urlencode($url) . '&pageformat=' . $format));
 
 
         $response->sendResponse();
index e435cf144c959b04ef58f049348c3956f97001f5..4c496b7bb0293b3f9f7007ce458a072a0cf17d60 100644 (file)
@@ -1,56 +1,56 @@
 <?php
 
 class PaymentController extends CubeIT_Controller_PageController {
-       public function okAction() {
-               $sogenactif = new CubeIT_Payment_Sogenactif();
-               $response = $sogenactif->checkResponse($this->getRequest()->getParam('Data'), $this->getRequest()->getParam('Seal'));
-               if (isset($response['error']) || $response['responseCode'] != '00' || $response['currencyCode'] != 978) {
-                       $this->redirect('/devis/nok');
-                       return;
-               }
-               $this->redirect('/devis/ok');
-       }
-
-       public function autoAction() {
-               $sogenactif = new CubeIT_Payment_Sogenactif();
-               $response = $sogenactif->checkResponse($this->getRequest()->getParam('Data'), $this->getRequest()->getParam('Seal'));
-               if (isset($response['error'])) {
-                       // Invalid response
-                       return;
-               }
-
-               $db = Bootstrap::getInstance()->getDb();
-               $q = $db->select()->from('devis')->where('id = ?', $response['orderId'])->query();
-               if (!$q->rowCount()) {
-                       return;
-               }
-
-               $devis = $q->fetch();
-
-               if ($devis->status == '2' || $devis->status == '5') {
-                       // Devis déjà marqué comme payé
-                       return;
-               }
-
-               $amounts = DTLC_Util::getDevisAmounts($devis);
-
-               if ($response['responseCode'] == '00'/* && $response['currencyCode'] == '978' && $amounts['ttc'] * 100 == $response['amount']*/) {
-                       // Conditions pour valider le paiement
-                       // reponse = 00
-                       // devis EUR
-                       // montant payée = au montant de la commande
-                       $status = 2;
-               } else {
-                       $status = 4;
-               }
-
-               $data = array('infos_paiement' => $response['asString'], 'date_paiement' => CubeIT_Date::now(), 'status' => $status);
-               $db->compliantUpdate('devis', $data, array('id = ?' => $devis->id));
-
-               if ($status == 2) {
-                       DTLC_Util::sendConfirmationPaiementEmail($devis);
-               } else {
-                       DTLC_Util::sendErrorPaiementEmail($devis, $response['asString'], $response['s10TransactionId'] . '_' . $response['s10TransactionIdDate']);
-               }
-       }
+//     public function okAction() {
+//             $sogenactif = new CubeIT_Payment_Sogenactif();
+//             $response = $sogenactif->checkResponse($this->getRequest()->getParam('Data'), $this->getRequest()->getParam('Seal'));
+//             if (isset($response['error']) || $response['responseCode'] != '00' || $response['currencyCode'] != 978) {
+//                     $this->redirect('/devis/nok');
+//                     return;
+//             }
+//             $this->redirect('/devis/ok');
+//     }
+//
+//     public function autoAction() {
+//             $sogenactif = new CubeIT_Payment_Sogenactif();
+//             $response = $sogenactif->checkResponse($this->getRequest()->getParam('Data'), $this->getRequest()->getParam('Seal'));
+//             if (isset($response['error'])) {
+//                     // Invalid response
+//                     return;
+//             }
+//
+//             $db = Bootstrap::getInstance()->getDb();
+//             $q = $db->select()->from('devis')->where('id = ?', $response['orderId'])->query();
+//             if (!$q->rowCount()) {
+//                     return;
+//             }
+//
+//             $devis = $q->fetch();
+//
+//             if ($devis->status == '2' || $devis->status == '5') {
+//                     // Devis déjà marqué comme payé
+//                     return;
+//             }
+//
+//             $amounts = DTLC_Util::getDevisAmounts($devis);
+//
+//             if ($response['responseCode'] == '00'/* && $response['currencyCode'] == '978' && $amounts['ttc'] * 100 == $response['amount']*/) {
+//                     // Conditions pour valider le paiement
+//                     // reponse = 00
+//                     // devis EUR
+//                     // montant payée = au montant de la commande
+//                     $status = 2;
+//             } else {
+//                     $status = 4;
+//             }
+//
+//             $data = array('infos_paiement' => $response['asString'], 'date_paiement' => CubeIT_Date::now(), 'status' => $status);
+//             $db->compliantUpdate('devis', $data, array('id = ?' => $devis->id));
+//
+//             if ($status == 2) {
+//                     DTLC_Util::sendConfirmationPaiementEmail($devis);
+//             } else {
+//                     DTLC_Util::sendErrorPaiementEmail($devis, $response['asString'], $response['s10TransactionId'] . '_' . $response['s10TransactionIdDate']);
+//             }
+//     }
 }
\ No newline at end of file
index 3452b42113491863f6e9254d0696805c5cb357f1..54d8f7dfc99ef2738175c3569f6527f544c216c8 100644 (file)
@@ -13,11 +13,17 @@ class SogecommerceController extends CubeIT_Controller_PageController
         $this->redirect('/devis/ok');
     }
 
-    public function autoAction()
+
+    public function auto15Action()
+    {
+        return $this->autoAction(15);
+    }
+
+    public function autoAction($boutique = 11)
     {
         file_put_contents(FRAMEWORK_PATH . '/log/sogecommerce.' . date('YmdHis') . '.log',
             print_r($_POST, true));
-        $sogecommerce = new CubeIT_Payment_Sogecommerce();
+        $sogecommerce = new CubeIT_Payment_Sogecommerce(null, $boutique);
         $response = $sogecommerce->checkResponse($_POST, $this->getRequest()->getParam('signature'));
         if (!$response) {
             // Invalid response
index 42e567f8704101d87481e1d1831deb5806becc02..f09f4b3d76bd2171a8a94b989ec6c3553ace506b 100644 (file)
@@ -4,10 +4,14 @@ class CubeIT_Payment_Sogecommerce extends CubeIT_Payment_Abstract
 {
     protected $_options;
 
-    public function __construct($options = null)
+    public function __construct($options = null, $boutique = 11)
     {
         parent::__construct($options);
-        $o = Bootstrap::getInstance()->getOpt('sogecommerce');
+        if ($boutique == 11) {
+            $o = Bootstrap::getInstance()->getOpt('sogecommerce');
+        } else if ($boutique == 15) {
+            $o = Bootstrap::getInstance()->getOpt('sogecommerce_15');
+        }
         $this->_options = array_merge(['url' => 'https://sogecommerce.societegenerale.eu/vads-payment/',
             'mode' => 'PRODUCTION',
             'version' => 'V2',