From: Vincent Vanwaelscappel Date: Wed, 11 Mar 2026 17:08:24 +0000 (+0100) Subject: wip #8016 @2 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=c09562f488361b1aed0f2e0e6344a31b6b89b7f7;p=dtlc.git wip #8016 @2 --- diff --git a/.docker/production/docker-compose.yml b/.docker/production/docker-compose.yml index d3d1d38..3c8deba 100644 --- a/.docker/production/docker-compose.yml +++ b/.docker/production/docker-compose.yml @@ -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: diff --git a/framework/application/configs/application.ini b/framework/application/configs/application.ini index 81bac8c..3897120 100644 --- a/framework/application/configs/application.ini +++ b/framework/application/configs/application.ini @@ -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 diff --git a/framework/application/controllers/DevisController.php b/framework/application/controllers/DevisController.php index b03ff6c..a6e301a 100644 --- a/framework/application/controllers/DevisController.php +++ b/framework/application/controllers/DevisController.php @@ -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 = ''; } 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 = ''; } @@ -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(); diff --git a/framework/application/controllers/PaymentController.php b/framework/application/controllers/PaymentController.php index e435cf1..4c496b7 100644 --- a/framework/application/controllers/PaymentController.php +++ b/framework/application/controllers/PaymentController.php @@ -1,56 +1,56 @@ 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 diff --git a/framework/application/controllers/SogecommerceController.php b/framework/application/controllers/SogecommerceController.php index 3452b42..54d8f7d 100644 --- a/framework/application/controllers/SogecommerceController.php +++ b/framework/application/controllers/SogecommerceController.php @@ -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 diff --git a/framework/library/CubeIT/Payment/Sogecommerce.php b/framework/library/CubeIT/Payment/Sogecommerce.php index 42e567f..f09f4b3 100644 --- a/framework/library/CubeIT/Payment/Sogecommerce.php +++ b/framework/library/CubeIT/Payment/Sogecommerce.php @@ -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',