This commit is contained in:
@@ -1,12 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<module>
|
||||
<name>fianetfraud</name>
|
||||
<displayName>FIA-NET - Système d\'Analyse des Commandes</displayName>
|
||||
<version>1.1</version>
|
||||
<description>Protégez vous contre la fraude à la carte bancaire sans perturber l\'acte d\'achat</description>
|
||||
<author></author>
|
||||
<tab>payment_security</tab>
|
||||
<is_configurable>1</is_configurable>
|
||||
<need_instance>1</need_instance>
|
||||
<limited_countries>fr</limited_countries>
|
||||
</module>
|
||||
@@ -1,31 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
* 2007-2011 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License (AFL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://opensource.org/licenses/afl-3.0.php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
*
|
||||
* @author PrestaShop SA <contact@prestashop.com>
|
||||
* @copyright 2007-2011 PrestaShop SA
|
||||
* @version Release: $Revision: 1.4 $
|
||||
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
include_once(dirname(__FILE__).'/../../config/config.inc.php');
|
||||
include_once(dirname(__FILE__).'/fianetfraud.php');
|
||||
|
||||
FianetFraud::reEvaluateOrder();
|
||||
|
||||
@@ -1,33 +0,0 @@
|
||||
#!/usr/bin/php
|
||||
<?php
|
||||
/*
|
||||
* 2007-2011 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License (AFL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://opensource.org/licenses/afl-3.0.php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
*
|
||||
* @author PrestaShop SA <contact@prestashop.com>
|
||||
* @copyright 2007-2011 PrestaShop SA
|
||||
* @version Release: $Revision: 1.4 $
|
||||
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
include_once(dirname(__FILE__).'/../../config/config.inc.php');
|
||||
include_once(dirname(__FILE__).'/fianetfraud.php');
|
||||
|
||||
FianetFraud::checkWaitingOrders();
|
||||
|
||||
@@ -1,36 +0,0 @@
|
||||
<?php
|
||||
|
||||
global $_MODULE;
|
||||
$_MODULE = array();
|
||||
$_MODULE['<{fianetfraud}prestashop>fianetfraud_740e53a0ed1b643f69c4aaa8ad4ae8d2'] = 'Ungültige Lieferanten-Code';
|
||||
$_MODULE['<{fianetfraud}prestashop>fianetfraud_7ccf58c950043c9fbfed668df13ce608'] = 'Die Einstellungen werden aktualisiert';
|
||||
$_MODULE['<{fianetfraud}prestashop>fianetfraud_380b4179d36bce6ca862459a43b217b5'] = 'Um sich anzumelden, melden Sie sich ab:';
|
||||
$_MODULE['<{fianetfraud}prestashop>fianetfraud_592fcfe937f6d58f70d0918ef6373afa'] = 'Fia-Net Website';
|
||||
$_MODULE['<{fianetfraud}prestashop>fianetfraud_f4f70727dc34561dfde1a3c529b6205c'] = 'Einstellungen';
|
||||
$_MODULE['<{fianetfraud}prestashop>fianetfraud_99dea78007133396a7b8ed70578ac6ae'] = 'Login';
|
||||
$_MODULE['<{fianetfraud}prestashop>fianetfraud_dc647eb65e6711e155375218212b3964'] = 'Kennwort';
|
||||
$_MODULE['<{fianetfraud}prestashop>fianetfraud_b250a007769c7ffe655c74cfb8176b8c'] = 'Seiten-ID';
|
||||
$_MODULE['<{fianetfraud}prestashop>fianetfraud_30dbd3dffa9dbd08b062436ba8dcbad7'] = 'Betriebsmodus';
|
||||
$_MODULE['<{fianetfraud}prestashop>fianetfraud_99dbbd4d0ac4c725f3b0d2ff29abaf63'] = 'Standard-Produkttyp';
|
||||
$_MODULE['<{fianetfraud}prestashop>fianetfraud_7bc873cba11f035df692c3549366c722'] = '- Wählen Sie -';
|
||||
$_MODULE['<{fianetfraud}prestashop>fianetfraud_b16c6b201b9dea0dba4c5214e584d5a9'] = 'Kategorie Details';
|
||||
$_MODULE['<{fianetfraud}prestashop>fianetfraud_3adbdb3ac060038aa0e6e6c138ef9873'] = 'Kategorie';
|
||||
$_MODULE['<{fianetfraud}prestashop>fianetfraud_32b1e872d533aced68e8fd06117c35d9'] = 'Kategorie Typ';
|
||||
$_MODULE['<{fianetfraud}prestashop>fianetfraud_bb8d6a9f57dcf8f450d8c8b6107cfabb'] = 'Wählen Sie eine Kategorie ...';
|
||||
$_MODULE['<{fianetfraud}prestashop>fianetfraud_5f001485711e47385cb84b10c888bbfd'] = 'Lieferanten-Konfiguration';
|
||||
$_MODULE['<{fianetfraud}prestashop>fianetfraud_84a4ee79ed85180a743340dceb2f98d1'] = 'Lieferant Detail';
|
||||
$_MODULE['<{fianetfraud}prestashop>fianetfraud_914419aa32f04011357d3b604a86d7eb'] = 'Lieferant';
|
||||
$_MODULE['<{fianetfraud}prestashop>fianetfraud_fecb07f7ab46e23e9b520a9a9af7b97b'] = 'Lieferantenart';
|
||||
$_MODULE['<{fianetfraud}prestashop>fianetfraud_b04ad61ad875f6e7149fdd51c2e60ce2'] = 'Wählen Sie eine Lieferantenart ...';
|
||||
$_MODULE['<{fianetfraud}prestashop>fianetfraud_803d8f90719db3a605cf4af72ab2d8ee'] = 'Standard-Lieferantenart';
|
||||
$_MODULE['<{fianetfraud}prestashop>fianetfraud_4a04490d2817c00012562df7bc43299d'] = 'Zahlungskonfiguration';
|
||||
$_MODULE['<{fianetfraud}prestashop>fianetfraud_ff18b8d27988b97ba1dd72120dd524ea'] = 'Zahlungsdetails';
|
||||
$_MODULE['<{fianetfraud}prestashop>fianetfraud_ec51b543e5a38f6044c83f21dce2b23d'] = 'Zahlungs-Modul';
|
||||
$_MODULE['<{fianetfraud}prestashop>fianetfraud_7c9a3504dd4ce74b8021267ae1802968'] = 'Zahlungsart';
|
||||
$_MODULE['<{fianetfraud}prestashop>fianetfraud_c9cc8cce247e49bae79f15173ce97354'] = 'Speichern';
|
||||
$_MODULE['<{fianetfraud}prestashop>fianetfraud_127469a6b4253ebb77adccc0dd48461e'] = 'Herr';
|
||||
$_MODULE['<{fianetfraud}prestashop>fianetfraud_7f2a1b59ac1ab6d2d892dbbf4f132c40'] = 'Frau';
|
||||
$_MODULE['<{fianetfraud}prestashop>fianetfraud_88183b946cc5f0e8c96b2e66e1c74a7e'] = 'Unbekannt';
|
||||
$_MODULE['<{fianetfraud}prestashop>fianetfraud_d13270d4831bb2a2723f0fb5b573807c'] = 'Fianet Bestätigung';
|
||||
$_MODULE['<{fianetfraud}prestashop>fianetfraud_e010021939a49b7cce07f0e546c1d54f'] = 'Detailansicht';
|
||||
$_MODULE['<{fianetfraud}prestashop>fianetfraud_b086843368d1c92d0a86cbee76b20b6f'] = 'Eval';
|
||||
@@ -1,36 +0,0 @@
|
||||
<?php
|
||||
|
||||
global $_MODULE;
|
||||
$_MODULE = array();
|
||||
$_MODULE['<{fianetfraud}prestashop>fianetfraud_740e53a0ed1b643f69c4aaa8ad4ae8d2'] = 'Código transportista no válido';
|
||||
$_MODULE['<{fianetfraud}prestashop>fianetfraud_7ccf58c950043c9fbfed668df13ce608'] = 'Parámetros actualizados con éxito';
|
||||
$_MODULE['<{fianetfraud}prestashop>fianetfraud_380b4179d36bce6ca862459a43b217b5'] = 'Para conectarse, visita:';
|
||||
$_MODULE['<{fianetfraud}prestashop>fianetfraud_592fcfe937f6d58f70d0918ef6373afa'] = 'Web de FIA-net';
|
||||
$_MODULE['<{fianetfraud}prestashop>fianetfraud_f4f70727dc34561dfde1a3c529b6205c'] = 'Configuración';
|
||||
$_MODULE['<{fianetfraud}prestashop>fianetfraud_99dea78007133396a7b8ed70578ac6ae'] = 'Usuario';
|
||||
$_MODULE['<{fianetfraud}prestashop>fianetfraud_dc647eb65e6711e155375218212b3964'] = 'Contraseña';
|
||||
$_MODULE['<{fianetfraud}prestashop>fianetfraud_b250a007769c7ffe655c74cfb8176b8c'] = 'ID sitio Web';
|
||||
$_MODULE['<{fianetfraud}prestashop>fianetfraud_30dbd3dffa9dbd08b062436ba8dcbad7'] = 'Modo producción';
|
||||
$_MODULE['<{fianetfraud}prestashop>fianetfraud_99dbbd4d0ac4c725f3b0d2ff29abaf63'] = 'Tipo por defecto';
|
||||
$_MODULE['<{fianetfraud}prestashop>fianetfraud_7bc873cba11f035df692c3549366c722'] = '--Elija--';
|
||||
$_MODULE['<{fianetfraud}prestashop>fianetfraud_b16c6b201b9dea0dba4c5214e584d5a9'] = 'Detalle';
|
||||
$_MODULE['<{fianetfraud}prestashop>fianetfraud_3adbdb3ac060038aa0e6e6c138ef9873'] = 'Categoría';
|
||||
$_MODULE['<{fianetfraud}prestashop>fianetfraud_32b1e872d533aced68e8fd06117c35d9'] = 'Tipo';
|
||||
$_MODULE['<{fianetfraud}prestashop>fianetfraud_bb8d6a9f57dcf8f450d8c8b6107cfabb'] = 'Elegir la categoría';
|
||||
$_MODULE['<{fianetfraud}prestashop>fianetfraud_5f001485711e47385cb84b10c888bbfd'] = 'Configurar el transportista';
|
||||
$_MODULE['<{fianetfraud}prestashop>fianetfraud_84a4ee79ed85180a743340dceb2f98d1'] = 'Detalle';
|
||||
$_MODULE['<{fianetfraud}prestashop>fianetfraud_914419aa32f04011357d3b604a86d7eb'] = 'Transportista';
|
||||
$_MODULE['<{fianetfraud}prestashop>fianetfraud_fecb07f7ab46e23e9b520a9a9af7b97b'] = 'Tipo de transportista';
|
||||
$_MODULE['<{fianetfraud}prestashop>fianetfraud_b04ad61ad875f6e7149fdd51c2e60ce2'] = 'Elegir tipo de transportista';
|
||||
$_MODULE['<{fianetfraud}prestashop>fianetfraud_803d8f90719db3a605cf4af72ab2d8ee'] = 'Tipo de transportista por defecto';
|
||||
$_MODULE['<{fianetfraud}prestashop>fianetfraud_4a04490d2817c00012562df7bc43299d'] = 'Confuguración del pago';
|
||||
$_MODULE['<{fianetfraud}prestashop>fianetfraud_ff18b8d27988b97ba1dd72120dd524ea'] = 'Detalle del pago';
|
||||
$_MODULE['<{fianetfraud}prestashop>fianetfraud_ec51b543e5a38f6044c83f21dce2b23d'] = 'Módulo de pago';
|
||||
$_MODULE['<{fianetfraud}prestashop>fianetfraud_7c9a3504dd4ce74b8021267ae1802968'] = 'Tipo de pago';
|
||||
$_MODULE['<{fianetfraud}prestashop>fianetfraud_c9cc8cce247e49bae79f15173ce97354'] = 'Guardar';
|
||||
$_MODULE['<{fianetfraud}prestashop>fianetfraud_127469a6b4253ebb77adccc0dd48461e'] = 'Sr.';
|
||||
$_MODULE['<{fianetfraud}prestashop>fianetfraud_7f2a1b59ac1ab6d2d892dbbf4f132c40'] = 'Sra.';
|
||||
$_MODULE['<{fianetfraud}prestashop>fianetfraud_88183b946cc5f0e8c96b2e66e1c74a7e'] = 'Desconocido';
|
||||
$_MODULE['<{fianetfraud}prestashop>fianetfraud_d13270d4831bb2a2723f0fb5b573807c'] = 'Validación Fia-Net';
|
||||
$_MODULE['<{fianetfraud}prestashop>fianetfraud_e010021939a49b7cce07f0e546c1d54f'] = 'Ver detalle';
|
||||
$_MODULE['<{fianetfraud}prestashop>fianetfraud_b086843368d1c92d0a86cbee76b20b6f'] = 'Evaluación';
|
||||
@@ -1,274 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
** PHP implementation of the RSA Data Security, Inc. MD5 Message
|
||||
** Digest Algorithm, as defined in RFC 1321.
|
||||
*
|
||||
** Version 1.1
|
||||
** Copyright 2004 Marcus Campbell
|
||||
** http://www.tecknik.net/md5/
|
||||
*
|
||||
** This code is available under the GNU Lesser General Public License:
|
||||
** http://www.gnu.org/licenses/lgpl.txt
|
||||
*
|
||||
** Based on the JavaScript implementation by Paul Johnston
|
||||
** http://pajhome.org.uk/
|
||||
*/
|
||||
Class HashMD5 {
|
||||
var $a;
|
||||
var $b;
|
||||
var $c;
|
||||
var $d;
|
||||
|
||||
var $Save_a;
|
||||
var $Save_b;
|
||||
var $Save_c;
|
||||
var $Save_d;
|
||||
|
||||
function HashMD5() {
|
||||
/*
|
||||
$a = 1732584190;
|
||||
$b = -271733879;
|
||||
$c = -1732584194;
|
||||
$d = 271733878; */
|
||||
$this->a = -279229019;
|
||||
$this->b = -1875190530;
|
||||
$this->c = 1737040641;
|
||||
$this->d = 315143286;
|
||||
|
||||
$this->Save_a = $this->a;
|
||||
$this->Save_b = $this->b;
|
||||
$this->Save_c = $this->c;
|
||||
$this->Save_d = $this->d;
|
||||
}
|
||||
|
||||
function FlushKey($k0, $k1, $k2, $k3) {
|
||||
$this->a = $k0;
|
||||
$this->b = $k1;
|
||||
$this->c = $k2;
|
||||
$this->d = $k3;
|
||||
|
||||
$this->Save_a = $this->a;
|
||||
$this->Save_b = $this->b;
|
||||
$this->Save_c = $this->c;
|
||||
$this->Save_d = $this->d;
|
||||
}
|
||||
|
||||
function Init() {
|
||||
$this->a = $this->Save_a;
|
||||
$this->b = $this->Save_b;
|
||||
$this->c = $this->Save_c;
|
||||
$this->d = $this->Save_d;
|
||||
}
|
||||
|
||||
function rhex($num) {
|
||||
$hex_chr = "0123456789abcdef";
|
||||
$str = "";
|
||||
for($j = 0; $j <= 3; $j++)
|
||||
$str .= substr($hex_chr, ($num >> ($j * 8 + 4)) & 0x0F, 1) . substr($hex_chr, ($num >> ($j * 8)) & 0x0F, 1);
|
||||
return $str;
|
||||
}
|
||||
|
||||
function str2blks_MD5($str) {
|
||||
$nblk = ((strlen($str) + 8) >> 6) + 1;
|
||||
for($i = 0; $i < $nblk * 16; $i++) $blks[$i] = 0;
|
||||
for($i = 0; $i < strlen($str); $i++)
|
||||
$blks[$i >> 2] |= ord(substr($str, $i, 1)) << (($i % 4) * 8);
|
||||
$blks[$i >> 2] |= 0x80 << (($i % 4) * 8);
|
||||
$blks[$nblk * 16 - 2] = strlen($str) * 8;
|
||||
return $blks;
|
||||
}
|
||||
|
||||
function add($x, $y) {
|
||||
$lsw = ($x & 0xFFFF) + ($y & 0xFFFF);
|
||||
$msw = ($x >> 16) + ($y >> 16) + ($lsw >> 16);
|
||||
return ($msw << 16) | ($lsw & 0xFFFF);
|
||||
}
|
||||
|
||||
function rol($num, $cnt) {
|
||||
return ($num << $cnt) | $this->zeroFill($num, 32 - $cnt);
|
||||
}
|
||||
|
||||
function zeroFill($a, $b) {
|
||||
$bin = decbin($a);
|
||||
if (strlen($bin) < $b) $bin = 0;
|
||||
else $bin = substr($bin, 0, strlen($bin) - $b);
|
||||
for ($i=0; $i < $b; $i++) {
|
||||
$bin = "0".$bin;
|
||||
}
|
||||
return bindec($bin);
|
||||
}
|
||||
|
||||
function cmn($q, $a, $b, $x, $s, $t) {
|
||||
return $this->add($this->rol($this->add($this->add($a, $q), $this->add($x, $t)), $s), $b);
|
||||
}
|
||||
|
||||
function ff($a, $b, $c, $d, $x, $s, $t) {
|
||||
return $this->cmn(($b & $c) | ((~$b) & $d), $a, $b, $x, $s, $t);
|
||||
}
|
||||
|
||||
function gg($a, $b, $c, $d, $x, $s, $t) {
|
||||
return $this->cmn(($b & $d) | ($c & (~$d)), $a, $b, $x, $s, $t);
|
||||
}
|
||||
|
||||
function hh($a, $b, $c, $d, $x, $s, $t) {
|
||||
return $this->cmn($b ^ $c ^ $d, $a, $b, $x, $s, $t);
|
||||
}
|
||||
|
||||
function ii($a, $b, $c, $d, $x, $s, $t) {
|
||||
return $this->cmn($c ^ ($b | (~$d)), $a, $b, $x, $s, $t);
|
||||
}
|
||||
|
||||
function hash($str) {
|
||||
$x = $this->str2blks_MD5($str);
|
||||
|
||||
$this->Init();
|
||||
|
||||
for($i = 0; $i < sizeof($x); $i += 16) {
|
||||
$olda = $this->a;
|
||||
$oldb = $this->b;
|
||||
$oldc = $this->c;
|
||||
$oldd = $this->d;
|
||||
|
||||
$this->a = $this->ff($this->a, $this->b, $this->c, $this->d, $x[$i+ 0], 7 , -680876936);
|
||||
$this->d = $this->ff($this->d, $this->a, $this->b, $this->c, $x[$i+ 1], 12, -389564586);
|
||||
$this->c = $this->ff($this->c, $this->d, $this->a, $this->b, $x[$i+ 2], 17, 606105819);
|
||||
$this->b = $this->ff($this->b, $this->c, $this->d, $this->a, $x[$i+ 3], 22, -1044525330);
|
||||
$this->a = $this->ff($this->a, $this->b, $this->c, $this->d, $x[$i+ 4], 7 , -176418897);
|
||||
$this->d = $this->ff($this->d, $this->a, $this->b, $this->c, $x[$i+ 5], 12, 1200080426);
|
||||
$this->c = $this->ff($this->c, $this->d, $this->a, $this->b, $x[$i+ 6], 17, -1473231341);
|
||||
$this->b = $this->ff($this->b, $this->c, $this->d, $this->a, $x[$i+ 7], 22, -45705983);
|
||||
$this->a = $this->ff($this->a, $this->b, $this->c, $this->d, $x[$i+ 8], 7 , 1770035416);
|
||||
$this->d = $this->ff($this->d, $this->a, $this->b, $this->c, $x[$i+ 9], 12, -1958414417);
|
||||
$this->c = $this->ff($this->c, $this->d, $this->a, $this->b, $x[$i+10], 17, -42063);
|
||||
$this->b = $this->ff($this->b, $this->c, $this->d, $this->a, $x[$i+11], 22, -1990404162);
|
||||
$this->a = $this->ff($this->a, $this->b, $this->c, $this->d, $x[$i+12], 7 , 1804603682);
|
||||
$this->d = $this->ff($this->d, $this->a, $this->b, $this->c, $x[$i+13], 12, -40341101);
|
||||
$this->c = $this->ff($this->c, $this->d, $this->a, $this->b, $x[$i+14], 17, -1502002290);
|
||||
$this->b = $this->ff($this->b, $this->c, $this->d, $this->a, $x[$i+15], 22, 1236535329);
|
||||
|
||||
$this->a = $this->gg($this->a, $this->b, $this->c, $this->d, $x[$i+ 1], 5 , -165796510);
|
||||
$this->d = $this->gg($this->d, $this->a, $this->b, $this->c, $x[$i+ 6], 9 , -1069501632);
|
||||
$this->c = $this->gg($this->c, $this->d, $this->a, $this->b, $x[$i+11], 14, 643717713);
|
||||
$this->b = $this->gg($this->b, $this->c, $this->d, $this->a, $x[$i+ 0], 20, -373897302);
|
||||
$this->a = $this->gg($this->a, $this->b, $this->c, $this->d, $x[$i+ 5], 5 , -701558691);
|
||||
$this->d = $this->gg($this->d, $this->a, $this->b, $this->c, $x[$i+10], 9 , 38016083);
|
||||
$this->c = $this->gg($this->c, $this->d, $this->a, $this->b, $x[$i+15], 14, -660478335);
|
||||
$this->b = $this->gg($this->b, $this->c, $this->d, $this->a, $x[$i+ 4], 20, -405537848);
|
||||
$this->a = $this->gg($this->a, $this->b, $this->c, $this->d, $x[$i+ 9], 5 , 568446438);
|
||||
$this->d = $this->gg($this->d, $this->a, $this->b, $this->c, $x[$i+14], 9 , -1019803690);
|
||||
$this->c = $this->gg($this->c, $this->d, $this->a, $this->b, $x[$i+ 3], 14, -187363961);
|
||||
$this->b = $this->gg($this->b, $this->c, $this->d, $this->a, $x[$i+ 8], 20, 1163531501);
|
||||
$this->a = $this->gg($this->a, $this->b, $this->c, $this->d, $x[$i+13], 5 , -1444681467);
|
||||
$this->d = $this->gg($this->d, $this->a, $this->b, $this->c, $x[$i+ 2], 9 , -51403784);
|
||||
$this->c = $this->gg($this->c, $this->d, $this->a, $this->b, $x[$i+ 7], 14, 1735328473);
|
||||
$this->b = $this->gg($this->b, $this->c, $this->d, $this->a, $x[$i+12], 20, -1926607734);
|
||||
|
||||
$this->a = $this->hh($this->a, $this->b, $this->c, $this->d, $x[$i+ 5], 4 , -378558);
|
||||
$this->d = $this->hh($this->d, $this->a, $this->b, $this->c, $x[$i+ 8], 11, -2022574463);
|
||||
$this->c = $this->hh($this->c, $this->d, $this->a, $this->b, $x[$i+11], 16, 1839030562);
|
||||
$this->b = $this->hh($this->b, $this->c, $this->d, $this->a, $x[$i+14], 23, -35309556);
|
||||
$this->a = $this->hh($this->a, $this->b, $this->c, $this->d, $x[$i+ 1], 4 , -1530992060);
|
||||
$this->d = $this->hh($this->d, $this->a, $this->b, $this->c, $x[$i+ 4], 11, 1272893353);
|
||||
$this->c = $this->hh($this->c, $this->d, $this->a, $this->b, $x[$i+ 7], 16, -155497632);
|
||||
$this->b = $this->hh($this->b, $this->c, $this->d, $this->a, $x[$i+10], 23, -1094730640);
|
||||
$this->a = $this->hh($this->a, $this->b, $this->c, $this->d, $x[$i+13], 4 , 681279174);
|
||||
$this->d = $this->hh($this->d, $this->a, $this->b, $this->c, $x[$i+ 0], 11, -358537222);
|
||||
$this->c = $this->hh($this->c, $this->d, $this->a, $this->b, $x[$i+ 3], 16, -722521979);
|
||||
$this->b = $this->hh($this->b, $this->c, $this->d, $this->a, $x[$i+ 6], 23, 76029189);
|
||||
$this->a = $this->hh($this->a, $this->b, $this->c, $this->d, $x[$i+ 9], 4 , -640364487);
|
||||
$this->d = $this->hh($this->d, $this->a, $this->b, $this->c, $x[$i+12], 11, -421815835);
|
||||
$this->c = $this->hh($this->c, $this->d, $this->a, $this->b, $x[$i+15], 16, 530742520);
|
||||
$this->b = $this->hh($this->b, $this->c, $this->d, $this->a, $x[$i+ 2], 23, -995338651);
|
||||
|
||||
$this->a = $this->ii($this->a, $this->b, $this->c, $this->d, $x[$i+ 0], 6 , -198630844);
|
||||
$this->d = $this->ii($this->d, $this->a, $this->b, $this->c, $x[$i+ 7], 10, 1126891415);
|
||||
$this->c = $this->ii($this->c, $this->d, $this->a, $this->b, $x[$i+14], 15, -1416354905);
|
||||
$this->b = $this->ii($this->b, $this->c, $this->d, $this->a, $x[$i+ 5], 21, -57434055);
|
||||
$this->a = $this->ii($this->a, $this->b, $this->c, $this->d, $x[$i+12], 6 , 1700485571);
|
||||
$this->d = $this->ii($this->d, $this->a, $this->b, $this->c, $x[$i+ 3], 10, -1894986606);
|
||||
$this->c = $this->ii($this->c, $this->d, $this->a, $this->b, $x[$i+10], 15, -1051523);
|
||||
$this->b = $this->ii($this->b, $this->c, $this->d, $this->a, $x[$i+ 1], 21, -2054922799);
|
||||
$this->a = $this->ii($this->a, $this->b, $this->c, $this->d, $x[$i+ 8], 6 , 1873313359);
|
||||
$this->d = $this->ii($this->d, $this->a, $this->b, $this->c, $x[$i+15], 10, -30611744);
|
||||
$this->c = $this->ii($this->c, $this->d, $this->a, $this->b, $x[$i+ 6], 15, -1560198380);
|
||||
$this->b = $this->ii($this->b, $this->c, $this->d, $this->a, $x[$i+13], 21, 1309151649);
|
||||
$this->a = $this->ii($this->a, $this->b, $this->c, $this->d, $x[$i+ 4], 6 , -145523070);
|
||||
$this->d = $this->ii($this->d, $this->a, $this->b, $this->c, $x[$i+11], 10, -1120210379);
|
||||
$this->c = $this->ii($this->c, $this->d, $this->a, $this->b, $x[$i+ 2], 15, 718787259);
|
||||
$this->b = $this->ii($this->b, $this->c, $this->d, $this->a, $x[$i+ 9], 21, -343485551);
|
||||
|
||||
$this->a = $this->add($this->a, $olda);
|
||||
$this->b = $this->add($this->b, $oldb);
|
||||
$this->c = $this->add($this->c, $oldc);
|
||||
$this->d = $this->add($this->d, $oldd);
|
||||
}
|
||||
return $this->rhex($this->a) . $this->rhex($this->b) . $this->rhex($this->c) . $this->rhex($this->d);
|
||||
}
|
||||
}
|
||||
Class EncodingKey {
|
||||
var $clMD5;
|
||||
|
||||
function EncodingKey() {
|
||||
$this->clMD5 = new HashMD5();
|
||||
}
|
||||
|
||||
function giveHashCode($pkey, $second, $email, $refid, $montant, $nom) {
|
||||
|
||||
$modulo = $second % 4;
|
||||
|
||||
switch($modulo) {
|
||||
case 0:
|
||||
$select = $montant;
|
||||
break;
|
||||
case 1:
|
||||
$select = $email;
|
||||
break;
|
||||
case 2:
|
||||
$select = $refid;
|
||||
break;
|
||||
case 3:
|
||||
$select = $nom;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return $this->clMD5->hash($pkey.$refid.$select);
|
||||
|
||||
}
|
||||
|
||||
function giveHashCode2($pkey, $second, $email, $refid, $montant, $nom) {
|
||||
$modulo = $second % 4;
|
||||
|
||||
$montant = sprintf("%01.2f",$montant);
|
||||
|
||||
switch($modulo) {
|
||||
case 0:
|
||||
$select = $montant;
|
||||
break;
|
||||
case 1:
|
||||
$select = $email;
|
||||
break;
|
||||
case 2:
|
||||
$select = $refid;
|
||||
break;
|
||||
case 3:
|
||||
$select = $nom;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
/*
|
||||
$fp = fopen('/var/www/fianet/test_greg.txt','ab');
|
||||
fwrite($fp,"second=".$second."\n");
|
||||
fwrite($fp,"montant=".$montant."\n");
|
||||
fwrite($fp,"email=".$email."\n");
|
||||
fwrite($fp,"refid=".$refid."\n");
|
||||
fwrite($fp,"nom=".$nom."\n");
|
||||
fclose($fp);
|
||||
*/
|
||||
|
||||
return $this->clMD5->hash($pkey.$refid.$montant.$email.$select);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,279 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
** PHP implementation of the RSA Data Security, Inc. MD5 Message
|
||||
** Digest Algorithm, as defined in RFC 1321.
|
||||
*
|
||||
** Version 1.1
|
||||
** Copyright 2004 Marcus Campbell
|
||||
** http://www.tecknik.net/md5/
|
||||
*
|
||||
** This code is available under the GNU Lesser General Public License:
|
||||
** http://www.gnu.org/licenses/lgpl.txt
|
||||
*
|
||||
** Based on the JavaScript implementation by Paul Johnston
|
||||
** http://pajhome.org.uk/
|
||||
*
|
||||
** Modified by PJ ALBERT
|
||||
** for 64bit system
|
||||
*/
|
||||
Class HashMD5 {
|
||||
var $a;
|
||||
var $b;
|
||||
var $c;
|
||||
var $d;
|
||||
|
||||
var $Save_a;
|
||||
var $Save_b;
|
||||
var $Save_c;
|
||||
var $Save_d;
|
||||
|
||||
function HashMD5() {
|
||||
/*
|
||||
$a = 1732584190;
|
||||
$b = -271733879;
|
||||
$c = -1732584194;
|
||||
$d = 271733878; */
|
||||
$this->a = -279229019;
|
||||
$this->b = -1875190530;
|
||||
$this->c = 1737040641;
|
||||
$this->d = 315143286;
|
||||
|
||||
$this->Save_a = $this->a;
|
||||
$this->Save_b = $this->b;
|
||||
$this->Save_c = $this->c;
|
||||
$this->Save_d = $this->d;
|
||||
}
|
||||
|
||||
function FlushKey($k0, $k1, $k2, $k3) {
|
||||
$this->a = $k0;
|
||||
$this->b = $k1;
|
||||
$this->c = $k2;
|
||||
$this->d = $k3;
|
||||
|
||||
$this->Save_a = $this->a;
|
||||
$this->Save_b = $this->b;
|
||||
$this->Save_c = $this->c;
|
||||
$this->Save_d = $this->d;
|
||||
}
|
||||
|
||||
function Init() {
|
||||
$this->a = $this->Save_a;
|
||||
$this->b = $this->Save_b;
|
||||
$this->c = $this->Save_c;
|
||||
$this->d = $this->Save_d;
|
||||
}
|
||||
|
||||
function rhex($num) {
|
||||
$hex_chr = "0123456789abcdef";
|
||||
$str = "";
|
||||
for($j = 0; $j <= 3; $j++)
|
||||
$str .= substr($hex_chr, ($num >> ($j * 8 + 4)) & 0x0F, 1) . substr($hex_chr, ($num >> ($j * 8)) & 0x0F, 1);
|
||||
return $str;
|
||||
}
|
||||
|
||||
function str2blks_MD5($str) {
|
||||
$nblk = ((strlen($str) + 8) >> 6) + 1;
|
||||
for($i = 0; $i < $nblk * 16; $i++) $blks[$i] = 0;
|
||||
for($i = 0; $i < strlen($str); $i++)
|
||||
$blks[$i >> 2] |= ord(substr($str, $i, 1)) << (($i % 4) * 8);
|
||||
$blks[$i >> 2] |= 0x80 << (($i % 4) * 8);
|
||||
$blks[$nblk * 16 - 2] = strlen($str) * 8;
|
||||
return $blks;
|
||||
}
|
||||
|
||||
function parse_unsigned_int($s) {
|
||||
$x = (float)$s;
|
||||
if($x > (float)2147483647)
|
||||
$x -= (float)"4294967296";
|
||||
if($x < (float)-2147483648)
|
||||
$x += (float)"4294967296";
|
||||
return (int)$x;
|
||||
}
|
||||
|
||||
function add($x, $y) {
|
||||
$lsw = ($x & 0xFFFF) + ($y & 0xFFFF);
|
||||
$msw = ($x >> 16) + ($y >> 16) + ($lsw >> 16);
|
||||
return $this->parse_unsigned_int(($msw << 16) | ($lsw & 0xFFFF));
|
||||
}
|
||||
|
||||
function rol($num, $cnt) {
|
||||
$num = $num & 0xFFFFFFFF;
|
||||
return $this->parse_unsigned_int(($num << $cnt) & 0xFFFFFFFF | $this->zeroFill($num, 32 - $cnt));
|
||||
}
|
||||
|
||||
function zeroFill($a, $b) {
|
||||
$bin = decbin($a);
|
||||
if (strlen($bin) < $b) $bin = 0;
|
||||
else $bin = substr($bin, 0, strlen($bin) - $b);
|
||||
for ($i=0; $i < $b; $i++) {
|
||||
$bin = "0".$bin;
|
||||
}
|
||||
return bindec($bin);
|
||||
}
|
||||
|
||||
function cmn($q, $a, $b, $x, $s, $t) {
|
||||
return $this->add($this->rol($this->add($this->add($a, $q), $this->add($x, $t)), $s), $b);
|
||||
}
|
||||
|
||||
function ff($a, $b, $c, $d, $x, $s, $t) {
|
||||
return $this->cmn(($b & $c) | ((~$b) & $d), $a, $b, $x, $s, $t);
|
||||
}
|
||||
|
||||
function gg($a, $b, $c, $d, $x, $s, $t) {
|
||||
return $this->cmn(($b & $d) | ($c & (~$d)), $a, $b, $x, $s, $t);
|
||||
}
|
||||
|
||||
function hh($a, $b, $c, $d, $x, $s, $t) {
|
||||
return $this->cmn($b ^ $c ^ $d, $a, $b, $x, $s, $t);
|
||||
}
|
||||
|
||||
function ii($a, $b, $c, $d, $x, $s, $t) {
|
||||
return $this->cmn($c ^ ($b | (~$d)), $a, $b, $x, $s, $t);
|
||||
}
|
||||
|
||||
function hash($str) {
|
||||
|
||||
$x = $this->str2blks_MD5($str);
|
||||
$this->Init();
|
||||
|
||||
for($i = 0; $i < sizeof($x); $i += 16) {
|
||||
$olda = $this->a;
|
||||
$oldb = $this->b;
|
||||
$oldc = $this->c;
|
||||
$oldd = $this->d;
|
||||
|
||||
$this->a = $this->ff($this->a, $this->b, $this->c, $this->d, $x[$i+ 0], 7 , -680876936);
|
||||
$this->d = $this->ff($this->d, $this->a, $this->b, $this->c, $x[$i+ 1], 12, -389564586);
|
||||
$this->c = $this->ff($this->c, $this->d, $this->a, $this->b, $x[$i+ 2], 17, 606105819);
|
||||
$this->b = $this->ff($this->b, $this->c, $this->d, $this->a, $x[$i+ 3], 22, -1044525330);
|
||||
$this->a = $this->ff($this->a, $this->b, $this->c, $this->d, $x[$i+ 4], 7 , -176418897);
|
||||
$this->d = $this->ff($this->d, $this->a, $this->b, $this->c, $x[$i+ 5], 12, 1200080426);
|
||||
$this->c = $this->ff($this->c, $this->d, $this->a, $this->b, $x[$i+ 6], 17, -1473231341);
|
||||
$this->b = $this->ff($this->b, $this->c, $this->d, $this->a, $x[$i+ 7], 22, -45705983);
|
||||
$this->a = $this->ff($this->a, $this->b, $this->c, $this->d, $x[$i+ 8], 7 , 1770035416);
|
||||
$this->d = $this->ff($this->d, $this->a, $this->b, $this->c, $x[$i+ 9], 12, -1958414417);
|
||||
$this->c = $this->ff($this->c, $this->d, $this->a, $this->b, $x[$i+10], 17, -42063);
|
||||
$this->b = $this->ff($this->b, $this->c, $this->d, $this->a, $x[$i+11], 22, -1990404162);
|
||||
$this->a = $this->ff($this->a, $this->b, $this->c, $this->d, $x[$i+12], 7 , 1804603682);
|
||||
$this->d = $this->ff($this->d, $this->a, $this->b, $this->c, $x[$i+13], 12, -40341101);
|
||||
$this->c = $this->ff($this->c, $this->d, $this->a, $this->b, $x[$i+14], 17, -1502002290);
|
||||
$this->b = $this->ff($this->b, $this->c, $this->d, $this->a, $x[$i+15], 22, 1236535329);
|
||||
|
||||
$this->a = $this->gg($this->a, $this->b, $this->c, $this->d, $x[$i+ 1], 5 , -165796510);
|
||||
$this->d = $this->gg($this->d, $this->a, $this->b, $this->c, $x[$i+ 6], 9 , -1069501632);
|
||||
$this->c = $this->gg($this->c, $this->d, $this->a, $this->b, $x[$i+11], 14, 643717713);
|
||||
$this->b = $this->gg($this->b, $this->c, $this->d, $this->a, $x[$i+ 0], 20, -373897302);
|
||||
$this->a = $this->gg($this->a, $this->b, $this->c, $this->d, $x[$i+ 5], 5 , -701558691);
|
||||
$this->d = $this->gg($this->d, $this->a, $this->b, $this->c, $x[$i+10], 9 , 38016083);
|
||||
$this->c = $this->gg($this->c, $this->d, $this->a, $this->b, $x[$i+15], 14, -660478335);
|
||||
$this->b = $this->gg($this->b, $this->c, $this->d, $this->a, $x[$i+ 4], 20, -405537848);
|
||||
$this->a = $this->gg($this->a, $this->b, $this->c, $this->d, $x[$i+ 9], 5 , 568446438);
|
||||
$this->d = $this->gg($this->d, $this->a, $this->b, $this->c, $x[$i+14], 9 , -1019803690);
|
||||
$this->c = $this->gg($this->c, $this->d, $this->a, $this->b, $x[$i+ 3], 14, -187363961);
|
||||
$this->b = $this->gg($this->b, $this->c, $this->d, $this->a, $x[$i+ 8], 20, 1163531501);
|
||||
$this->a = $this->gg($this->a, $this->b, $this->c, $this->d, $x[$i+13], 5 , -1444681467);
|
||||
$this->d = $this->gg($this->d, $this->a, $this->b, $this->c, $x[$i+ 2], 9 , -51403784);
|
||||
$this->c = $this->gg($this->c, $this->d, $this->a, $this->b, $x[$i+ 7], 14, 1735328473);
|
||||
$this->b = $this->gg($this->b, $this->c, $this->d, $this->a, $x[$i+12], 20, -1926607734);
|
||||
|
||||
$this->a = $this->hh($this->a, $this->b, $this->c, $this->d, $x[$i+ 5], 4 , -378558);
|
||||
$this->d = $this->hh($this->d, $this->a, $this->b, $this->c, $x[$i+ 8], 11, -2022574463);
|
||||
$this->c = $this->hh($this->c, $this->d, $this->a, $this->b, $x[$i+11], 16, 1839030562);
|
||||
$this->b = $this->hh($this->b, $this->c, $this->d, $this->a, $x[$i+14], 23, -35309556);
|
||||
$this->a = $this->hh($this->a, $this->b, $this->c, $this->d, $x[$i+ 1], 4 , -1530992060);
|
||||
$this->d = $this->hh($this->d, $this->a, $this->b, $this->c, $x[$i+ 4], 11, 1272893353);
|
||||
$this->c = $this->hh($this->c, $this->d, $this->a, $this->b, $x[$i+ 7], 16, -155497632);
|
||||
$this->b = $this->hh($this->b, $this->c, $this->d, $this->a, $x[$i+10], 23, -1094730640);
|
||||
$this->a = $this->hh($this->a, $this->b, $this->c, $this->d, $x[$i+13], 4 , 681279174);
|
||||
$this->d = $this->hh($this->d, $this->a, $this->b, $this->c, $x[$i+ 0], 11, -358537222);
|
||||
$this->c = $this->hh($this->c, $this->d, $this->a, $this->b, $x[$i+ 3], 16, -722521979);
|
||||
$this->b = $this->hh($this->b, $this->c, $this->d, $this->a, $x[$i+ 6], 23, 76029189);
|
||||
$this->a = $this->hh($this->a, $this->b, $this->c, $this->d, $x[$i+ 9], 4 , -640364487);
|
||||
$this->d = $this->hh($this->d, $this->a, $this->b, $this->c, $x[$i+12], 11, -421815835);
|
||||
$this->c = $this->hh($this->c, $this->d, $this->a, $this->b, $x[$i+15], 16, 530742520);
|
||||
$this->b = $this->hh($this->b, $this->c, $this->d, $this->a, $x[$i+ 2], 23, -995338651);
|
||||
|
||||
$this->a = $this->ii($this->a, $this->b, $this->c, $this->d, $x[$i+ 0], 6 , -198630844);
|
||||
$this->d = $this->ii($this->d, $this->a, $this->b, $this->c, $x[$i+ 7], 10, 1126891415);
|
||||
$this->c = $this->ii($this->c, $this->d, $this->a, $this->b, $x[$i+14], 15, -1416354905);
|
||||
$this->b = $this->ii($this->b, $this->c, $this->d, $this->a, $x[$i+ 5], 21, -57434055);
|
||||
$this->a = $this->ii($this->a, $this->b, $this->c, $this->d, $x[$i+12], 6 , 1700485571);
|
||||
$this->d = $this->ii($this->d, $this->a, $this->b, $this->c, $x[$i+ 3], 10, -1894986606);
|
||||
$this->c = $this->ii($this->c, $this->d, $this->a, $this->b, $x[$i+10], 15, -1051523);
|
||||
$this->b = $this->ii($this->b, $this->c, $this->d, $this->a, $x[$i+ 1], 21, -2054922799);
|
||||
$this->a = $this->ii($this->a, $this->b, $this->c, $this->d, $x[$i+ 8], 6 , 1873313359);
|
||||
$this->d = $this->ii($this->d, $this->a, $this->b, $this->c, $x[$i+15], 10, -30611744);
|
||||
$this->c = $this->ii($this->c, $this->d, $this->a, $this->b, $x[$i+ 6], 15, -1560198380);
|
||||
$this->b = $this->ii($this->b, $this->c, $this->d, $this->a, $x[$i+13], 21, 1309151649);
|
||||
$this->a = $this->ii($this->a, $this->b, $this->c, $this->d, $x[$i+ 4], 6 , -145523070);
|
||||
$this->d = $this->ii($this->d, $this->a, $this->b, $this->c, $x[$i+11], 10, -1120210379);
|
||||
$this->c = $this->ii($this->c, $this->d, $this->a, $this->b, $x[$i+ 2], 15, 718787259);
|
||||
$this->b = $this->ii($this->b, $this->c, $this->d, $this->a, $x[$i+ 9], 21, -343485551);
|
||||
|
||||
$this->a = $this->add($this->a, $olda);
|
||||
$this->b = $this->add($this->b, $oldb);
|
||||
$this->c = $this->add($this->c, $oldc);
|
||||
$this->d = $this->add($this->d, $oldd);
|
||||
}
|
||||
|
||||
return $this->rhex($this->a) . $this->rhex($this->b) . $this->rhex($this->c) . $this->rhex($this->d);
|
||||
}
|
||||
}
|
||||
|
||||
Class EncodingKey {
|
||||
var $clMD5;
|
||||
|
||||
function EncodingKey() {
|
||||
$this->clMD5 = new HashMD5();
|
||||
}
|
||||
|
||||
function giveHashCode($pkey, $second, $email, $refid, $montant, $nom) {
|
||||
|
||||
$modulo = $second % 4;
|
||||
|
||||
switch($modulo) {
|
||||
case 0:
|
||||
$select = $montant;
|
||||
break;
|
||||
case 1:
|
||||
$select = $email;
|
||||
break;
|
||||
case 2:
|
||||
$select = $refid;
|
||||
break;
|
||||
case 3:
|
||||
$select = $nom;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return $this->clMD5->hash($pkey.$refid.$select);
|
||||
}
|
||||
|
||||
function giveHashCode2($pkey, $second, $email, $refid, $montant, $nom) {
|
||||
$modulo = $second % 4;
|
||||
|
||||
switch($modulo) {
|
||||
case 0:
|
||||
$select = $montant;
|
||||
break;
|
||||
case 1:
|
||||
$select = $email;
|
||||
break;
|
||||
case 2:
|
||||
$select = $refid;
|
||||
break;
|
||||
case 3:
|
||||
$select = $nom;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
//echo "String PHP : ".$pkey.$refid.$montant.$email.$select."<br>";
|
||||
|
||||
return $this->clMD5->hash($pkey.$refid.$montant.$email.$select);
|
||||
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -1,473 +0,0 @@
|
||||
<?php
|
||||
|
||||
class fianet_sender
|
||||
{
|
||||
var $mode = null;
|
||||
var $orders = array();
|
||||
|
||||
function fianet_sender()
|
||||
{
|
||||
}
|
||||
|
||||
function add_order($order)
|
||||
{
|
||||
if (!is_array($order))
|
||||
{
|
||||
if (var_is_object_of_class($order, 'fianet_order_xml'))
|
||||
{
|
||||
$this->orders[] = $order;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach ($order as $o)
|
||||
{
|
||||
if (var_is_object_of_class($o, 'fianet_order_xml'))
|
||||
{
|
||||
$this->orders[] = $o;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Envoie toutes les commandes une par une
|
||||
function send_orders_singet()
|
||||
{
|
||||
if (!count($this->orders) > 0)
|
||||
{
|
||||
fianet_insert_log("fianet_sender.php - send_orders_singet() <br />\nNo order to send.");
|
||||
return;
|
||||
}
|
||||
if (!$this->check_order_data())
|
||||
{
|
||||
fianet_insert_log("fianet_sender.php - send_orders_singet() <br />\nOrders list is not valid.");
|
||||
return;
|
||||
}
|
||||
|
||||
foreach ($this->orders as $order)
|
||||
{
|
||||
$xml = '<?xml version="1.0" encoding="'. FIANET_ENCODING . '" ?>' . "\n";
|
||||
$xml .= $order->get_xml();
|
||||
$data['siteid'] = $order->info_commande->siteid;
|
||||
$data['controlcallback'] = clean_xml($xml);
|
||||
$this->send_fsock_singet($data);
|
||||
}
|
||||
}
|
||||
|
||||
//Envoie les commandes par lot de 25
|
||||
function send_orders_stacking()
|
||||
{
|
||||
if (!count($this->orders) > 0)
|
||||
{
|
||||
fianet_insert_log("fianet_sender.php - send_orders_stackfast() <br />\nNo order to send.");
|
||||
return;
|
||||
}
|
||||
if (!$this->check_order_data())
|
||||
{
|
||||
fianet_insert_log("fianet_sender.php - send_orders_stackfast() <br />\nOrders list is not valid.");
|
||||
return;
|
||||
}
|
||||
$stack = array();
|
||||
$count = 0;
|
||||
$results = array();
|
||||
foreach ($this->orders as $order)
|
||||
{
|
||||
if ($count < 25)
|
||||
{
|
||||
$count++;
|
||||
$stack[] = $order;
|
||||
}
|
||||
elseif ($count == 25)
|
||||
{
|
||||
|
||||
$results = array_merge($results, $this->process_stack($stack));
|
||||
$stack = array();
|
||||
$stack[] = $order;
|
||||
$count = 1;
|
||||
}
|
||||
}
|
||||
$results = array_merge($results, $this->process_stack($stack));
|
||||
return ($results);
|
||||
}
|
||||
|
||||
//Recupère une liste d'évaluations
|
||||
function get_evaluation($order_list, $Separ = ',')
|
||||
{
|
||||
$evaluations = array();
|
||||
if (count($order_list) > 0)
|
||||
{
|
||||
$order_list_by_stack = array_chunk($order_list, 50, true);
|
||||
foreach ($order_list_by_stack as $stack)
|
||||
{
|
||||
$evaluations = array_merge($this->get_evaluation_by_stack($stack, $Separ), $evaluations);
|
||||
}
|
||||
}
|
||||
return ($evaluations);
|
||||
}
|
||||
|
||||
|
||||
function get_evaluation_by_stack($order_list, $Separ = ',')
|
||||
{
|
||||
if (count($order_list) > 0)
|
||||
{
|
||||
if ($this->mode == 'production')
|
||||
{
|
||||
$url = URL_SAC_PROD;
|
||||
}
|
||||
else
|
||||
{
|
||||
$url = URL_SAC_TEST;
|
||||
}
|
||||
$siteid = FIANET_SAC_SITE_ID;
|
||||
$pwd = FIANET_SAC_PWD;
|
||||
$mode = 'mini';
|
||||
$repFT = '0';
|
||||
$listID = '';
|
||||
foreach ($order_list as $id_order)
|
||||
{
|
||||
if ($listID != '')
|
||||
{
|
||||
$listID .= $Separ . $id_order;
|
||||
}
|
||||
else
|
||||
{
|
||||
$listID .= $id_order;
|
||||
}
|
||||
}
|
||||
$data['SiteID'] = $siteid;
|
||||
$data['Pwd'] = $pwd;
|
||||
$data['Mode'] = $mode;
|
||||
$data['RepFT'] = $repFT;
|
||||
$data['ListID'] = $listID;
|
||||
$data['Separ'] = $Separ;
|
||||
|
||||
$s = new fianet_socket($url, URl_SAC_GETVALIDSTACK, 'POST', $data);
|
||||
$result = $s->send();
|
||||
$evaluations = array();
|
||||
if ($result === false)
|
||||
{
|
||||
fianet_insert_log("fianet_sender.php - get_evaluation() <br />\nError when opening file : <br />\n".$url);
|
||||
}
|
||||
else
|
||||
{
|
||||
$xmldata = $result['data'];
|
||||
$xml_array = xml2array($xmldata);
|
||||
//debug($xml_array);
|
||||
$evaluations = $this->process_result($xml_array);
|
||||
return ($evaluations);
|
||||
}
|
||||
return ($evaluations);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
méthodes privées
|
||||
*/
|
||||
|
||||
function process_result($xml_array)
|
||||
{
|
||||
$evaluations = array();
|
||||
//debug($xml_array, 'xml_array');
|
||||
if (isset($xml_array['stack']['result']))
|
||||
{
|
||||
if (isset($xml_array['stack']['result'][0]))
|
||||
{
|
||||
foreach ($xml_array['stack']['result'] as $res)
|
||||
{
|
||||
if (eregi("error", $res['attr']['retour']))
|
||||
{
|
||||
fianet_insert_log("fianet_sender.php - process_result() <br />\nErreur : <br />\n".$res['attr']['message']);
|
||||
}
|
||||
else
|
||||
{
|
||||
//$index = count($evaluations);
|
||||
//$evaluations[$index] = $this->process_result_array($res);
|
||||
$eval = $this->process_result_array($res);
|
||||
if ($eval['refid'] != null)
|
||||
{
|
||||
$evaluations[$eval['refid']] = $eval;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$res = $xml_array['stack']['result'];
|
||||
if (eregi("error", $res['attr']['retour']))
|
||||
{
|
||||
fianet_insert_log("fianet_sender.php - process_result() <br />\nErreur : <br />\n".$res['attr']['message']);
|
||||
}
|
||||
else
|
||||
{
|
||||
//$index = count($evaluations);
|
||||
$eval = $this->process_result_array($res);
|
||||
if ($eval['refid'] != null)
|
||||
{
|
||||
$evaluations[$eval['refid']] = $eval;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (isset($xml_array['result']['transaction']))
|
||||
{
|
||||
if (isset($xml_array['result']['transaction'][0]))
|
||||
{
|
||||
foreach ($xml_array['result']['transaction'] as $transaction)
|
||||
{
|
||||
$eval = $this->process_transaction_array($transaction);
|
||||
//debug($eval);
|
||||
if ($eval['refid'] != null)
|
||||
{
|
||||
$evaluations[$eval['refid']] = $eval;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$transaction = $xml_array['result']['transaction'];
|
||||
$eval = $this->process_transaction_array($transaction);
|
||||
if ($eval['refid'] != null)
|
||||
{
|
||||
$evaluations[$eval['refid']] = $eval;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return ($evaluations);
|
||||
}
|
||||
|
||||
function process_result_array($res)
|
||||
{
|
||||
//debug($res, 'Result');
|
||||
$eval['refid'] = $res['attr']['refid'];
|
||||
if ( $res['attr']['retour'] == 'absente')
|
||||
{
|
||||
$eval['info'] = 'absente';
|
||||
}
|
||||
else
|
||||
{
|
||||
if (isset($res['transaction'][0]))
|
||||
{
|
||||
$transaction = end($res['transaction']);
|
||||
}
|
||||
else
|
||||
{
|
||||
$transaction = $res['transaction'];
|
||||
}
|
||||
$etat = $this->process_transaction_array($transaction);
|
||||
$eval['eval'] = $etat['eval'];
|
||||
$eval['info'] = $etat['info'];
|
||||
$eval['cid'] = $etat['cid'];
|
||||
}
|
||||
return ($eval);
|
||||
}
|
||||
|
||||
function process_transaction_array($transaction)
|
||||
{
|
||||
$eval = array();
|
||||
//debug($transaction);
|
||||
|
||||
if ($transaction['attr']['avancement'] == 'error')
|
||||
{
|
||||
$eval['eval'] = 'error';
|
||||
$eval['info'] = $transaction['detail']['value'];
|
||||
$eval['cid'] = '';
|
||||
$eval['refid'] = $transaction['attr']['refid'];
|
||||
}
|
||||
elseif ($transaction['attr']['avancement'] == 'encours')
|
||||
{
|
||||
$eval['eval'] = 'encours';
|
||||
$eval['info'] = $transaction['detail']['value'];
|
||||
$eval['cid'] = '';
|
||||
$eval['refid'] = $transaction['attr']['refid'];
|
||||
}
|
||||
elseif ($transaction['attr']['avancement'] == 'traitee')
|
||||
{
|
||||
$eval['eval'] = $transaction['analyse']['eval']['value'];
|
||||
$eval['info'] = $transaction['analyse']['eval']['attr']['info'];
|
||||
$eval['cid'] = $transaction['attr']['cid'];
|
||||
$eval['refid'] = $transaction['attr']['refid'];
|
||||
}
|
||||
|
||||
return ($eval);
|
||||
}
|
||||
|
||||
function process_stack($stack)
|
||||
{
|
||||
$xml = '<?xml version="1.0" encoding="'. FIANET_ENCODING . '" ?>' . "\n";
|
||||
$xml .= '<stack>' . "\n";
|
||||
foreach ($stack as $order)
|
||||
{
|
||||
$xml .= $order->get_xml();
|
||||
if (!isset($siteid))
|
||||
{
|
||||
$siteid = $order->info_commande->siteid;
|
||||
}
|
||||
}
|
||||
$xml .= '</stack>';
|
||||
$data['siteid'] = $siteid;
|
||||
$data['controlcallback'] = clean_xml($xml);
|
||||
$result = array();
|
||||
$result = $this->send_fsock_stacking($data);
|
||||
return ($result);
|
||||
}
|
||||
|
||||
function process_result_stacking($xml_data)
|
||||
{
|
||||
$result = array();
|
||||
$xml_array = xml2array($xml_data);
|
||||
//debug($xml_array);
|
||||
if (isset($xml_array['validstack']['unluck']))
|
||||
{
|
||||
fianet_insert_log("fianet_sender.php - process_result_stacking() <br />\nError : <br />\n".$xml_array['validstack']['unluck']['value']);
|
||||
return ($result);
|
||||
}
|
||||
elseif (isset($xml_array['validstack']['result']))
|
||||
{
|
||||
$xml_array = $xml_array['validstack']['result'];
|
||||
//debug($xml_array);
|
||||
if (isset($xml_array[0]))
|
||||
{
|
||||
foreach ($xml_array as $transaction_result)
|
||||
{
|
||||
$index = count($result);
|
||||
$result[$index]['refid'] = $transaction_result['attr']['refid'];
|
||||
$result[$index]['etat'] = $transaction_result['attr']['avancement'];
|
||||
$result[$index]['details'] = $transaction_result['detail']['value'];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$index = count($result);
|
||||
$result[$index]['refid'] = $xml_array['attr']['refid'];
|
||||
$result[$index]['etat'] = $xml_array['attr']['avancement'];
|
||||
$result[$index]['details'] = $xml_array['detail']['value'];
|
||||
}
|
||||
}
|
||||
return ($result);
|
||||
}
|
||||
|
||||
function check_order_data()
|
||||
{
|
||||
$res = true;
|
||||
foreach ($this->orders as $order)
|
||||
{
|
||||
if (!var_is_object_of_class($order, 'fianet_order_xml'))
|
||||
{
|
||||
$res = false;
|
||||
}
|
||||
}
|
||||
return ($res);
|
||||
}
|
||||
|
||||
function send_fsock_singet($data)
|
||||
{
|
||||
if ($this->mode == 'production')
|
||||
{
|
||||
$url_action = URL_SAC_PROD;
|
||||
}
|
||||
else
|
||||
{
|
||||
$url_action = URL_SAC_TEST;
|
||||
}
|
||||
$path = URl_SAC_SINGET;
|
||||
|
||||
$s = new fianet_socket($url_action, $path, 'GET', $data);
|
||||
$res = $s->send();
|
||||
if ($res === false)
|
||||
{
|
||||
fianet_insert_log("fianet_sender.php - send_fsock_post() <br />\nError when connecting : <br />\n".$url_action . $path);
|
||||
return (false);
|
||||
}
|
||||
return (true);
|
||||
}
|
||||
|
||||
function send_fsock_stacking($data)
|
||||
{
|
||||
if ($this->mode == 'production')
|
||||
{
|
||||
$url_action = URL_SAC_PROD;
|
||||
}
|
||||
else
|
||||
{
|
||||
$url_action = URL_SAC_TEST;
|
||||
}
|
||||
$path = URl_SAC_STACKING;
|
||||
|
||||
$s = new fianet_socket($url_action, $path, 'POST', $data);
|
||||
$res = $s->send();
|
||||
if ($res === false)
|
||||
{
|
||||
fianet_insert_log("fianet_sender.php - send_fsock_post() <br />\nError when connecting : <br />\n".$url_action . $path);
|
||||
return (false);
|
||||
}
|
||||
else
|
||||
{
|
||||
$result = $this->process_result_stacking($res['data']);
|
||||
return ($result);
|
||||
}
|
||||
}
|
||||
|
||||
function get_reevaluated_order()
|
||||
{
|
||||
if ($this->mode == 'production')
|
||||
{
|
||||
$url_action = URL_SAC_PROD;
|
||||
}
|
||||
else
|
||||
{
|
||||
$url_action = URL_SAC_TEST;
|
||||
}
|
||||
$path = URl_SAC_GETALERT;
|
||||
$mode = 'new';
|
||||
$output = 'mini';
|
||||
$repFT = '0';
|
||||
|
||||
$data['SiteID'] = FIANET_SAC_SITE_ID;
|
||||
$data['Pwd'] = FIANET_SAC_PWD;
|
||||
$data['Mode'] = $mode;
|
||||
$data['Output'] = $output;
|
||||
$data['RepFT'] = $repFT;
|
||||
|
||||
$s = new fianet_socket($url_action, $path, "POST", $data);
|
||||
$res = $s->send();
|
||||
$evaluations = array();
|
||||
if ($res === false)
|
||||
{
|
||||
fianet_insert_log("fianet_sender.php - get_reevaluated_order() <br />\nError when opening file : <br />\n".$url);
|
||||
}
|
||||
else
|
||||
{
|
||||
$xmldata = $res['data'];
|
||||
//Le code commenté suivant permet de tester la réception d'une réevaluation
|
||||
/*$xmldata = '<?xml version="1.0" encoding="ISO-8859-1" ?>
|
||||
<result version="3.1" site="10" retour="trouvee" count="1">
|
||||
<transaction avancement="traitee" cid="95458898" refid="Refresh04">
|
||||
<detail>Paiement validé</detail>
|
||||
<analyse>
|
||||
<eval date="20/05/2008 10:27:46" critere="16" validation="Acheteur connu" info="acheteur certifié">100</eval>
|
||||
<classement id="1">Transactions à traiter/Nouvelles/Contrôle visuel</classement>
|
||||
</analyse>
|
||||
</transaction>
|
||||
<transaction avancement="traitee" cid="15458898" refid="Refresh05">
|
||||
<detail>Paiement validé</detail>
|
||||
<analyse>
|
||||
<eval date="20/05/2008 10:27:46" critere="16" validation="Acheteur connu" info="acheteur certifié">100</eval>
|
||||
<classement id="1">Transactions à traiter/Nouvelles/Contrôle visuel</classement>
|
||||
</analyse>
|
||||
</transaction>
|
||||
</result>';*/
|
||||
$xml_array = xml2array($xmldata);
|
||||
if (isset($xml_array['result']['attr']['retour']))
|
||||
{
|
||||
if ($xml_array['result']['attr']['retour'] == "param_error")
|
||||
{
|
||||
fianet_insert_log("fianet_sender.php - get_reevaluated_order() <br />\nParam_error : <br />\n".$xml_array['result']['attr']['message']."\n<br>$url_action");
|
||||
}
|
||||
}
|
||||
$evaluations = $this->process_result($xml_array);
|
||||
}
|
||||
return ($evaluations);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,235 +0,0 @@
|
||||
<?php
|
||||
|
||||
function process_result($xml_array)
|
||||
{
|
||||
$evaluations = array();
|
||||
//debug($xml_array, 'xml_array');
|
||||
if (isset($xml_array['stack']['result'][0]))
|
||||
{
|
||||
foreach ($xml_array['stack']['result'] as $res)
|
||||
{
|
||||
if (eregi("error", $res['attr']['retour']))
|
||||
{
|
||||
fianet_insert_log("fianet_sender.php - process_result() <br />\nErreur : <br />\n".$res['attr']['message']);
|
||||
}
|
||||
else
|
||||
{
|
||||
$index = count($evaluations);
|
||||
$evaluations[$index] = $this->process_result_array($res);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$res = $xml_array['stack']['result'];
|
||||
if (eregi("error", $res['attr']['retour']))
|
||||
{
|
||||
fianet_insert_log("fianet_sender.php - process_result() <br />\nErreur : <br />\n".$res['attr']['message']);
|
||||
}
|
||||
else
|
||||
{
|
||||
$index = count($evaluations);
|
||||
$evaluations[$index] = $this->process_result_array($res);
|
||||
}
|
||||
}
|
||||
return ($evaluations);
|
||||
}
|
||||
|
||||
function process_result_array($res)
|
||||
{
|
||||
//debug($res, 'Result');
|
||||
$eval['refid'] = $res['attr']['refid'];
|
||||
if ( $res['attr']['retour'] == 'absente')
|
||||
{
|
||||
$eval['info'] = 'absente';
|
||||
}
|
||||
else
|
||||
{
|
||||
if (isset($res['transaction'][0]))
|
||||
{
|
||||
$transaction = end($res['transaction']);
|
||||
}
|
||||
else
|
||||
{
|
||||
$transaction = $res['transaction'];
|
||||
}
|
||||
$etat = $this->process_transaction_array($transaction);
|
||||
$eval['eval'] = $etat['eval'];
|
||||
$eval['info'] = $etat['info'];
|
||||
$eval['cid'] = $etat['cid'];
|
||||
}
|
||||
return ($eval);
|
||||
}
|
||||
|
||||
function process_transaction_array($transaction)
|
||||
{
|
||||
$eval = array();
|
||||
//debug($transaction);
|
||||
|
||||
if ($transaction['attr']['avancement'] == 'error')
|
||||
{
|
||||
$eval['refid'] = $transaction['attr']['refid'];
|
||||
$eval['eval'] = 'error';
|
||||
$eval['info'] = $transaction['detail']['value'];
|
||||
$eval['cid'] = '';
|
||||
}
|
||||
elseif ($transaction['attr']['avancement'] == 'encours')
|
||||
{
|
||||
$eval['refid'] = $transaction['attr']['refid'];
|
||||
$eval['eval'] = 'encours';
|
||||
$eval['info'] = $transaction['detail']['value'];
|
||||
$eval['cid'] = '';
|
||||
}
|
||||
elseif ($transaction['attr']['avancement'] == 'traitee')
|
||||
{
|
||||
$eval['refid'] = $transaction['attr']['refid'];
|
||||
$eval['eval'] = $transaction['analyse']['eval']['value'];
|
||||
$eval['info'] = $transaction['analyse']['eval']['attr']['info'];
|
||||
$eval['cid'] = $transaction['attr']['cid'];
|
||||
}
|
||||
|
||||
return ($eval);
|
||||
}
|
||||
|
||||
function process_stack($stack)
|
||||
{
|
||||
$xml = '<?xml version="1.0" encoding="'. FIANET_ENCODING . '" ?>' . "\n";
|
||||
$xml .= '<stack>' . "\n";
|
||||
foreach ($stack as $order)
|
||||
{
|
||||
$xml .= $order->get_xml();
|
||||
if (!isset($siteid))
|
||||
{
|
||||
$siteid = $order->info_commande->siteid;
|
||||
}
|
||||
}
|
||||
$xml .= '</stack>';
|
||||
$data['siteid'] = $siteid;
|
||||
$data['controlcallback'] = clean_xml($xml);
|
||||
$this->send_fsock_stacking($data);
|
||||
}
|
||||
|
||||
function process_result_stacking($xml_data)
|
||||
{
|
||||
$result = array();
|
||||
$xml_array = xml2array($xml_data);
|
||||
//debug($xml_array);
|
||||
if (isset($xml_array['validstack']['unluck']))
|
||||
{
|
||||
fianet_insert_log("fianet_sender.php - process_result_stacking() <br />\nError : <br />\n".$xml_array['validstack']['unluck']['value']);
|
||||
return ($result);
|
||||
}
|
||||
elseif (isset($xml_array['validstack']['result']))
|
||||
{
|
||||
$xml_array = $xml_array['validstack']['result'];
|
||||
//debug($xml_array);
|
||||
if (isset($xml_array[0]))
|
||||
{
|
||||
foreach ($xml_array as $transaction_result)
|
||||
{
|
||||
$index = count($result);
|
||||
$result[$index]['refid'] = $transaction_result['attr']['refid'];
|
||||
$result[$index]['etat'] = $transaction_result['attr']['avancement'];
|
||||
$result[$index]['details'] = $transaction_result['detail']['value'];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$index = count($result);
|
||||
$result[$index]['refid'] = $xml_array['attr']['refid'];
|
||||
$result[$index]['etat'] = $xml_array['attr']['avancement'];
|
||||
$result[$index]['details'] = $xml_array['detail']['value'];
|
||||
}
|
||||
}
|
||||
return ($result);
|
||||
}
|
||||
|
||||
function check_order_data()
|
||||
{
|
||||
$res = true;
|
||||
foreach ($this->orders as $order)
|
||||
{
|
||||
if (!var_is_object_of_class($order, 'fianet_order_xml'))
|
||||
{
|
||||
$res = false;
|
||||
}
|
||||
}
|
||||
return ($res);
|
||||
}
|
||||
|
||||
function send_fsock_singet($data)
|
||||
{
|
||||
if ($mode == 'production')
|
||||
{
|
||||
$url_action = URL_SAC_PROD;
|
||||
}
|
||||
else
|
||||
{
|
||||
$url_action = URL_SAC_TEST;
|
||||
}
|
||||
$path = URl_SAC_SINGET;
|
||||
|
||||
$s = new fianet_socket($url_action, $path, 'GET', $data);
|
||||
$res = $s->send();
|
||||
if ($res === false)
|
||||
{
|
||||
fianet_insert_log("fianet_sender.php - send_fsock_post() <br />\nError when connecting : <br />\n".$url_action . $path);
|
||||
return (false);
|
||||
}
|
||||
return (true);
|
||||
}
|
||||
|
||||
function send_fsock_stacking($data)
|
||||
{
|
||||
if ($this->mode == 'production')
|
||||
{
|
||||
$url_action = URL_SAC_PROD;
|
||||
}
|
||||
else
|
||||
{
|
||||
$url_action = URL_SAC_TEST;
|
||||
}
|
||||
$path = URl_SAC_STACKING;
|
||||
|
||||
$s = new fianet_socket($url_action, $path, 'POST', $data);
|
||||
$res = $s->send();
|
||||
if ($res === false)
|
||||
{
|
||||
fianet_insert_log("fianet_sender.php - send_fsock_post() <br />\nError when connecting : <br />\n".$url_action . $path);
|
||||
return (false);
|
||||
}
|
||||
else
|
||||
{
|
||||
$result = $this->process_result_stacking($res['data']);
|
||||
//debug($result);
|
||||
return ($result);
|
||||
}
|
||||
}
|
||||
|
||||
function process_result_nostack($xml_array)
|
||||
{
|
||||
$evaluations = array();
|
||||
//debug($xml_array, 'xml_array');
|
||||
if (isset($xml_array['result']['transaction'][0]))
|
||||
{
|
||||
foreach ($xml_array['result']['transaction'] as $res)
|
||||
{
|
||||
$eval = $this->process_transaction_array($res);
|
||||
if ($eval['refid'] != null)
|
||||
{
|
||||
$evaluations[$eval['refid']] = $eval;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$res = $xml_array['result']['transaction'];
|
||||
$eval = $this->process_transaction_array($res);
|
||||
if ($eval['refid'] != null)
|
||||
{
|
||||
$evaluations[$eval['refid']] = $eval;
|
||||
}
|
||||
}
|
||||
return ($evaluations);
|
||||
}
|
||||
|
||||
@@ -1,172 +0,0 @@
|
||||
<?php
|
||||
|
||||
|
||||
class fianet_socket
|
||||
{
|
||||
var $host;
|
||||
var $port;
|
||||
|
||||
var $is_ssl = false;
|
||||
|
||||
var $method = 'GET';
|
||||
|
||||
var $data = array();
|
||||
var $path;
|
||||
|
||||
function fianet_socket($fianet_url, $fianet_file, $method = 'GET', $data = array())
|
||||
{
|
||||
if (is_array($data))
|
||||
{
|
||||
$this->data = $data;
|
||||
}
|
||||
$this->parse_fianet_url($fianet_url, $fianet_file);
|
||||
if (strtoupper($method) == 'GET' || strtoupper($method) == 'POST')
|
||||
{
|
||||
$this->method = strtoupper($method);
|
||||
}
|
||||
}
|
||||
|
||||
function parse_fianet_url($fianet_url, $fianet_file)
|
||||
{
|
||||
if (ereg("^http://", $fianet_url))
|
||||
{
|
||||
$this->is_ssl = false;
|
||||
$this->host = eregi_replace("http://([^/]+)/.+", "\\1", $fianet_url);
|
||||
$this->port = 80;
|
||||
$this->path = eregi_replace("http://[^/]+/", "/", $fianet_url) . $fianet_file;
|
||||
}
|
||||
if (ereg("^https://", $fianet_url))
|
||||
{
|
||||
$this->is_ssl = true;
|
||||
$this->host = eregi_replace("https://([^/]+)/.+", "\\1", $fianet_url);
|
||||
$this->port = 443;
|
||||
$this->path = eregi_replace("https://[^/]+/", "/", $fianet_url) . $fianet_file;
|
||||
}
|
||||
//debug($this->path);
|
||||
}
|
||||
|
||||
function determine_boundary()
|
||||
{
|
||||
srand((double)microtime() * 1000000);
|
||||
return ("---------------------".substr(md5(rand(0,32000)),0,10));
|
||||
}
|
||||
|
||||
function build_header($boundary, $data)
|
||||
{
|
||||
if ($this->method == 'POST')
|
||||
{
|
||||
$header = "POST ".$this->path." HTTP/1.0\r\n";
|
||||
$header .= "Host: ".$this->host."\r\n";
|
||||
$header .= "Content-type: application/x-www-form-urlencoded; boundary=$boundary\r\n";
|
||||
$header .= "Content-length: " . strlen($data) . "\r\n\r\n";
|
||||
}
|
||||
elseif ($this->method == 'GET')
|
||||
{
|
||||
if ($data != '')
|
||||
{
|
||||
if (strlen($this->path."?".$data) > 2048)
|
||||
{
|
||||
fianet_insert_log("fianet_socket.php - build_header() <br />\nMaximum length in get method reached(".strlen($this->path."?".$data).") : <br />\n".$this->path."?".$data);
|
||||
}
|
||||
$header = "GET ".$this->path."?".$data." HTTP/1.1\r\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
$header = "GET ".$this->path." HTTP/1.1\r\n";
|
||||
}
|
||||
$header .= "Host: ".$this->host."\r\n";
|
||||
$header .= "Connection: close\r\n\r\n";
|
||||
}
|
||||
return ($header);
|
||||
}
|
||||
|
||||
function build_data($boundary)
|
||||
{
|
||||
$data = "";
|
||||
foreach($this->data as $index => $value)
|
||||
{
|
||||
if ($data == '')
|
||||
{
|
||||
$data .= $index . '='. urlencode($value);
|
||||
}
|
||||
else
|
||||
{
|
||||
$data .= '&'.$index . '='. urlencode($value);
|
||||
}
|
||||
}
|
||||
return ($data);
|
||||
}
|
||||
|
||||
function send()
|
||||
{
|
||||
$boundary = $this->determine_boundary();
|
||||
$data = $this->build_data($boundary);
|
||||
$header = $this->build_header($boundary, $data);
|
||||
|
||||
//debug($header, 'header');
|
||||
//debug(htmlentities($data), 'data');
|
||||
$response = $this->connect($header, $data);
|
||||
if ($response != false)
|
||||
{
|
||||
$d['header'] = $response['header'];
|
||||
$d['data'] = htmlentities($response['data']);
|
||||
//debug($d, 'Réponse');
|
||||
}
|
||||
|
||||
return ($response);
|
||||
}
|
||||
|
||||
function connect($header, $data)
|
||||
{
|
||||
$res['header'] = "";
|
||||
$res['data'] = "";
|
||||
if ($this->is_ssl)
|
||||
{
|
||||
$host = 'ssl://'.$this->host . ':'.$this->port;
|
||||
$socket = fsockopen ('ssl://'.$this->host, $this->port);
|
||||
}
|
||||
else
|
||||
{
|
||||
$host = $this->host . ':' . $this->port;
|
||||
$socket = fsockopen ($this->host, $this->port);
|
||||
}
|
||||
if ($socket !== false)
|
||||
{
|
||||
$data_reached = false;
|
||||
if (@fputs($socket, $header.$data))
|
||||
{
|
||||
while (!feof($socket))
|
||||
{
|
||||
$line = fgets($socket);
|
||||
if (!$data_reached)
|
||||
{
|
||||
if ($line == "\r\n")
|
||||
{
|
||||
$data_reached = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
$res['header'] .= $line;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$res['data'] .= $line;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
fianet_insert_log("fianet_socket.php - connect() <br />\nEnvoie des données impossible sur : <br />\n".$host);
|
||||
$res = false;
|
||||
}
|
||||
fclose($socket);
|
||||
}
|
||||
else
|
||||
{
|
||||
fianet_insert_log("fianet_socket.php - connect() <br />\nConnexion socket impossible : <br />\n".$host);
|
||||
$res = false;
|
||||
}
|
||||
return ($res);
|
||||
}
|
||||
}
|
||||
@@ -1,76 +0,0 @@
|
||||
<?php
|
||||
|
||||
class fianet_adress_xml
|
||||
{
|
||||
var $type;
|
||||
var $format = 1;
|
||||
var $rue1;
|
||||
var $rue2;
|
||||
var $cpostal;
|
||||
var $ville;
|
||||
var $pays;
|
||||
var $appartement = null;
|
||||
|
||||
function get_xml()
|
||||
{
|
||||
$xml = '';
|
||||
if ($this->type != null)
|
||||
{
|
||||
$xml .= "\t" . '<adresse type="'.$this->type.'" format="'.$this->format.'">' . "\n";
|
||||
if ($this->rue1 != '')
|
||||
{
|
||||
$xml .= "\t\t" . '<rue1>'.clean_invalid_char($this->rue1).'</rue1>' . "\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
fianet_insert_log("fianet_adress_xml.php - get_xml() <br />\n rue1 is undefined");
|
||||
return;
|
||||
}
|
||||
if ($this->rue2 != "")
|
||||
{
|
||||
$xml .= "\t\t" . '<rue2>'.clean_invalid_char($this->rue2).'</rue2>' . "\n";
|
||||
}
|
||||
if ($this->cpostal != "")
|
||||
{
|
||||
$xml .= "\t\t" . '<cpostal>'.clean_invalid_char($this->cpostal).'</cpostal>' . "\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
fianet_insert_log("fianet_adress_xml.php - get_xml() <br />\n cpostal is undefined");
|
||||
return;
|
||||
}
|
||||
if ($this->ville != "")
|
||||
{
|
||||
$xml .= "\t\t" . '<ville>'.clean_invalid_char($this->ville).'</ville>' . "\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
fianet_insert_log("fianet_adress_xml.php - get_xml() <br />\n ville is undefined");
|
||||
return;
|
||||
}
|
||||
if ($this->pays != "")
|
||||
{
|
||||
$xml .= "\t\t" . '<pays>'.clean_invalid_char($this->pays).'</pays>' . "\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
fianet_insert_log("fianet_adress_xml.php - get_xml() <br />\n pays is undefined");
|
||||
return;
|
||||
}
|
||||
if ($this->appartement != null)
|
||||
{
|
||||
if (var_is_object_of_class($this->appartement, 'fianet_appartment_xml'))
|
||||
{
|
||||
$xml .= $this->appartement->get_xml();
|
||||
}
|
||||
else
|
||||
{
|
||||
fianet_insert_log("fianet_adress_xml.php - get_xml() <br />\nAppartement is not an object of type fianet_appartment_xml");
|
||||
}
|
||||
}
|
||||
$xml .= "\t" . '</adresse>' . "\n";
|
||||
}
|
||||
return ($xml);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,44 +0,0 @@
|
||||
<?php
|
||||
|
||||
class fianet_appartment_xml
|
||||
{
|
||||
var $digicode1;
|
||||
var $digicode2;
|
||||
var $escalier;
|
||||
var $etage;
|
||||
var $nporte;
|
||||
var $batiment;
|
||||
|
||||
function get_xml()
|
||||
{
|
||||
$xml = '';
|
||||
$xml .= "\t\t" . '<appartement>' . "\n";
|
||||
if ($this->digicode1 != '')
|
||||
{
|
||||
$xml .= "\t\t\t" . '<digicode1>'.clean_invalid_char($this->digicode1).'</digicode1>' . "\n";
|
||||
}
|
||||
if ($this->digicode2 != '')
|
||||
{
|
||||
$xml .= "\t\t\t" . '<digicode2>'.clean_invalid_char($this->digicode2).'</digicode2>' . "\n";
|
||||
}
|
||||
if ($this->escalier != '')
|
||||
{
|
||||
$xml .= "\t\t\t" . '<escalier>'.clean_invalid_char($this->escalier).'</escalier>' . "\n";
|
||||
}
|
||||
if ($this->etage != '')
|
||||
{
|
||||
$xml .= "\t\t\t" . '<etage>'.clean_invalid_char($this->etage).'</etage>' . "\n";
|
||||
}
|
||||
if ($this->nporte != '')
|
||||
{
|
||||
$xml .= "\t\t\t" . '<nporte>'.clean_invalid_char($this->nporte).'</nporte>' . "\n";
|
||||
}
|
||||
if ($this->batiment != '')
|
||||
{
|
||||
$xml .= "\t\t\t" . '<batiment>'.clean_invalid_char($this->batiment).'</batiment>' . "\n";
|
||||
}
|
||||
$xml .= "\t\t" . '</appartement>' . "\n";
|
||||
return ($xml);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
<?php
|
||||
|
||||
class fianet_billing_adress_xml extends fianet_adress_xml
|
||||
{
|
||||
var $type = 'facturation';
|
||||
|
||||
function fianet_billing_adress_xml($order = null)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
<?php
|
||||
|
||||
class fianet_billing_user_xml extends fianet_user_xml
|
||||
{
|
||||
var $type = 'facturation';
|
||||
|
||||
function fianet_billing_user_xml($order = null)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
<?php
|
||||
|
||||
class fianet_delivery_adress_xml extends fianet_adress_xml
|
||||
{
|
||||
var $type = 'livraison';
|
||||
|
||||
function fianet_delivery_adress_xml()
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
<?php
|
||||
|
||||
class fianet_delivery_user_xml extends fianet_user_xml
|
||||
{
|
||||
var $type = 'livraison';
|
||||
|
||||
function fianet_delivery_user_xml($order = null)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,50 +0,0 @@
|
||||
<?php
|
||||
class fianet_info_order_xml
|
||||
{
|
||||
var $siteid = 0;
|
||||
var $refid = 0;
|
||||
var $montant = 0;
|
||||
var $devise = "EUR";
|
||||
var $ip;
|
||||
var $timestamp;
|
||||
var $transport;
|
||||
var $list;
|
||||
|
||||
function fianet_info_order_xml()
|
||||
{
|
||||
$this->list = new fianet_product_list_xml();
|
||||
$this->transport = new fianet_transport_xml();
|
||||
$this->siteid = FIANET_SAC_SITE_ID;
|
||||
}
|
||||
|
||||
|
||||
function get_xml()
|
||||
{
|
||||
$xml = '';
|
||||
if (!($this->siteid != "" && $this->refid != "" && $this->montant > 0 && $this->devise != ""))
|
||||
{
|
||||
fianet_insert_log("fianet_info_order_xml.php - get_xml() <br />Somes values are undefined\n");
|
||||
}
|
||||
if ($this->transport == null)
|
||||
{
|
||||
fianet_insert_log("fianet_info_order_xml.php - get_xml() <br />Transport is undefined\n");
|
||||
}
|
||||
if ($this->list == null)
|
||||
{
|
||||
fianet_insert_log("fianet_info_order_xml.php - get_xml() <br />List products is undefined\n");
|
||||
}
|
||||
$xml .= "\t" . '<infocommande>' . "\n";
|
||||
$xml .= "\t\t" . '<siteid>'.$this->siteid.'</siteid>' . "\n";
|
||||
$xml .= "\t\t" . '<refid>'.$this->refid.'</refid>' . "\n";
|
||||
$xml .= "\t\t" . '<montant devise="'.$this->devise.'">'.number_format($this->montant, 2, '.', '').'</montant>' . "\n";
|
||||
if ($this->ip != null && $this->timestamp != null)
|
||||
{
|
||||
$xml .= "\t\t" . '<ip timestamp="'.$this->timestamp.'">'.$this->ip.'</ip>' . "\n";
|
||||
}
|
||||
$xml .= $this->transport->get_xml();
|
||||
$xml .= $this->list->get_xml();
|
||||
$xml .= "\t" . '</infocommande>' . "\n";
|
||||
return ($xml);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,68 +0,0 @@
|
||||
<?php
|
||||
|
||||
class fianet_order_xml
|
||||
{
|
||||
var $billing_user = null;
|
||||
var $billing_adress = null;
|
||||
var $info_commande = null;
|
||||
var $payment = null;
|
||||
|
||||
var $delivery_user = null;
|
||||
var $delivery_adress = null;
|
||||
|
||||
function fianet_order_xml()
|
||||
{
|
||||
$this->billing_user = new fianet_billing_user_xml();
|
||||
$this->billing_adress = new fianet_billing_adress_xml();
|
||||
$this->info_commande = new fianet_info_order_xml();
|
||||
$this->payment = new fianet_payment_xml();
|
||||
}
|
||||
|
||||
function reset()
|
||||
{
|
||||
$this->billing_user = new fianet_billing_user_xml();
|
||||
$this->delivery_user = null;
|
||||
$this->billing_adress = new fianet_billing_adress_xml();
|
||||
$this->delivery_adress = null;
|
||||
$this->info_commande = new fianet_info_order_xml();
|
||||
$this->payment = new fianet_payment_xml();
|
||||
}
|
||||
|
||||
function get_xml()
|
||||
{
|
||||
$xml = '';
|
||||
$xml .= '<control fianetmodule="'.FIANET_MODULE.'" version="'.FIANET_VERSION.'">' . "\n";
|
||||
$xml .= $this->billing_user->get_xml();
|
||||
$xml .= $this->billing_adress->get_xml();
|
||||
if ($this->delivery_user != null)
|
||||
{
|
||||
if (var_is_object_of_class($this->delivery_user, 'fianet_delivery_user_xml'))
|
||||
{
|
||||
$xml .= $this->delivery_user->get_xml();
|
||||
}
|
||||
else
|
||||
{
|
||||
fianet_insert_log("fianet_order_xml.php - get_xml() <br />\nDelivery user is not an object of type fianet_delivery_user_xml");
|
||||
}
|
||||
}
|
||||
if ($this->delivery_adress != null && ($this->info_commande->transport->type == 4 || $this->info_commande->transport->type == 5))
|
||||
{
|
||||
if (var_is_object_of_class($this->delivery_adress, 'fianet_delivery_adress_xml'))
|
||||
{
|
||||
$xml .= $this->delivery_adress->get_xml();
|
||||
}
|
||||
else
|
||||
{
|
||||
fianet_insert_log("fianet_order_xml.php - get_xml() <br />\nDelivery adress is not an object of type fianet_delivery_adress_xml");
|
||||
}
|
||||
}
|
||||
$xml .= $this->info_commande->get_xml();
|
||||
$xml .= $this->payment->get_xml();
|
||||
$xml .= '</control>';
|
||||
|
||||
save_flux_xml($xml, $this->info_commande->refid);
|
||||
return ($xml);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
<?php
|
||||
|
||||
class fianet_paraobject_xml
|
||||
{
|
||||
var $name;
|
||||
var $value;
|
||||
|
||||
function fianet_paraobject_xml($name, $value)
|
||||
{
|
||||
$this->name = $name;
|
||||
$this->value = $value;
|
||||
}
|
||||
|
||||
function get_xml()
|
||||
{
|
||||
$xml = "\t". '<obj>' . "\n";
|
||||
$xml .= "\t\t". '<name>'.$this->name.'</name>' . "\n";
|
||||
$xml .= "\t\t". '<value>'.$this->value.'</value>' . "\n";
|
||||
$xml .= "\t". '</obj>' . "\n";
|
||||
return ($xml);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,76 +0,0 @@
|
||||
<?php
|
||||
|
||||
class fianet_payment_xml
|
||||
{
|
||||
var $type;
|
||||
var $numcb;
|
||||
var $dateval;
|
||||
var $bin;
|
||||
var $bin4;
|
||||
var $bin42;
|
||||
|
||||
function fianet_payment_xml($order = null)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
function set_cb_number($cb, $dateval)
|
||||
{
|
||||
if (!eregi("^[0-9]{16}$", $cb))
|
||||
{
|
||||
fianet_insert_log("fianet_payment_xml.php - set_cb_number() <br />Cb number format is invalid, must be 00001111222233334444\n");
|
||||
}
|
||||
else if (!eregi("^[0-9]{2}/[0-9]{4}$", $dateval))
|
||||
{
|
||||
fianet_insert_log("fianet_payment_xml.php - set_cb_number() <br />Validity date format is invalid, must be MM/YYYY\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
$crypt = new HashMD5();
|
||||
$this->numcb = $crypt->hash($cb);
|
||||
$this->dateval = $crypt->hash($dateval);
|
||||
}
|
||||
}
|
||||
|
||||
function get_xml()
|
||||
{
|
||||
$xml = '';
|
||||
if ($this->type != null)
|
||||
{
|
||||
$xml .= "\t".'<paiement>'."\n";
|
||||
|
||||
$xml .= "\t\t".'<type>'.$this->type.'</type>'."\n";
|
||||
if ($this->type == 'carte' || $this->type == 'paypal')
|
||||
{
|
||||
if ($this->numcb != null)
|
||||
{
|
||||
$xml .= "\t\t".'<numcb>'.$this->numcb.'</numcb>'."\n";
|
||||
}
|
||||
if ($this->dateval != null)
|
||||
{
|
||||
$xml .= "\t\t".'<dateval>'.$this->dateval.'</dateval>'."\n";
|
||||
}
|
||||
if ($this->bin != null)
|
||||
{
|
||||
$xml .= "\t\t".'<bin>'.$this->bin.'</bin>'."\n";
|
||||
}
|
||||
if ($this->bin4 != null)
|
||||
{
|
||||
$xml .= "\t\t".'<bin4>'.$this->bin4.'</bin4>'."\n";
|
||||
}
|
||||
if ($this->bin42 != null)
|
||||
{
|
||||
$xml .= "\t\t".'<bin42>'.$this->bin42.'</bin42>'."\n";
|
||||
}
|
||||
}
|
||||
$xml .= "\t".'</paiement>'."\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
fianet_insert_log("fianet_payment_xml.php - get_xml() <br />Type is undefined\n");
|
||||
return;
|
||||
}
|
||||
return ($xml);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,49 +0,0 @@
|
||||
<?php
|
||||
|
||||
class fianet_product_list_xml
|
||||
{
|
||||
var $products_list = array();
|
||||
|
||||
function fianet_product_list_xml()
|
||||
{
|
||||
}
|
||||
|
||||
function add_product($product)
|
||||
{
|
||||
if (var_is_object_of_class($product, 'fianet_product_xml'))
|
||||
{
|
||||
$this->products_list[] = $product;
|
||||
}
|
||||
else
|
||||
{
|
||||
fianet_insert_log("fianet_product_list_xml.php - add_product() <br />Data are not a valid fianet_product_xml type\n");
|
||||
}
|
||||
}
|
||||
|
||||
function get_xml()
|
||||
{
|
||||
$xml = '';
|
||||
if (count($this->products_list) > 0)
|
||||
{
|
||||
|
||||
$xml .= "\t\t". '<list nbproduit="'.$this->count_nbproduct().'">' . "\n";
|
||||
foreach ($this->products_list as $product)
|
||||
{
|
||||
$xml .= $product->get_xml();
|
||||
}
|
||||
$xml .= "\t\t". '</list>' . "\n";
|
||||
}
|
||||
return ($xml);
|
||||
}
|
||||
|
||||
function count_nbproduct()
|
||||
{
|
||||
$n = 0;
|
||||
foreach ($this->products_list as $product)
|
||||
{
|
||||
$n += $product->nb;
|
||||
}
|
||||
return ($n);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,59 +0,0 @@
|
||||
<?php
|
||||
|
||||
class fianet_product_xml
|
||||
{
|
||||
var $type;
|
||||
var $ref;
|
||||
var $nb = 0;
|
||||
var $prixunit;
|
||||
var $name;
|
||||
|
||||
function fianet_product_xml()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
function get_xml()
|
||||
{
|
||||
$xml = '';
|
||||
if ($this->name != null)
|
||||
{
|
||||
$nb = '';
|
||||
$prixunit = '';
|
||||
if ($this->type != null)
|
||||
{
|
||||
$type = ' type="'.$this->type.'"';
|
||||
}
|
||||
else
|
||||
{
|
||||
fianet_insert_log("fianet_product_xml.php - get_xml() <br />\nproduct type is missing");
|
||||
return;
|
||||
}
|
||||
if ($this->ref != null)
|
||||
{
|
||||
$ref = ' ref="'.clean_invalid_char($this->ref).'"';
|
||||
}
|
||||
else
|
||||
{
|
||||
fianet_insert_log("fianet_product_xml.php - get_xml() <br />\nproduct ref is missing");
|
||||
return;
|
||||
}
|
||||
if ($this->nb != null)
|
||||
{
|
||||
$nb = ' nb="'.$this->nb.'"';
|
||||
}
|
||||
if ($this->prixunit != null)
|
||||
{
|
||||
$prixunit = ' prixunit="'.number_format($this->prixunit, 2, '.', '').'"';
|
||||
}
|
||||
$xml .= "\t\t\t<produit$type$ref$nb$prixunit>".clean_invalid_char($this->name)."</produit>\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
fianet_insert_log("fianet_product_xml.php - get_xml() <br />\nproduct name is missing");
|
||||
return;
|
||||
}
|
||||
return ($xml);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,36 +0,0 @@
|
||||
<?php
|
||||
class fianet_rnp_info_order_xml
|
||||
{
|
||||
var $siteid = 0;
|
||||
var $refid = 0;
|
||||
var $montant = 0;
|
||||
var $devise = 'EUR';
|
||||
var $transport;
|
||||
var $list;
|
||||
|
||||
function fianet_rnp_info_order_xml()
|
||||
{
|
||||
$this->list = new fianet_product_list_xml();
|
||||
$this->transport = new fianet_transport_xml();
|
||||
$this->siteid = FIANET_RNP_SITE_ID;
|
||||
}
|
||||
|
||||
function get_xml()
|
||||
{
|
||||
$xml = '';
|
||||
|
||||
if ($this->siteid == '' || $this->refid == '' || $this->montant <= 0 || $this->devise == '')
|
||||
{
|
||||
fianet_insert_log("fianet_rnp_info_order_xml.php - get_xml() <br />Somes values are undefined\n");
|
||||
}
|
||||
$xml .= "\t" . '<infocommande>' . "\n";
|
||||
$xml .= "\t\t" . '<siteid>'.$this->siteid.'</siteid>' . "\n";
|
||||
$xml .= "\t\t" . '<refid>'.$this->refid.'</refid>' . "\n";
|
||||
$xml .= "\t\t" . '<montant devise="'.$this->devise.'">'.number_format($this->montant, 2, '.', '').'</montant>' . "\n";
|
||||
$xml .= $this->transport->get_xml();
|
||||
$xml .= $this->list->get_xml();
|
||||
$xml .= "\t" . '</infocommande>' . "\n";
|
||||
return ($xml);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,142 +0,0 @@
|
||||
<?php
|
||||
|
||||
class fianet_rnp_order_xml
|
||||
{
|
||||
var $billing_user = null;
|
||||
var $billing_adress = null;
|
||||
var $info_commande = null;
|
||||
var $wallet = null;
|
||||
|
||||
var $delivery_user = null;
|
||||
var $delivery_adress = null;
|
||||
|
||||
function fianet_rnp_order_xml()
|
||||
{
|
||||
$this->billing_user = new fianet_billing_user_xml();
|
||||
$this->billing_adress = new fianet_billing_adress_xml();
|
||||
$this->info_commande = new fianet_rnp_info_order_xml();
|
||||
$this->wallet = new fianet_rnp_wallet_xml();
|
||||
}
|
||||
|
||||
function reset()
|
||||
{
|
||||
$this->billing_user = new fianet_billing_user_xml();
|
||||
$this->delivery_user = null;
|
||||
$this->billing_adress = new fianet_billing_adress_xml();
|
||||
$this->delivery_adress = null;
|
||||
$this->info_commande = new fianet_rnp_info_order_xml();
|
||||
$this->wallet = new fianet_rnp_wallet_xml();
|
||||
}
|
||||
|
||||
function get_xml()
|
||||
{
|
||||
$xml = '';
|
||||
$xml .= '<?xml version="1.0" encoding="'. FIANET_ENCODING . '" ?>' . "\n";
|
||||
$xml .= '<control fianetmodule="'.FIANET_MODULE.'" version="'.FIANET_VERSION.'">' . "\n";
|
||||
$xml .= $this->billing_user->get_xml();
|
||||
$xml .= $this->billing_adress->get_xml();
|
||||
if ($this->delivery_user != null)
|
||||
{
|
||||
if (var_is_object_of_class($this->delivery_user, 'fianet_delivery_user_xml'))
|
||||
{
|
||||
$xml .= $this->delivery_user->get_xml();
|
||||
}
|
||||
else
|
||||
{
|
||||
fianet_insert_log("fianet_rnp_order_xml.php - get_xml() <br />\nDelivery user is not an object of type fianet_delivery_user_xml");
|
||||
}
|
||||
}
|
||||
if ($this->delivery_adress != null && ($this->info_commande->transport->type == 4 || $this->info_commande->transport->type == 5))
|
||||
{
|
||||
if (var_is_object_of_class($this->delivery_adress, 'fianet_delivery_adress_xml'))
|
||||
{
|
||||
$xml .= $this->delivery_adress->get_xml();
|
||||
}
|
||||
else
|
||||
{
|
||||
fianet_insert_log("fianet_rnp_order_xml.php - get_xml() <br />\nDelivery adress is not an object of type fianet_delivery_adress_xml");
|
||||
}
|
||||
}
|
||||
$xml .= $this->info_commande->get_xml();
|
||||
|
||||
$this->wallet->generate_wallet_crypt_data($this->info_commande->refid, $this->billing_user->nom, $this->billing_user->email, $this->info_commande->montant);
|
||||
$xml .= $this->wallet->get_xml();
|
||||
|
||||
$xml .= '</control>';
|
||||
|
||||
save_flux_xml($xml, $this->info_commande->refid);
|
||||
return ($xml);
|
||||
}
|
||||
|
||||
/*
|
||||
Cette fonction génère le formulaire de redirection vers ReceiveAndPay
|
||||
Elle prends des paramètres optionnels
|
||||
url_call : url de retour sur le site marchand
|
||||
url_sys : url de réponse des tags asynchrone pour le serveur ReceiveAndPay
|
||||
ParamCallBack : tableau associatif des données que vous souhaitez voir retourner par le serveur ReceiveAndPay sur url_sys et url_call
|
||||
typeIHM : 1 pour carte bancaire seulement, 2 pour à crédit uniquement, 3 pour les deux en même temps
|
||||
enProd : mettre à true pour rediriger vers ReceiveAndPay de production
|
||||
auto_send : si true : génère un javascript qui soumettra immédiatement le formulaire
|
||||
*/
|
||||
function get_formular($url_call = null, $url_sys = null, $ParamCallBack = array(), $typeIHM = 3, $enProd = false, $auto_send = true)
|
||||
{
|
||||
|
||||
$flux = $this->get_xml();
|
||||
$flux = clean_xml($flux);
|
||||
$flux = str_replace('"', "'", $flux);
|
||||
$flux = str_replace('&', '&amp;', $flux);
|
||||
$flux = str_replace('<', '&lt;', $flux);
|
||||
$flux = str_replace('>', '&gt;', $flux);
|
||||
$my_hashmd5 = new HashMD5();
|
||||
//$toto = html_entity_decode($flux);
|
||||
//debug($toto);
|
||||
$checksum = $my_hashmd5->hash(html_entity_decode($flux));
|
||||
|
||||
if (is_array($ParamCallBack) && count($ParamCallBack) > 0)
|
||||
{
|
||||
$XMLParam = new fianet_xml_paracallback_builder();
|
||||
foreach ($ParamCallBack as $index => $value)
|
||||
{
|
||||
$XMLParam->add_param(new fianet_paraobject_xml($index, urlencode(htmlentities($value))));
|
||||
}
|
||||
}
|
||||
|
||||
if ($enProd)
|
||||
{
|
||||
$url = URL_RNP_PROD;
|
||||
}
|
||||
else
|
||||
{
|
||||
$url = URL_RNP_TEST;
|
||||
}
|
||||
$url .= URL_RNP_FRONTLINE;
|
||||
|
||||
$form = '';
|
||||
$form .= '<form name="RnPform" action="'.$url.'" method="post">';
|
||||
$form .= '<input type="hidden" name="MerchID" value="'. $this->info_commande->siteid .'">' . "\n";
|
||||
$form .= '<input type="hidden" name="XMLInfo" value="'. $flux .'">' . "\n";
|
||||
if ($url_call != null && $url_call != '')
|
||||
{
|
||||
$form .= '<input type="hidden" name="URLCall" value="'. $url_call .'">' . "\n";
|
||||
}
|
||||
if ($url_sys != null && $url_sys != '')
|
||||
{
|
||||
$form .= '<input type="hidden" name="URLSys" value="'. $url_sys .'">' . "\n";
|
||||
}
|
||||
if (isset($XMLParam))
|
||||
{
|
||||
$form .= '<input type="hidden" name="XMLParam" value="'.clean_xml(str_replace('"', "'", $XMLParam->get_xml())).'">' . "\n";
|
||||
}
|
||||
$form .= '<input type="hidden" name="CheckSum" value="'. $checksum .'">' . "\n";
|
||||
$form .= '<input type="hidden" name="TypeIHM" value="'. $typeIHM .'">' . "\n";
|
||||
$form .= '</form>';
|
||||
if ($auto_send)
|
||||
{
|
||||
$form .= '<script>document.RnPform.submit();</script>';
|
||||
}
|
||||
|
||||
return ($form);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,60 +0,0 @@
|
||||
<?php
|
||||
|
||||
class fianet_rnp_wallet_xml
|
||||
{
|
||||
var $version = '1.0';
|
||||
var $datelivr = null;
|
||||
var $datecom = null;
|
||||
var $crypt = null;
|
||||
var $crypt_version = '2.0';
|
||||
|
||||
var $order_date_time_seconds = null;
|
||||
|
||||
function fianet_rnp_wallet_xml()
|
||||
{
|
||||
//$this->datecom = "2008-05-28 14:25:31";
|
||||
$this->datecom = date("Y-m-d H:i:s");
|
||||
$this->order_date_time_seconds = substr($this->datecom, -2, 2);
|
||||
}
|
||||
|
||||
function generate_wallet_crypt_data($order_id, $billing_lastname, $customer_email, $total)
|
||||
{
|
||||
$total = number_format($total, 2, '.', '');
|
||||
$this->generate_crypt_key($order_id, $billing_lastname, $customer_email, $total);
|
||||
}
|
||||
|
||||
function get_xml()
|
||||
{
|
||||
$xml = '';
|
||||
|
||||
$xml .= "\t" . '<wallet version="'.$this->version.'">' . "\n";
|
||||
$xml .= "\t\t" . '<datelivr>'.$this->datelivr.'</datelivr>' . "\n";
|
||||
$xml .= "\t\t" . '<datecom>'.$this->datecom.'</datecom>' . "\n";
|
||||
$xml .= "\t\t" . '<crypt version="'.$this->crypt_version.'">'.$this->crypt.'</crypt>' . "\n";
|
||||
$xml .= "\t" . '</wallet>' . "\n";
|
||||
|
||||
return ($xml);
|
||||
}
|
||||
|
||||
function generate_crypt_key($order_id, $billing_lastname, $customer_email, $total)
|
||||
{
|
||||
if (FIANET_ENCODING == 'UTF-8')
|
||||
{
|
||||
$billing_lastname = utf8_decode($billing_lastname);
|
||||
}
|
||||
else
|
||||
{
|
||||
$billing_lastname = $billing_lastname;
|
||||
}
|
||||
$key = FIANET_RNP_KEY;
|
||||
|
||||
$encodingKey = new EncodingKey();
|
||||
$this->crypt = $encodingKey->giveHashCode2( $key,
|
||||
$this->order_date_time_seconds,
|
||||
$customer_email,
|
||||
$order_id,
|
||||
$total,
|
||||
$billing_lastname);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,42 +0,0 @@
|
||||
<?php
|
||||
|
||||
class fianet_transport_xml
|
||||
{
|
||||
var $type;
|
||||
var $nom;
|
||||
var $rapidite;
|
||||
|
||||
function fianet_transport_xml()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
function get_xml()
|
||||
{
|
||||
$xml = '';
|
||||
if ($this->type == null)
|
||||
{
|
||||
fianet_insert_log("fianet_transport_xml.php - get_xml() <br />\nTransport type undefined");
|
||||
return;
|
||||
}
|
||||
if ($this->nom == null)
|
||||
{
|
||||
fianet_insert_log("fianet_transport_xml.php - get_xml() <br />\nTransport name undefined");
|
||||
return;
|
||||
}
|
||||
if ($this->rapidite == null)
|
||||
{
|
||||
fianet_insert_log("fianet_transport_xml.php - get_xml() <br />\nTransport time undefined");
|
||||
return;
|
||||
}
|
||||
$xml .= "\t\t". '<transport>' . "\n";
|
||||
|
||||
$xml .= "\t\t\t". '<type>'.$this->type.'</type>' . "\n";
|
||||
$xml .= "\t\t\t". '<nom>'.clean_invalid_char($this->nom).'</nom>' . "\n";
|
||||
$xml .= "\t\t\t". '<rapidite>'.$this->rapidite.'</rapidite>' . "\n";
|
||||
|
||||
$xml .= "\t\t". '</transport>' . "\n";
|
||||
return ($xml);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,29 +0,0 @@
|
||||
<?php
|
||||
|
||||
class fianet_user_siteconso_xml
|
||||
{
|
||||
var $nb = 0;
|
||||
var $ca = 0;
|
||||
var $datepremcmd = null;
|
||||
var $datederncmd = null;
|
||||
|
||||
function fianet_user_siteconso_xml()
|
||||
{
|
||||
}
|
||||
|
||||
function get_xml()
|
||||
{
|
||||
$xml = '';
|
||||
if ($this->nb > 0)
|
||||
{
|
||||
$xml .= "\t\t" . '<siteconso>' . "\n";
|
||||
$xml .= "\t\t\t" . '<nb>'.$this->nb.'</nb>' . "\n";
|
||||
$xml .= "\t\t\t" . '<ca>'.number_format($this->ca, 2, '.', '').'</ca>' . "\n";
|
||||
$xml .= "\t\t\t" . '<datepremcmd>'.$this->datepremcmd.'</datepremcmd>' . "\n";
|
||||
$xml .= "\t\t\t" . '<datederncmd>'.$this->datederncmd.'</datederncmd>' . "\n";
|
||||
$xml .= "\t\t" . '</siteconso>' . "\n";
|
||||
}
|
||||
return ($xml);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,80 +0,0 @@
|
||||
<?php
|
||||
|
||||
class fianet_user_xml
|
||||
{
|
||||
var $type;
|
||||
//Qualité des clients par défaut
|
||||
var $qualite = 2;
|
||||
var $titre;
|
||||
var $nom;
|
||||
var $prenom;
|
||||
var $societe;
|
||||
var $telhome;
|
||||
var $teloffice;
|
||||
var $telmobile;
|
||||
var $telfax;
|
||||
var $email;
|
||||
var $site_conso = null;
|
||||
|
||||
function set_quality_professional()
|
||||
{
|
||||
$this->qualite = 1;
|
||||
}
|
||||
|
||||
function set_quality_nonprofessional()
|
||||
{
|
||||
$this->qualite = 2;
|
||||
}
|
||||
|
||||
function get_xml()
|
||||
{
|
||||
$xml = '';
|
||||
$xml .= "\t" . '<utilisateur type="'.$this->type.'" qualite="'.$this->qualite.'">' . "\n";
|
||||
if ($this->titre != '')
|
||||
{
|
||||
if ($this->titre == 'f')
|
||||
{
|
||||
$this->titre = 'mme';
|
||||
}
|
||||
$xml .= "\t\t" . '<nom titre="'.$this->titre.'">'.clean_invalid_char($this->nom).'</nom>' . "\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
$xml .= "\t\t" . '<nom>'.clean_invalid_char($this->nom).'</nom>' . "\n";
|
||||
}
|
||||
$xml .= "\t\t" . '<prenom>'.clean_invalid_char($this->prenom).'</prenom>' . "\n";
|
||||
if ($this->societe != '')
|
||||
{
|
||||
$xml .= "\t\t" . '<societe>'.clean_invalid_char($this->societe).'</societe>' . "\n";
|
||||
}
|
||||
if ($this->telhome != '')
|
||||
{
|
||||
$xml .= "\t\t" . '<telhome>'.clean_invalid_char($this->telhome).'</telhome>' . "\n";
|
||||
}
|
||||
if ($this->teloffice != '')
|
||||
{
|
||||
$xml .= "\t\t" . '<teloffice>'.clean_invalid_char($this->teloffice).'</teloffice>' . "\n";
|
||||
}
|
||||
if ($this->telmobile != '')
|
||||
{
|
||||
$xml .= "\t\t" . '<telmobile>'.clean_invalid_char($this->telmobile).'</telmobile>' . "\n";
|
||||
}
|
||||
if ($this->telfax != '')
|
||||
{
|
||||
$xml .= "\t\t" . '<telfax>'.clean_invalid_char($this->telfax).'</telfax>' . "\n";
|
||||
}
|
||||
if ($this->email != '')
|
||||
{
|
||||
$xml .= "\t\t" . '<email>'.clean_invalid_char($this->email).'</email>' . "\n";
|
||||
}
|
||||
if ($this->site_conso != null)
|
||||
{
|
||||
$xml .= $this->site_conso->get_xml();
|
||||
}
|
||||
$xml .= "\t" . '</utilisateur>' . "\n";
|
||||
|
||||
return ($xml);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,44 +0,0 @@
|
||||
<?php
|
||||
|
||||
class fianet_xml_paracallback_builder
|
||||
{
|
||||
var $param_list = array();
|
||||
|
||||
function fianet_xml_paracallback_builder()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
function add_param($param)
|
||||
{
|
||||
if (var_is_object_of_class($param, 'fianet_paraobject_xml'))
|
||||
{
|
||||
$this->param_list[] = $param;
|
||||
}
|
||||
else
|
||||
{
|
||||
fianet_insert_log("Erreur : le paramètre n'est pas un objet fianet_paraobject_xml mais un objet : ".get_class($param)."<br>");
|
||||
}
|
||||
}
|
||||
|
||||
function get_xml()
|
||||
{
|
||||
$xml = '';
|
||||
|
||||
if (count($this->param_list) > 0)
|
||||
{
|
||||
$xml .= '<?xml version="1.0" encoding="'.FIANET_ENCODING.'" ?>
|
||||
<ParamCBack>' . "\n";
|
||||
|
||||
foreach ($this->param_list as $param)
|
||||
{
|
||||
$xml .= $param->get_xml();
|
||||
}
|
||||
|
||||
$xml .= '</ParamCBack>' . "\n";
|
||||
}
|
||||
|
||||
return($xml);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
<?php
|
||||
|
||||
define('FIANET_VERSION', '2.5');
|
||||
define('FIANET_MODULE', 'api_php');
|
||||
@@ -1,6 +0,0 @@
|
||||
<?php
|
||||
define('URL_RNP_PROD', 'https://secure.fia-net.com/wallet');
|
||||
define('URL_RNP_TEST', 'https://secure.fia-net.com/walter');
|
||||
|
||||
define('URL_RNP_FRONTLINE', '/engine/frontline.cgi');
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
<?php
|
||||
define('URL_SAC_PROD', 'https://secure.fia-net.com/fscreener/');
|
||||
define('URL_SAC_TEST', 'https://secure.fia-net.com/pprod/');
|
||||
|
||||
define('URl_SAC_SINGET', '/engine/singet.cgi');
|
||||
define('URl_SAC_STACKING', '/engine/stacking.cgi');
|
||||
define('URl_SAC_GETVALIDSTACK', '/engine/get_validstack.cgi');
|
||||
define('URl_SAC_GETALERT', '/engine/get_alert.cgi');
|
||||
|
||||
define('FIANET_MAX_DELIVERY_TIME', 23);
|
||||
@@ -1,49 +0,0 @@
|
||||
<?php
|
||||
|
||||
define('RELATIVE_PATH', dirname(__FILE__).'/');
|
||||
define('FIANET_ENCODING','ISO-8859-1');
|
||||
|
||||
define('FIANET_SAC_SITE_ID', Configuration::get('SAC_SITEID'));
|
||||
define('FIANET_SAC_LOGIN', Configuration::get('SAC_LOGIN'));
|
||||
define('FIANET_SAC_PWD', Configuration::get('SAC_PASSWORD'));
|
||||
|
||||
define('FIANET_RNP_KEY', '');
|
||||
|
||||
require_once(RELATIVE_PATH . 'to_implement/implement.php');
|
||||
require_once(RELATIVE_PATH . 'const/fianet.php');
|
||||
require_once(RELATIVE_PATH . 'const/url_sac.php');
|
||||
require_once(RELATIVE_PATH . 'const/url_rnp.php');
|
||||
|
||||
require_once(RELATIVE_PATH . 'includes/debug.php');
|
||||
require_once(RELATIVE_PATH . 'includes/general.php');
|
||||
require_once(RELATIVE_PATH . 'includes/xml2array.php');
|
||||
|
||||
if (!class_exists('HashMd5', false))
|
||||
{
|
||||
require_once(RELATIVE_PATH . 'classes/fianet_key_64bits.php');
|
||||
//require_once(RELATIVE_PATH . 'classes/fianet_key_32bits.php');
|
||||
}
|
||||
require_once(RELATIVE_PATH . 'classes/fianet_sender.php');
|
||||
require_once(RELATIVE_PATH . 'classes/fianet_socket.php');
|
||||
require_once(RELATIVE_PATH . 'classes/order/fianet_adress_xml.php');
|
||||
require_once(RELATIVE_PATH . 'classes/order/fianet_billing_adress_xml.php');
|
||||
require_once(RELATIVE_PATH . 'classes/order/fianet_delivery_adress_xml.php');
|
||||
require_once(RELATIVE_PATH . 'classes/order/fianet_appartment_xml.php');
|
||||
require_once(RELATIVE_PATH . 'classes/order/fianet_user_xml.php');
|
||||
require_once(RELATIVE_PATH . 'classes/order/fianet_billing_user_xml.php');
|
||||
require_once(RELATIVE_PATH . 'classes/order/fianet_delivery_user_xml.php');
|
||||
require_once(RELATIVE_PATH . 'classes/order/fianet_info_order_xml.php');
|
||||
require_once(RELATIVE_PATH . 'classes/order/fianet_payment_xml.php');
|
||||
require_once(RELATIVE_PATH . 'classes/order/fianet_product_list_xml.php');
|
||||
require_once(RELATIVE_PATH . 'classes/order/fianet_product_xml.php');
|
||||
require_once(RELATIVE_PATH . 'classes/order/fianet_transport_xml.php');
|
||||
require_once(RELATIVE_PATH . 'classes/order/fianet_user_siteconso_xml.php');
|
||||
require_once(RELATIVE_PATH . 'classes/order/fianet_order_xml.php');
|
||||
|
||||
require_once(RELATIVE_PATH . 'classes/order/fianet_rnp_order_xml.php');
|
||||
require_once(RELATIVE_PATH . 'classes/order/fianet_rnp_info_order_xml.php');
|
||||
require_once(RELATIVE_PATH . 'classes/order/fianet_rnp_wallet_xml.php');
|
||||
require_once(RELATIVE_PATH . 'classes/order/fianet_xml_paracallback_builder.php');
|
||||
require_once(RELATIVE_PATH . 'classes/order/fianet_paraobject_xml.php');
|
||||
|
||||
|
||||
@@ -1,77 +0,0 @@
|
||||
<?php
|
||||
|
||||
function debug(&$var, $info = FALSE)
|
||||
{
|
||||
$scope = false;
|
||||
$prefix = 'unique';
|
||||
$suffix = 'value';
|
||||
|
||||
if($scope) $vals = $scope;
|
||||
else $vals = $GLOBALS;
|
||||
|
||||
$old = $var;
|
||||
$var = $new = $prefix.rand().$suffix; $vname = FALSE;
|
||||
foreach($vals as $key => $val) if($val === $new) $vname = $key;
|
||||
$var = $old;
|
||||
|
||||
echo "<pre style='margin: 0px 0px 10px 0px; display: block; background: white; color: black; font-family: Verdana; border: 1px solid #cccccc; padding: 5px; font-size: 10px; line-height: 13px;'>";
|
||||
if($info != FALSE) echo "<b style='color: red;'>$info:</b><br>";
|
||||
do_dump($var, '$'.$vname);
|
||||
echo "</pre>";
|
||||
}
|
||||
|
||||
|
||||
function do_dump(&$var, $var_name = NULL, $indent = NULL, $reference = NULL)
|
||||
{
|
||||
$do_dump_indent = "<span style='color:#eeeeee;'>|</span> ";
|
||||
$reference = $reference.$var_name;
|
||||
$keyvar = 'the_do_dump_recursion_protection_scheme'; $keyname = 'referenced_object_name';
|
||||
|
||||
if (is_array($var) && isset($var[$keyvar]))
|
||||
{
|
||||
$real_var = &$var[$keyvar];
|
||||
$real_name = &$var[$keyname];
|
||||
$type = ucfirst(gettype($real_var));
|
||||
echo "$indent$var_name <span style='color:#a2a2a2'>$type</span> = <span style='color:#e87800;'>&$real_name</span><br>";
|
||||
}
|
||||
else
|
||||
{
|
||||
$var = array($keyvar => $var, $keyname => $reference);
|
||||
$avar = &$var[$keyvar];
|
||||
|
||||
$type = ucfirst(gettype($avar));
|
||||
if($type == "String") $type_color = "<span style='color:green'>";
|
||||
elseif($type == "Integer") $type_color = "<span style='color:red'>";
|
||||
elseif($type == "Double"){ $type_color = "<span style='color:#0099c5'>"; $type = "Float"; }
|
||||
elseif($type == "Boolean") $type_color = "<span style='color:#92008d'>";
|
||||
elseif($type == "NULL") $type_color = "<span style='color:black'>";
|
||||
|
||||
if(is_array($avar))
|
||||
{
|
||||
$count = count($avar);
|
||||
echo "$indent" . ($var_name ? "$var_name => ":"") . "<span style='color:#a2a2a2'>$type ($count)</span><br>$indent(<br>";
|
||||
$keys = array_keys($avar);
|
||||
foreach($keys as $name)
|
||||
{
|
||||
$value = &$avar[$name];
|
||||
do_dump($value, "['$name']", $indent.$do_dump_indent, $reference);
|
||||
}
|
||||
echo "$indent)<br>";
|
||||
}
|
||||
elseif(is_object($avar))
|
||||
{
|
||||
echo "$indent$var_name <span style='color:#a2a2a2'>$type</span><br>$indent(<br>";
|
||||
foreach($avar as $name=>$value) do_dump($value, "$name", $indent.$do_dump_indent, $reference);
|
||||
echo "$indent)<br>";
|
||||
}
|
||||
elseif(is_int($avar)) echo "$indent$var_name = <span style='color:#a2a2a2'>$type(".strlen($avar).")</span> $type_color$avar</span><br>";
|
||||
elseif(is_string($avar)) echo "$indent$var_name = <span style='color:#a2a2a2'>$type(".strlen($avar).")</span> $type_color\"$avar\"</span><br>";
|
||||
elseif(is_float($avar)) echo "$indent$var_name = <span style='color:#a2a2a2'>$type(".strlen($avar).")</span> $type_color$avar</span><br>";
|
||||
elseif(is_bool($avar)) echo "$indent$var_name = <span style='color:#a2a2a2'>$type(".strlen($avar).")</span> $type_color".($avar == 1 ? "TRUE":"FALSE")."</span><br>";
|
||||
elseif(is_null($avar)) echo "$indent$var_name = <span style='color:#a2a2a2'>$type(".strlen($avar).")</span> {$type_color}NULL</span><br>";
|
||||
else echo "$indent$var_name = <span style='color:#a2a2a2'>$type(".strlen($avar).")</span> $avar<br>";
|
||||
|
||||
$var = $var[$keyvar];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,71 +0,0 @@
|
||||
<?php
|
||||
|
||||
function clean_xml($xml)
|
||||
{
|
||||
$xml = str_replace("\\'", "'", $xml);
|
||||
$xml = str_replace("\\\"", "\"", $xml);
|
||||
$xml = str_replace("\\\\", "\\", $xml);
|
||||
$xml = str_replace("\t", "", $xml);
|
||||
$xml = str_replace("\n", "", $xml);
|
||||
$xml = str_replace("\r", "", $xml);
|
||||
$xml = trim($xml);
|
||||
return ($xml);
|
||||
}
|
||||
|
||||
function clean_invalid_char($var)
|
||||
{
|
||||
//supprimes les balises html
|
||||
$var = strip_tags($var);
|
||||
$var = str_replace("&", "&", $var);
|
||||
$var = str_replace("<", "<", $var);
|
||||
$var = str_replace(">", ">", $var);
|
||||
$var = trim($var);
|
||||
return ($var);
|
||||
}
|
||||
|
||||
function var_is_object_of_class($var, $class_name)
|
||||
{
|
||||
$res = false;
|
||||
if (is_object($var))
|
||||
{
|
||||
$name = get_class($var);
|
||||
if ($name == $class_name)
|
||||
{
|
||||
$res = true;
|
||||
}
|
||||
}
|
||||
return ($res);
|
||||
}
|
||||
|
||||
//Calcule la date de livraison en jour ouvré à partir de la date courante
|
||||
function get_delivery_date($delivery_times)
|
||||
{
|
||||
define('H', date("H"));
|
||||
define('i', date("i"));
|
||||
define('s', date("s"));
|
||||
define('m', date("m"));
|
||||
define('d', date("d"));
|
||||
define('Y', date("Y"));
|
||||
define('SUNDAY', 0);
|
||||
define('SATURDAY', 6);
|
||||
|
||||
$nb_days = 0;
|
||||
$j = 0;
|
||||
while ($nb_days < $delivery_times)
|
||||
{
|
||||
$j++;
|
||||
$date = mktime(H, i, s, m, d + $j, Y);
|
||||
$day = date("w", $date);
|
||||
if ($day != SUNDAY && $day != SATURDAY)
|
||||
{
|
||||
$nb_days++;
|
||||
}
|
||||
}
|
||||
if ($j > FIANET_MAX_DELIVERY_TIME)
|
||||
{//si on dépasse le délais de livraison max à causes des samedi et dimanche on remet le délais de livraison à son maximum
|
||||
$j = FIANET_MAX_DELIVERY_TIME;
|
||||
}
|
||||
$date = mktime(H, i, s, m, d + $j, Y);
|
||||
return (date("Y-m-d", $date));
|
||||
}
|
||||
|
||||
@@ -1,119 +0,0 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* xml2array() will convert the given XML text to an array in the XML structure.
|
||||
* Link: http://www.bin-co.com/php/scripts/xml2array/
|
||||
* Arguments : $contents - The XML text
|
||||
* $get_attributes - 1 or 0. If this is 1 the function will get the attributes as well as the tag values - this results in a different array structure in the return value.
|
||||
* Return: The parsed XML in an array form.
|
||||
*/
|
||||
function xml2array($contents, $get_attributes=1)
|
||||
{
|
||||
if(!$contents) return array();
|
||||
|
||||
if(!function_exists('xml_parser_create'))
|
||||
{
|
||||
//print "'xml_parser_create()' function not found!";
|
||||
return array();
|
||||
}
|
||||
//Get the XML parser of PHP - PHP must have this module for the parser to work
|
||||
$parser = xml_parser_create();
|
||||
xml_parser_set_option( $parser, XML_OPTION_CASE_FOLDING, 0 );
|
||||
xml_parser_set_option( $parser, XML_OPTION_SKIP_WHITE, 1 );
|
||||
xml_parse_into_struct( $parser, $contents, $xml_values );
|
||||
xml_parser_free( $parser );
|
||||
|
||||
if(!$xml_values) return;//Hmm...
|
||||
|
||||
//Initializations
|
||||
$xml_array = array();
|
||||
$parents = array();
|
||||
$opened_tags = array();
|
||||
$arr = array();
|
||||
|
||||
$current = &$xml_array;
|
||||
|
||||
//Go through the tags.
|
||||
foreach($xml_values as $data)
|
||||
{
|
||||
unset($attributes,$value);//Remove existing values, or there will be trouble
|
||||
//This command will extract these variables into the foreach scope
|
||||
// tag(string), type(string), level(int), attributes(array).
|
||||
extract($data);//We could use the array by itself, but this cooler.
|
||||
|
||||
$result = '';
|
||||
if($get_attributes)
|
||||
{//The second argument of the function decides this.
|
||||
$result = array();
|
||||
if(isset($value)) $result['value'] = $value;
|
||||
//Set the attributes too.
|
||||
if(isset($attributes))
|
||||
{
|
||||
foreach($attributes as $attr => $val)
|
||||
{
|
||||
if($get_attributes == 1) $result['attr'][$attr] = $val; //Set all the attributes in a array called 'attr'
|
||||
/** :TODO: should we change the key name to '_attr'? Someone may use the tagname 'attr'. Same goes for 'value' too */
|
||||
}
|
||||
}
|
||||
}
|
||||
elseif(isset($value))
|
||||
{
|
||||
$result = $value;
|
||||
}
|
||||
|
||||
//See tag status and do the needed.
|
||||
if($type == "open")
|
||||
{//The starting of the tag '<tag>'
|
||||
$parent[$level-1] = &$current;
|
||||
if(!is_array($current) or (!in_array($tag, array_keys($current))))
|
||||
{ //Insert New tag
|
||||
$current[$tag] = $result;
|
||||
$current = &$current[$tag];
|
||||
|
||||
}
|
||||
else
|
||||
{ //There was another element with the same tag name
|
||||
if(isset($current[$tag][0]))
|
||||
{
|
||||
array_push($current[$tag], $result);
|
||||
}
|
||||
else
|
||||
{
|
||||
$current[$tag] = array($current[$tag],$result);
|
||||
}
|
||||
$last = count($current[$tag]) - 1;
|
||||
$current = &$current[$tag][$last];
|
||||
}
|
||||
|
||||
}
|
||||
elseif($type == "complete")
|
||||
{ //Tags that ends in 1 line '<tag />'
|
||||
//See if the key is already taken.
|
||||
if(!isset($current[$tag]))
|
||||
{ //New Key
|
||||
$current[$tag] = $result;
|
||||
//array_push($current[$tag],$result);
|
||||
}
|
||||
else
|
||||
{ //If taken, put all things inside a list(array)
|
||||
if((is_array($current[$tag]) and $get_attributes == 0)//If it is already an array...
|
||||
or (isset($current[$tag][0]) and is_array($current[$tag][0]) and $get_attributes == 1))
|
||||
{
|
||||
array_push($current[$tag],$result); // ...push the new element into that array.
|
||||
}
|
||||
else
|
||||
{ //If it is not an array...
|
||||
$current[$tag] = array($current[$tag],$result); //...Make it an array using using the existing value and the new value
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
elseif ($type == 'close')
|
||||
{ //End of tag '</tag>'
|
||||
$current = &$parent[$level-1];
|
||||
}
|
||||
}
|
||||
return($xml_array);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
<?php
|
||||
//Cette fonction est appellée par l'API en cas d'erreur, vous pouvez l'implémenter pour créer un journal d'erreur
|
||||
function fianet_insert_log($message)
|
||||
{
|
||||
echo $message . '<br />';
|
||||
}
|
||||
|
||||
//Cette fonction est appelée dès qu'une flux xml est généré. Le premier paramètre est le flux lui-même, le second paramètre est la référence de la commande
|
||||
function save_flux_xml($xml, $ref_id)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -1,623 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
* 2007-2011 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License (AFL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://opensource.org/licenses/afl-3.0.php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
*
|
||||
* @author PrestaShop SA <contact@prestashop.com>
|
||||
* @copyright 2007-2011 PrestaShop SA
|
||||
* @version Release: $Revision: 1.4 $
|
||||
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
if ((basename(__FILE__) == 'fianetfraud.php'))
|
||||
require_once(dirname(__FILE__).'/fianet/fianet.php');
|
||||
|
||||
class Fianetfraud extends Module
|
||||
{
|
||||
const INSTALL_SQL_FILE = 'install.sql';
|
||||
|
||||
private $_html;
|
||||
private $_product_type = array(
|
||||
'1' => 'Alimentation & gastronomie',
|
||||
'2' => 'Auto & moto',
|
||||
'3' => 'Culture & divertissements',
|
||||
'4' => 'Maison & jardin',
|
||||
'5' => 'Electromenager',
|
||||
'6' => 'Enchers et achats groupés',
|
||||
'7' => 'Fleurs & cadeaux',
|
||||
'8' => 'Informatique & logiciels',
|
||||
'9' => 'Santé & beauté',
|
||||
'10' => 'Services aux particuliers',
|
||||
'11' => 'Services aux professionnels',
|
||||
'12' => 'Sport',
|
||||
'13' => 'Vetements & accessoires',
|
||||
'14' => 'Voyage & tourisme',
|
||||
'15' => 'Hifi, photo & videos',
|
||||
'16' => 'Telephonie & communication',
|
||||
'17' => 'Bijoux & Métaux précieux',
|
||||
'18' => 'Articles et Accessoires pour bébé',
|
||||
'19' => 'Sonorisation & Lumière'
|
||||
);
|
||||
|
||||
private $_carrier_type = array(
|
||||
1 => 'Retrait de la marchandise chez le marchand',
|
||||
2 => 'Utilisation d\'un réseau de points-retrait tiers (type kiala, alveol, etc.)',
|
||||
3 => 'Retrait dans un aéroport, une gare ou une agence de voyage',
|
||||
4 => 'Transporteur (La Poste, Colissimo, UPS, DHL... ou tout transporteur privé)',
|
||||
5 => 'Emission d’un billet électronique, téléchargements'
|
||||
);
|
||||
|
||||
private $_payement_type = array(
|
||||
1 => 'carte',
|
||||
2 => 'cheque',
|
||||
3 => 'contre-remboursement',
|
||||
4 => 'virement',
|
||||
5 => 'cb en n fois',
|
||||
6 => 'paypal',
|
||||
7 => '1euro.com'
|
||||
);
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->name = 'fianetfraud';
|
||||
$this->tab = 'payment_security';
|
||||
$this->version = '1.1';
|
||||
$this->limited_countries = array('fr');
|
||||
|
||||
parent::__construct();
|
||||
|
||||
$this->displayName = 'FIA-NET - Système d\'Analyse des Commandes';
|
||||
$this->description = "Protégez vous contre la fraude à la carte bancaire sans perturber l'acte d'achat";
|
||||
}
|
||||
|
||||
public function install()
|
||||
{
|
||||
if (!parent::install())
|
||||
return false;
|
||||
|
||||
if (!file_exists(dirname(__FILE__).'/'.self::INSTALL_SQL_FILE))
|
||||
return false;
|
||||
elseif (!$sql = file_get_contents(dirname(__FILE__).'/'.self::INSTALL_SQL_FILE))
|
||||
return false;
|
||||
$sql = str_replace('PREFIX_', _DB_PREFIX_, $sql);
|
||||
$sql = preg_split("/;\s*[\r\n]+/", $sql);
|
||||
foreach ($sql AS $query)
|
||||
if ($query AND sizeof($query) AND !Db::getInstance()->Execute(trim($query)))
|
||||
return false;
|
||||
$langs = Language::getLanguages();
|
||||
|
||||
$orderState = new OrderState();
|
||||
foreach ($langs AS $lang)
|
||||
$orderState->name[$lang['id_lang']] = 'Waiting FIA-NET checking';
|
||||
$orderState->name[2] = 'Attente validation commande FIA-NET';
|
||||
$orderState->invoice = false;
|
||||
$orderState->send_email = false;
|
||||
$orderState->logable = false;
|
||||
$orderState->color = '#FF9999';
|
||||
$orderState->hidden = true;
|
||||
$orderState->save();
|
||||
Configuration::updateValue('SAC_ID_WAITING', (int)($orderState->id));
|
||||
|
||||
$orderState = new OrderState();
|
||||
foreach ($langs AS $lang)
|
||||
$orderState->name[$lang['id_lang']] = 'Fraud Detected By FIA-NET';
|
||||
$orderState->name[2] = 'Fraude détectée par FIA-NET';
|
||||
$orderState->invoice = false;
|
||||
$orderState->send_email = false;
|
||||
$orderState->logable = false;
|
||||
$orderState->color = '#FF6666';
|
||||
$orderState->hidden = true;
|
||||
$orderState->save();
|
||||
Configuration::updateValue('SAC_ID_FRAUD', (int)($orderState->id));
|
||||
|
||||
if (!$this->registerHook('updateCarrier'))
|
||||
return false;
|
||||
if (!Configuration::updateValue('SAC_SITEID', '') OR
|
||||
!Configuration::updateValue('SAC_LOGIN', '') OR
|
||||
!Configuration::updateValue('SAC_PASSWORD', '') OR
|
||||
!Configuration::updateValue('SAC_MINIMAL_ORDER', 0))
|
||||
return false;
|
||||
|
||||
return ($this->registerHook('cart') AND
|
||||
$this->registerHook('newOrder') AND
|
||||
$this->registerHook('adminOrder') AND
|
||||
$this->registerHook('updateOrderStatus')
|
||||
);
|
||||
}
|
||||
|
||||
public function uninstall()
|
||||
{
|
||||
$orderState = new OrderState((int)(Configuration::get('SAC_ID_FRAUD')), Configuration::get('PS_LANG_DEFAULT'));
|
||||
if (!$orderState->delete())
|
||||
return false;
|
||||
$orderState = new OrderState((int)(Configuration::get('SAC_ID_WAITING')), Configuration::get('PS_LANG_DEFAULT'));
|
||||
if (!$orderState->delete())
|
||||
return false;
|
||||
|
||||
return parent::uninstall();
|
||||
}
|
||||
|
||||
private function _postProcess()
|
||||
{
|
||||
global $cookie;
|
||||
|
||||
$error = false;
|
||||
|
||||
Configuration::updateValue('SAC_PRODUCTION', ((Tools::getValue('fianetfraud_production') == 1 ) ? 1 : 0));
|
||||
Configuration::updateValue('SAC_LOGIN', Tools::getValue('fianetfraud_login'));
|
||||
Configuration::updateValue('SAC_PASSWORD', Tools::getValue('fianetfraud_password'));
|
||||
Configuration::updateValue('SAC_SITEID', Tools::getValue('fianetfraud_siteid'));
|
||||
Configuration::updateValue('SAC_DEFAULT_PRODUCT_TYPE', Tools::getValue('fianetfraud_product_type'));
|
||||
Configuration::updateValue('SAC_DEFAULT_CARRIER_TYPE', Tools::getValue('fianetfraud_default_carrier'));
|
||||
Configuration::updateValue('SAC_MINIMAL_ORDER', Tools::getValue('fianetfraud_minimal_order'));
|
||||
|
||||
if (isset($_POST['payementBox']))
|
||||
{
|
||||
Configuration::updateValue('SAC_PAYMENT_MODULE', implode(',', $_POST['payementBox']));
|
||||
foreach ($_POST['payementBox'] as $payment)
|
||||
Configuration::updateValue('SAC_PAYMENT_TYPE_'.$payment,Tools::getValue($payment));
|
||||
}
|
||||
|
||||
$categories = Category::getSimpleCategories($cookie->id_lang);
|
||||
foreach ($categories AS $category)
|
||||
Configuration::updateValue('SAC_CATEGORY_TYPE_'.$category['id_category'],Tools::getValue('cat_'.$category['id_category']));
|
||||
|
||||
$carriers = Carrier::getCarriers($cookie->id_lang);
|
||||
foreach ($carriers as $carrier)
|
||||
{
|
||||
if (isset($_POST['carrier_'.$carrier['id_carrier']]))
|
||||
Configuration::updateValue('SAC_CARRIER_TYPE_'.$carrier['id_carrier'], $_POST['carrier_'.$carrier['id_carrier']]);
|
||||
else
|
||||
{
|
||||
$error = true;
|
||||
$this->_html .= '<div class="alert error">'.$this->l('Invalid carrier code').'</div>';
|
||||
}
|
||||
}
|
||||
|
||||
if (!$error)
|
||||
{
|
||||
$dataSync = ((($site_id = Configuration::get('SAC_SITEID')) AND Configuration::get('SAC_PRODUCTION'))
|
||||
? '<img src="http://www.prestashop.com/modules/fianetfraud.png?site_id='.urlencode($site_id).'" style="float:right" />'
|
||||
: ''
|
||||
);
|
||||
$this->_html .= '<div class="conf confirm">'.$this->l('Settings are updated').$dataSync.'</div>';
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public function getContent()
|
||||
{
|
||||
if (isset($_POST['submitSettings']))
|
||||
$this->_postProcess();
|
||||
$id_lang = Configuration::get('PS_LANG_DEFAULT');
|
||||
$categories = Category::getSimpleCategories($id_lang);
|
||||
|
||||
$carriers = Carrier::getCarriers($id_lang);
|
||||
$this->_html .= '
|
||||
<fieldset><legend>FIA-NET - Système d\'Analyse des Commandes</legend>
|
||||
<img src="../modules/'.$this->name.'/logo.jpg" style="float:right;margin:5px 10px 5px 0" />
|
||||
FIA-NET, le leader français de la lutte contre la fraude à la carte bancaire sur internet !<br /><br />
|
||||
Avec son réseau mutualisé de plus de 1 700 sites marchands, et sa base de données de 14 millions de cyber-acheteurs, le Système d’Analyse des Commandes vous offre une protection complète et unique contre le risque d’impayé.<br /><br />
|
||||
Le logiciel expert (SAC) score vos transactions en quasi temps réel à partir de plus de 200 critères pour valider plus de 92 % de vos transactions.<br />
|
||||
Le contrôle humain, prenant en charge les transactions les plus risqués, associé à l’assurance FIA-NET vous permet de valider et garantir jusqu’à 100 % de vos transactions.<br /><br />
|
||||
Ne restez pas isolé face à l’explosion des réseaux de fraudeurs !
|
||||
<p>'.$this->l('To sign in, check out: ').' <u><a href="https://www.fia-net.com/marchands/devispartenaire.php?p=185" target="_blank">'.$this->l('Fia-net Website').'</a></u></p>
|
||||
</fieldset><br />
|
||||
<form action="'.Tools::htmlentitiesUTF8($_SERVER['REQUEST_URI']).'" method="post">
|
||||
<fieldset>
|
||||
<legend><img src="'.$this->_path.'logo.gif" alt="" title="" />'.$this->l('Settings').'</legend>
|
||||
<label>'.$this->l('Login').'</label>
|
||||
<div class="margin-form">
|
||||
<input type="text" name="fianetfraud_login" value="'.Configuration::get('SAC_LOGIN').'"/>
|
||||
</div>
|
||||
<label>'.$this->l('Password').'</label>
|
||||
<div class="margin-form">
|
||||
<input type="text" name="fianetfraud_password" value="'.Configuration::get('SAC_PASSWORD').'"/>
|
||||
</div>
|
||||
<label>'.$this->l('Site ID').'</label>
|
||||
<div class="margin-form">
|
||||
<input type="text" name="fianetfraud_siteid" value="'.Configuration::get('SAC_SITEID').'"/>
|
||||
</div>
|
||||
<label>'.$this->l('Production mode').'</label>
|
||||
<div class="margin-form">
|
||||
<input type="checkbox" name="fianetfraud_production" id="activated_on" value="1" '.((Configuration::get('SAC_PRODUCTION') == 1) ? 'checked="checked" ' : '').'/>
|
||||
</div>
|
||||
<label>'.$this->l('Default Product Type').'</label>
|
||||
<div class="margin-form">
|
||||
<select name="fianetfraud_product_type">
|
||||
<option value="0">'.$this->l('-- Choose --').'</option>';
|
||||
foreach ($this->_product_type AS $k => $product_type)
|
||||
$this->_html .= '<option value="'.$k.'"'.(Configuration::get('SAC_DEFAULT_PRODUCT_TYPE') == $k ? ' selected="selected"' : '').'>'.$product_type.'</option>';
|
||||
$this->_html .= '</select>
|
||||
</div>
|
||||
</fieldset><br />
|
||||
<fieldset><legend><img src="'.$this->_path.'logo.gif" alt="" title="" />'.$this->l('Category Detail').'</legend>
|
||||
<label>'.$this->l('Category Detail').'</label>
|
||||
<div class="margin-form">
|
||||
<table cellspacing="0" cellpadding="0" class="table">
|
||||
<thead><tr><th>'.$this->l('Category').'</th><th>'.$this->l('Category Type').'</th></tr></thead><tbody>';
|
||||
foreach ($categories AS $category)
|
||||
{
|
||||
$this->_html .= '<tr><td>'.$category['name'].'</td><td>
|
||||
<select name="cat_'.$category['id_category'].'" id="cat_'.$category['id_category'].'">
|
||||
<option value="0">'.$this->l('Choose a category...').'</option>';
|
||||
foreach ($this->_product_type AS $id => $cat)
|
||||
$this->_html .= '<option value="'.$id.'" '.((Configuration::get('SAC_CATEGORY_TYPE_'.$category['id_category']) == $id) ? ' selected="true"' : '').'>'.$cat.'</option>';
|
||||
$this->_html .= '</select></td></tr>';
|
||||
}
|
||||
$this->_html .= '</tbody></table></div>
|
||||
</fieldset>
|
||||
<div class="clear"> </div>
|
||||
<fieldset><legend><img src="'.$this->_path.'logo.gif" alt="" title="" />'.$this->l('Carrier Configuration').'</legend>
|
||||
<label>'.$this->l('Carrier Detail').'</label>
|
||||
<div class="margin-form">
|
||||
<table cellspacing="0" cellpadding="0" class="table">
|
||||
<thead><tr><th>'.$this->l('Carrier').'</th><th>'.$this->l('Carrier Type').'</th></tr></thead><tbody>';
|
||||
foreach ($carriers AS $carrier)
|
||||
{
|
||||
$this->_html .= '<tr><td>'.$carrier['name'].'</td><td><select name="carrier_'.$carrier['id_carrier'].'" id="cat_'.$carrier['id_carrier'].'">
|
||||
<option value="0">'.$this->l('Choose a carrier type...').'</option>';
|
||||
foreach ($this->_carrier_type AS $id => $type)
|
||||
$this->_html .= '<option value="'.$id.'"'.((Configuration::get('SAC_CARRIER_TYPE_'.$carrier['id_carrier']) == $id) ? ' selected="true"' : '').'>'.$type.'</option>';
|
||||
$this->_html .= '</select></td>';
|
||||
}
|
||||
$this->_html .= '</tbody></table></margin>
|
||||
</div>
|
||||
<div class="clear"> </div>
|
||||
<label>'.$this->l('Default Carrier Type').'</label>
|
||||
<div class="margin-form">
|
||||
<select name="fianetfraud_default_carrier">';
|
||||
foreach ($this->_carrier_type AS $k => $type)
|
||||
$this->_html .= '<option value="'.$k.'"'.($k == Configuration::get('SAC_DEFAULT_CARRIER_TYPE') ? ' selected' : '').'>'.$type.'</option>';
|
||||
$this->_html .= '</select>
|
||||
</div>
|
||||
</fieldset><div class="clear"> </div>';
|
||||
|
||||
/* Get all modules then select only payment ones*/
|
||||
$modules = Module::getModulesOnDisk();
|
||||
$modules_is_fianet = explode(',', Configuration::get('SAC_PAYMENT_MODULE'));
|
||||
$this->paymentModules = array();
|
||||
foreach ($modules AS $module)
|
||||
if (method_exists($module, 'hookPayment'))
|
||||
{
|
||||
if($module->id)
|
||||
{
|
||||
$module->country = array();
|
||||
$countries = DB::getInstance()->ExecuteS('SELECT id_country FROM '._DB_PREFIX_.'module_country WHERE id_module = '.(int)($module->id));
|
||||
foreach ($countries as $country)
|
||||
$module->country[] = $country['id_country'];
|
||||
|
||||
$module->currency = array();
|
||||
$currencies = DB::getInstance()->ExecuteS('SELECT id_currency FROM '._DB_PREFIX_.'module_currency WHERE id_module = '.(int)($module->id));
|
||||
foreach ($currencies as $currency)
|
||||
$module->currency[] = $currency['id_currency'];
|
||||
|
||||
$module->group = array();
|
||||
$groups = DB::getInstance()->ExecuteS('SELECT id_group FROM '._DB_PREFIX_.'module_group WHERE id_module = '.(int)($module->id));
|
||||
foreach ($groups as $group)
|
||||
$module->group[] = $group['id_group'];
|
||||
}
|
||||
else
|
||||
{
|
||||
$module->country = NULL;
|
||||
$module->currency = NULL;
|
||||
$module->group = NULL;
|
||||
}
|
||||
$this->paymentModules[] = $module;
|
||||
}
|
||||
|
||||
$this->_html .= '<fieldset><legend><img src="'.$this->_path.'logo.gif" alt="" title="" />'.$this->l('Payment Configuration').'</legend>
|
||||
<label>'.$this->l('Payment Detail').'</label>
|
||||
<div class="margin-form">
|
||||
<table cellspacing="0" cellpadding="0" class="table" ><thead><tr>
|
||||
<th><input type="checkbox" name="checkme" class="noborder" onclick="checkDelBoxes(this.form, \'payementBox[]\', this.checked)" /></th>
|
||||
<th>'.$this->l('Payment Module').'</th><th>'.$this->l('Payment Type').'</th></tr></thead><tbody>';
|
||||
|
||||
foreach ($this->paymentModules as $module)
|
||||
{
|
||||
$this->_html .= '<tr><td><input type="checkbox" class="noborder" value="'.substr($module->name,0,15).'" name="payementBox[]" ' .(in_array(substr($module->name,0,15), $modules_is_fianet) ? 'checked="checked"' : '').'></td>';
|
||||
$this->_html .= '<td><img src="'.__PS_BASE_URI__.'modules/'.$module->name.'/logo.gif" alt="'.$module->name.'" title="'.$module->displayName.'" />'.stripslashes($module->displayName).'</td><td><select name="'.substr($module->name,0,15).'">';
|
||||
$this->_html .= '<option value="0">'.$this->l('-- Choose --').'</option>';
|
||||
foreach ($this->_payement_type as $type)
|
||||
$this->_html .= '<option '.((Configuration::get('SAC_PAYMENT_TYPE_'.substr($module->name,0,15)) == $type) ? 'selected="true"' : '').'>'.$type.'</option>';
|
||||
$this->_html .= '</select></tr>';
|
||||
}
|
||||
|
||||
$this->_html .= '</tbody></table></margin></fieldset><br class="clear" /><br />
|
||||
<center><input type="submit" name="submitSettings" value="'.$this->l('Save').'" class="button" /></center>
|
||||
</form>
|
||||
<div class="clear"> </div>';
|
||||
return $this->_html;
|
||||
}
|
||||
|
||||
public function hookCart($params)
|
||||
{
|
||||
if ($_SERVER['REMOTE_ADDR'] == '0.0.0.0' OR $_SERVER['REMOTE_ADDR'] == '' OR $_SERVER['REMOTE_ADDR'] === false)
|
||||
return true;
|
||||
$res = Db::getInstance()->ExecuteS('
|
||||
SELECT `id_cart`
|
||||
FROM '._DB_PREFIX_.'fianet_fraud
|
||||
WHERE id_cart='.(int)($params['cart']->id));
|
||||
if (Db::getInstance()->NumRows() > 0)
|
||||
Db::getInstance()->Execute('
|
||||
UPDATE `'._DB_PREFIX_.'fianet_fraud`
|
||||
SET `ip_address` = '.ip2long($_SERVER['REMOTE_ADDR']).', `date` = \''.pSQL(date('Y-m-d H:i:s')).'\'
|
||||
WHERE `id_cart` = '.(int)($params['cart']->id).' LIMIT 1');
|
||||
else
|
||||
Db::getInstance()->Execute('
|
||||
INSERT INTO `'._DB_PREFIX_.'fianet_fraud` (`id_cart`, `ip_address`, `date`)
|
||||
VALUES ('.(int)($params['cart']->id).', '.ip2long($_SERVER['REMOTE_ADDR']).',\''.date('Y-m-d H:i:s').'\')');
|
||||
return true;
|
||||
}
|
||||
|
||||
static private function getIpByCart($id_cart = false)
|
||||
{
|
||||
if ($id_cart == false)
|
||||
return false;
|
||||
return long2ip(Db::getInstance()->getValue('
|
||||
SELECT `ip_address`
|
||||
FROM '._DB_PREFIX_.'fianet_fraud
|
||||
WHERE id_cart = '.(int)($id_cart)));
|
||||
}
|
||||
|
||||
public function hookUpdateOrderStatus($params)
|
||||
{
|
||||
$order_status = false;
|
||||
$conf = Configuration::getMultiple(array('SAC_PRODUCTION', 'PS_SAC_ID_FRAUD', 'SAC_SITEID', 'SAC_LOGIN', 'SAC_PASSWORD'));
|
||||
if ($params['newOrderStatus']->id == Configuration::get('SAC_ID_FRAUD'))
|
||||
$order_status = 2;
|
||||
elseif ($params['newOrderStatus']->id == _PS_OS_DELIVERED_)
|
||||
$order_status = 1;
|
||||
elseif ($params['newOrderStatus']->id == _PS_OS_CANCELED_)
|
||||
$order_status = 2;
|
||||
elseif ($params['newOrderStatus']->id == _PS_OS_REFUND_)
|
||||
$order_status = 6;
|
||||
if ($order_status != false)
|
||||
return file_get_contents('https://secure.fia-net.com/'.($conf['SAC_PRODUCTION'] ? 'fscreener' : 'pprod').'/engine/delivery.cgi?SiteID='.$conf['SAC_SITEID'].'&Pwd='.urlencode($conf['SAC_PASSWORD']).'&RefID='.(int)$params['id_order'].'&Status='.$order_status);
|
||||
else
|
||||
return true;
|
||||
}
|
||||
|
||||
public function needCheck($id_module, $total_paid)
|
||||
{
|
||||
$modules = explode(',', Configuration::get('SAC_PAYMENT_MODULE'));
|
||||
if (!in_array($id_module, $modules))
|
||||
return false;
|
||||
if ($total_paid < Configuration::get('SAC_MINIMAL_ORDER'))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
public function hookNewOrder($params)
|
||||
{
|
||||
if ($params['order']->total_paid <= 0)
|
||||
return;
|
||||
|
||||
if (!$this->needCheck($params['order']->module, $params['order']->total_paid))
|
||||
return false;
|
||||
|
||||
$address_delivery = new Address((int)($params['order']->id_address_delivery));
|
||||
$address_invoice = new Address((int)($params['order']->id_address_invoice));
|
||||
$customer = new Customer((int)($params['order']->id_customer));
|
||||
$orderFianet = new fianet_order_xml();
|
||||
$id_lang = Configuration::get('PS_LANG_DEFAULT');
|
||||
if($address_invoice->company == '')
|
||||
$orderFianet->billing_user->set_quality_nonprofessional();
|
||||
else
|
||||
$orderFianet->billing_user->set_quality_professional();
|
||||
|
||||
$orderFianet->billing_user->titre = (($customer->id_gender == 1) ? $this->l('Mr.') : (($customer->id_gender == 2 ) ? $this->l('Mrs') : $this->l('Mr.')));
|
||||
$orderFianet->billing_user->nom = utf8_decode($address_invoice->lastname);
|
||||
$orderFianet->billing_user->prenom = utf8_decode($address_invoice->firstname);
|
||||
$orderFianet->billing_user->societe = utf8_decode($address_invoice->company);
|
||||
$orderFianet->billing_user->telhome = utf8_decode($address_invoice->phone);
|
||||
$orderFianet->billing_user->office = '';
|
||||
$orderFianet->billing_user->telmobile = utf8_decode($address_invoice->phone_mobile);
|
||||
$orderFianet->billing_user->telfax = '';
|
||||
$orderFianet->billing_user->email = $customer->email;
|
||||
|
||||
$customer_stats = $customer->getStats();
|
||||
$all_orders = Order::getCustomerOrders((int)($customer->id));
|
||||
$orderFianet->billing_user->site_conso = new fianet_user_siteconso_xml();
|
||||
$orderFianet->billing_user->site_conso->ca = $customer_stats['total_orders'];
|
||||
$orderFianet->billing_user->site_conso->nb = $customer_stats['nb_orders'];
|
||||
$orderFianet->billing_user->site_conso->datepremcmd = $all_orders[count($all_orders) - 1]['date_add'];
|
||||
if (count($all_orders) > 1)
|
||||
$orderFianet->billing_user->site_conso->datederncmd = $all_orders[1]['date_add'];
|
||||
|
||||
$orderFianet->billing_adress->rue1 = utf8_decode($address_invoice->address1);
|
||||
$orderFianet->billing_adress->rue2 = utf8_decode($address_invoice->address2);
|
||||
$orderFianet->billing_adress->cpostal = utf8_decode($address_invoice->postcode);
|
||||
$orderFianet->billing_adress->ville = utf8_decode($address_invoice->city);
|
||||
$country = new Country((int)($address_invoice->id_country));
|
||||
$orderFianet->billing_adress->pays = utf8_decode($country->name[$id_lang]);
|
||||
|
||||
//delivery adresse not send if carrier id is 1 or 2
|
||||
$carrier_id = array(1,2);
|
||||
if (!in_array(Configuration::get('SAC_CARRIER_TYPE_'.(int)($params['cart']->id_carrier)),$carrier_id))
|
||||
{
|
||||
$orderFianet->delivery_user = new fianet_delivery_user_xml();
|
||||
$orderFianet->delivery_adress = new fianet_delivery_adress_xml();
|
||||
|
||||
if ($address_delivery->company == '')
|
||||
$orderFianet->delivery_user->set_quality_nonprofessional();
|
||||
else
|
||||
$orderFianet->delivery_user->set_quality_professional();
|
||||
|
||||
$orderFianet->delivery_user->titre = (($customer->id_gender == 1) ? $this->l('Mr.') : (($customer->id_gender == 2) ? $this->l('Mrs') : $this->l('Unknown')));
|
||||
|
||||
$orderFianet->delivery_user->nom = utf8_decode($address_delivery->lastname);
|
||||
$orderFianet->delivery_user->prenom = utf8_decode($address_delivery->firstname);
|
||||
$orderFianet->delivery_user->societe = utf8_decode($address_delivery->company);
|
||||
$orderFianet->delivery_user->telhome = utf8_decode($address_delivery->phone);
|
||||
$orderFianet->delivery_user->office = '';
|
||||
$orderFianet->delivery_user->telmobile = utf8_decode($address_delivery->phone_mobile);
|
||||
$orderFianet->delivery_user->telfax = '';
|
||||
$orderFianet->delivery_user->email = $customer->email;
|
||||
|
||||
$orderFianet->delivery_adress->rue1 = utf8_decode($address_delivery->address1);
|
||||
$orderFianet->delivery_adress->rue2 = utf8_decode($address_delivery->address2);
|
||||
$orderFianet->delivery_adress->cpostal = utf8_decode($address_delivery->postcode);
|
||||
$orderFianet->delivery_adress->ville = utf8_decode($address_delivery->city);
|
||||
$country = new Country((int)($address_delivery->id_country));
|
||||
$orderFianet->delivery_adress->pays = utf8_decode($country->name[$id_lang]);
|
||||
}
|
||||
|
||||
$orderFianet->info_commande->refid = ($params['order']->id);
|
||||
$orderFianet->info_commande->montant = $params['order']->total_paid;
|
||||
$currency = new Currency((int)($params['order']->id_currency));
|
||||
$orderFianet->info_commande->devise = $currency->iso_code;
|
||||
$orderFianet->info_commande->ip = self::getIpByCart((int)($params['cart']->id));
|
||||
$orderFianet->info_commande->timestamp = date('Y-m-d H:i:s');
|
||||
|
||||
$products = $params['cart']->getProducts();
|
||||
$default_product_type = Configuration::get('SAC_DEFAULT_PRODUCT_TYPE');
|
||||
foreach ($products AS $product)
|
||||
{
|
||||
$product_categories = Product::getIndexedCategories((int)($product['id_product']));
|
||||
$have_sac_cat = false;
|
||||
|
||||
$produit = new fianet_product_xml();
|
||||
|
||||
if(Configuration::get('SAC_CATEGORY_TYPE_'.$product['id_category_default']))
|
||||
{
|
||||
$produit->type = Configuration::get('SAC_CATEGORY_TYPE_'.$product['id_category_default']);
|
||||
}
|
||||
else
|
||||
$produit->type = $default_product_type;
|
||||
$produit->ref = utf8_decode((((isset($product['reference']) AND !empty($product['reference'])) ? $product['reference'] : ((isset($product['ean13']) AND !empty($product['ean13'])) ? $product['ean13'] : $product['name']))));
|
||||
$produit->nb = $product['cart_quantity'];
|
||||
$produit->prixunit = $product['price'];
|
||||
$produit->name = utf8_decode($product['name']);
|
||||
$orderFianet->info_commande->list->add_product($produit);
|
||||
}
|
||||
|
||||
$carrier = new Carrier((int)($params['order']->id_carrier));
|
||||
$orderFianet->info_commande->transport->type = Configuration::get('SAC_CARRIER_TYPE_'.(int)($carrier->id));
|
||||
$orderFianet->info_commande->transport->nom = $carrier->name;
|
||||
$orderFianet->info_commande->transport->rapidite = self::getCarrierFastById((int)($carrier->id));
|
||||
$orderFianet->payment->type = Configuration::get('SAC_PAYMENT_TYPE_'.substr($params['order']->module,0,15));
|
||||
|
||||
$xml = $orderFianet->get_xml();
|
||||
$sender = new fianet_sender();
|
||||
if (Configuration::get('SAC_PRODUCTION'))
|
||||
$sender->mode = 'production';
|
||||
else
|
||||
$sender->mode = 'test';
|
||||
|
||||
$sender->add_order($orderFianet);
|
||||
$res = $sender->send_orders_stacking();
|
||||
Db::getInstance()->Execute('INSERT INTO '._DB_PREFIX_.'fianet_fraud_orders(id_order, date_add) VALUES('.(int)($params['order']->id).', \''.pSQL(date('Y-m-d H:i:s')).'\')');
|
||||
return true;
|
||||
}
|
||||
|
||||
static public function checkWaitingOrders()
|
||||
{
|
||||
$orders = Db::getInstance()->ExecuteS('SELECT id_order FROM '._DB_PREFIX_.'fianet_fraud_orders WHERE `date_add` > \''.pSQL(strtotime('+5 minute')).'\'');
|
||||
foreach ($orders AS $order)
|
||||
{
|
||||
self::updateOrderHistory((int)($order['id_order']));
|
||||
Db::getInstance()->Execute('DELETE FROM '._DB_PREFIX_.'fianet_fraud_orders WHERE id_order='.(int)($order['id_order']));
|
||||
}
|
||||
}
|
||||
|
||||
public function hookAdminOrder($params)
|
||||
{
|
||||
$conf = Configuration::get('SAC_PRODUCTION');
|
||||
$order = new Order((int)($params['id_order']));
|
||||
if (!self::needCheck($order->module, $order->total_paid))
|
||||
return null;
|
||||
|
||||
if (isset($_POST['submitFianet']))
|
||||
$this->_postProcess();
|
||||
$html = '<br /><fieldset style="width:400px;"><legend>'.$this->l('Fianet Validation').'</legend>';
|
||||
$html .= '<a href="https://secure.fia-net.com/'.($conf ? 'fscreener' : 'pprod').'/BO/visucheck_detail.php?sid='.Configuration::get('SAC_SITEID').'&log='.Configuration::get('SAC_LOGIN').'&pwd='.urlencode(Configuration::get('SAC_PASSWORD')).'&rid='.$params['id_order'].'">'.$this->l('See Detail').'</a><br />';
|
||||
$html .= $this->l('Evaluate').': '.self::getEval((int)($order->id));
|
||||
$html .= '</fieldset>';
|
||||
|
||||
return $html;
|
||||
}
|
||||
|
||||
private static function getHCarriers($field)
|
||||
{
|
||||
$carriers = Carrier::getCarriers(Configuration::get('PS_LANG_DEFAULT'));
|
||||
$hcarrier = '<option value=""></option>';
|
||||
foreach ($carriers AS $carrier)
|
||||
$hcarrier .= '<option value="'.$carrier['id_carrier'].'"'.(($carrier['id_carrier'] == Configuration::get($field)) ? 'selected="selected"' : '').'>'.$carrier['name'].'</option>';
|
||||
return $hcarrier;
|
||||
}
|
||||
|
||||
private static function updateOrderHistory($id_order)
|
||||
{
|
||||
if (self::getEval((int)($id_order)) > 0)
|
||||
return true;
|
||||
elseif (self::getEval((int)($id_order)) == 0)
|
||||
{
|
||||
$orderHistory = new OrderHistory();
|
||||
$orderHistory->id_order = (int)($id_order);
|
||||
$orderHistory->id_order_state = Configuration::get('SAC_ID_FRAUD');
|
||||
$orderHistory->save();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
private static function getEval($id_order)
|
||||
{
|
||||
$sender = new fianet_sender();
|
||||
if (Configuration::get('SAC_PRODUCTION'))
|
||||
$sender->mode = 'production';
|
||||
$result = $sender->get_evaluation(array($id_order));
|
||||
return $result[0]['eval'];
|
||||
}
|
||||
|
||||
public static function reEvaluateOrder()
|
||||
{
|
||||
$sender = new fianet_sender();
|
||||
if (Configuration::get('SAC_PRODUCTION'))
|
||||
$sender->mode = 'production';
|
||||
$result = $sender->get_reevaluated_order();
|
||||
|
||||
foreach ($result AS $row)
|
||||
if ($row['eval'] > 0)
|
||||
if (OrderHistory::getLastOrderState($row['refid']) == Configuration::get('SAC_ID_WAITING'))
|
||||
{
|
||||
$orderHistory = new OrderHistory();
|
||||
$orderHistory->id_order = (int)($row['refid']);
|
||||
$orderHistory->id_order_state = _PS_OS_PAYMENT_;
|
||||
$orderHistory->save();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private static function getCarrierFastById($id_carrier)
|
||||
{
|
||||
return 2;
|
||||
}
|
||||
|
||||
public function getSACCategories()
|
||||
{
|
||||
$categories = Db::getInstance()->ExecuteS('SELECT id_category, id_sac FROM '._DB_PREFIX_.'sac_categories');
|
||||
$sac_cat = array();
|
||||
if ($categories)
|
||||
foreach ($categories AS $category)
|
||||
$sac_cat[$category['id_category']] = $category['id_sac'];
|
||||
return $sac_cat;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,36 +0,0 @@
|
||||
<?php
|
||||
|
||||
global $_MODULE;
|
||||
$_MODULE = array();
|
||||
$_MODULE['<{fianetfraud}prestashop>fianetfraud_740e53a0ed1b643f69c4aaa8ad4ae8d2'] = 'Code transporteur invalide';
|
||||
$_MODULE['<{fianetfraud}prestashop>fianetfraud_7ccf58c950043c9fbfed668df13ce608'] = 'Paramètres mis à jour avec succès';
|
||||
$_MODULE['<{fianetfraud}prestashop>fianetfraud_380b4179d36bce6ca862459a43b217b5'] = 'Pour vous inscrire, rendez-vous sur:';
|
||||
$_MODULE['<{fianetfraud}prestashop>fianetfraud_592fcfe937f6d58f70d0918ef6373afa'] = 'le site internet de Fia-Net';
|
||||
$_MODULE['<{fianetfraud}prestashop>fianetfraud_f4f70727dc34561dfde1a3c529b6205c'] = 'Configuration';
|
||||
$_MODULE['<{fianetfraud}prestashop>fianetfraud_99dea78007133396a7b8ed70578ac6ae'] = 'Utilisateur';
|
||||
$_MODULE['<{fianetfraud}prestashop>fianetfraud_dc647eb65e6711e155375218212b3964'] = 'Mot de passe';
|
||||
$_MODULE['<{fianetfraud}prestashop>fianetfraud_b250a007769c7ffe655c74cfb8176b8c'] = 'ID Site';
|
||||
$_MODULE['<{fianetfraud}prestashop>fianetfraud_30dbd3dffa9dbd08b062436ba8dcbad7'] = 'Mode production';
|
||||
$_MODULE['<{fianetfraud}prestashop>fianetfraud_99dbbd4d0ac4c725f3b0d2ff29abaf63'] = 'Type par défaut';
|
||||
$_MODULE['<{fianetfraud}prestashop>fianetfraud_7bc873cba11f035df692c3549366c722'] = '-- Choisissez --';
|
||||
$_MODULE['<{fianetfraud}prestashop>fianetfraud_b16c6b201b9dea0dba4c5214e584d5a9'] = 'Détail';
|
||||
$_MODULE['<{fianetfraud}prestashop>fianetfraud_3adbdb3ac060038aa0e6e6c138ef9873'] = 'Catégorie';
|
||||
$_MODULE['<{fianetfraud}prestashop>fianetfraud_32b1e872d533aced68e8fd06117c35d9'] = 'Type';
|
||||
$_MODULE['<{fianetfraud}prestashop>fianetfraud_bb8d6a9f57dcf8f450d8c8b6107cfabb'] = 'Choix de la catégorie';
|
||||
$_MODULE['<{fianetfraud}prestashop>fianetfraud_5f001485711e47385cb84b10c888bbfd'] = 'Configuration du transporteur';
|
||||
$_MODULE['<{fianetfraud}prestashop>fianetfraud_84a4ee79ed85180a743340dceb2f98d1'] = 'Détail';
|
||||
$_MODULE['<{fianetfraud}prestashop>fianetfraud_914419aa32f04011357d3b604a86d7eb'] = 'Transporteur';
|
||||
$_MODULE['<{fianetfraud}prestashop>fianetfraud_fecb07f7ab46e23e9b520a9a9af7b97b'] = 'Type de transporteur';
|
||||
$_MODULE['<{fianetfraud}prestashop>fianetfraud_b04ad61ad875f6e7149fdd51c2e60ce2'] = 'Choix du type de transporteur';
|
||||
$_MODULE['<{fianetfraud}prestashop>fianetfraud_803d8f90719db3a605cf4af72ab2d8ee'] = 'Type de transporteur par defaut';
|
||||
$_MODULE['<{fianetfraud}prestashop>fianetfraud_4a04490d2817c00012562df7bc43299d'] = 'Configuration du paiement';
|
||||
$_MODULE['<{fianetfraud}prestashop>fianetfraud_ff18b8d27988b97ba1dd72120dd524ea'] = 'Détails du paiement';
|
||||
$_MODULE['<{fianetfraud}prestashop>fianetfraud_ec51b543e5a38f6044c83f21dce2b23d'] = 'Module de paiement';
|
||||
$_MODULE['<{fianetfraud}prestashop>fianetfraud_7c9a3504dd4ce74b8021267ae1802968'] = 'Type de paiement';
|
||||
$_MODULE['<{fianetfraud}prestashop>fianetfraud_c9cc8cce247e49bae79f15173ce97354'] = 'Enregistrer';
|
||||
$_MODULE['<{fianetfraud}prestashop>fianetfraud_127469a6b4253ebb77adccc0dd48461e'] = 'M.';
|
||||
$_MODULE['<{fianetfraud}prestashop>fianetfraud_7f2a1b59ac1ab6d2d892dbbf4f132c40'] = 'Mme';
|
||||
$_MODULE['<{fianetfraud}prestashop>fianetfraud_88183b946cc5f0e8c96b2e66e1c74a7e'] = 'Inconnu';
|
||||
$_MODULE['<{fianetfraud}prestashop>fianetfraud_d13270d4831bb2a2723f0fb5b573807c'] = 'Validation Fia-Net';
|
||||
$_MODULE['<{fianetfraud}prestashop>fianetfraud_e010021939a49b7cce07f0e546c1d54f'] = 'Voir le détail';
|
||||
$_MODULE['<{fianetfraud}prestashop>fianetfraud_b086843368d1c92d0a86cbee76b20b6f'] = 'Evaluation';
|
||||
@@ -1,13 +0,0 @@
|
||||
CREATE TABLE IF NOT EXISTS `PREFIX_fianet_fraud` (
|
||||
`id_cart` int(11) unsigned NOT NULL,
|
||||
`ip_address` int(11) NOT NULL,
|
||||
`date` datetime NOT NULL,
|
||||
KEY `id_cart_index` (`id_cart`),
|
||||
KEY `ip_address_index` (`ip_address`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `PREFIX_fianet_fraud_orders` (
|
||||
`id_order` int(11) NOT NULL,
|
||||
`date_add` datetime NOT NULL,
|
||||
UNIQUE KEY `id_order` (`id_order`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
@@ -1,36 +0,0 @@
|
||||
<?php
|
||||
|
||||
global $_MODULE;
|
||||
$_MODULE = array();
|
||||
$_MODULE['<{fianetfraud}prestashop>fianetfraud_740e53a0ed1b643f69c4aaa8ad4ae8d2'] = 'Codice corriere non valido';
|
||||
$_MODULE['<{fianetfraud}prestashop>fianetfraud_7ccf58c950043c9fbfed668df13ce608'] = 'Impostazioni aggiornate';
|
||||
$_MODULE['<{fianetfraud}prestashop>fianetfraud_380b4179d36bce6ca862459a43b217b5'] = 'Per accedere, visitare:';
|
||||
$_MODULE['<{fianetfraud}prestashop>fianetfraud_592fcfe937f6d58f70d0918ef6373afa'] = 'Sito web Fia-net';
|
||||
$_MODULE['<{fianetfraud}prestashop>fianetfraud_f4f70727dc34561dfde1a3c529b6205c'] = 'Impostazioni';
|
||||
$_MODULE['<{fianetfraud}prestashop>fianetfraud_99dea78007133396a7b8ed70578ac6ae'] = 'Login';
|
||||
$_MODULE['<{fianetfraud}prestashop>fianetfraud_dc647eb65e6711e155375218212b3964'] = 'Password';
|
||||
$_MODULE['<{fianetfraud}prestashop>fianetfraud_b250a007769c7ffe655c74cfb8176b8c'] = 'ID sito';
|
||||
$_MODULE['<{fianetfraud}prestashop>fianetfraud_30dbd3dffa9dbd08b062436ba8dcbad7'] = 'Modalità di Produzione';
|
||||
$_MODULE['<{fianetfraud}prestashop>fianetfraud_99dbbd4d0ac4c725f3b0d2ff29abaf63'] = 'Tipo di prodotto per default';
|
||||
$_MODULE['<{fianetfraud}prestashop>fianetfraud_7bc873cba11f035df692c3549366c722'] = '-- Scegli --';
|
||||
$_MODULE['<{fianetfraud}prestashop>fianetfraud_b16c6b201b9dea0dba4c5214e584d5a9'] = 'Dettagli categoria';
|
||||
$_MODULE['<{fianetfraud}prestashop>fianetfraud_3adbdb3ac060038aa0e6e6c138ef9873'] = 'Categoria';
|
||||
$_MODULE['<{fianetfraud}prestashop>fianetfraud_32b1e872d533aced68e8fd06117c35d9'] = 'Tipo di categoria';
|
||||
$_MODULE['<{fianetfraud}prestashop>fianetfraud_bb8d6a9f57dcf8f450d8c8b6107cfabb'] = 'Scegli una categoria ...';
|
||||
$_MODULE['<{fianetfraud}prestashop>fianetfraud_5f001485711e47385cb84b10c888bbfd'] = 'Configurazione corriere';
|
||||
$_MODULE['<{fianetfraud}prestashop>fianetfraud_84a4ee79ed85180a743340dceb2f98d1'] = 'Dettagli corriere';
|
||||
$_MODULE['<{fianetfraud}prestashop>fianetfraud_914419aa32f04011357d3b604a86d7eb'] = 'Corriere';
|
||||
$_MODULE['<{fianetfraud}prestashop>fianetfraud_fecb07f7ab46e23e9b520a9a9af7b97b'] = 'Tipo di corriere';
|
||||
$_MODULE['<{fianetfraud}prestashop>fianetfraud_b04ad61ad875f6e7149fdd51c2e60ce2'] = 'Scegli un tipo di vettorecorriere...';
|
||||
$_MODULE['<{fianetfraud}prestashop>fianetfraud_803d8f90719db3a605cf4af72ab2d8ee'] = 'Tipo di corriere di default';
|
||||
$_MODULE['<{fianetfraud}prestashop>fianetfraud_4a04490d2817c00012562df7bc43299d'] = 'Configurazione pagamento';
|
||||
$_MODULE['<{fianetfraud}prestashop>fianetfraud_ff18b8d27988b97ba1dd72120dd524ea'] = 'Dettaglio di pagamento';
|
||||
$_MODULE['<{fianetfraud}prestashop>fianetfraud_ec51b543e5a38f6044c83f21dce2b23d'] = 'Modulo Pagamento';
|
||||
$_MODULE['<{fianetfraud}prestashop>fianetfraud_7c9a3504dd4ce74b8021267ae1802968'] = 'Tipo di pagamento';
|
||||
$_MODULE['<{fianetfraud}prestashop>fianetfraud_c9cc8cce247e49bae79f15173ce97354'] = 'Salva';
|
||||
$_MODULE['<{fianetfraud}prestashop>fianetfraud_127469a6b4253ebb77adccc0dd48461e'] = 'Sig.';
|
||||
$_MODULE['<{fianetfraud}prestashop>fianetfraud_7f2a1b59ac1ab6d2d892dbbf4f132c40'] = 'Sig.ra';
|
||||
$_MODULE['<{fianetfraud}prestashop>fianetfraud_88183b946cc5f0e8c96b2e66e1c74a7e'] = 'Sconosciuto';
|
||||
$_MODULE['<{fianetfraud}prestashop>fianetfraud_d13270d4831bb2a2723f0fb5b573807c'] = 'Convalida Fianet';
|
||||
$_MODULE['<{fianetfraud}prestashop>fianetfraud_e010021939a49b7cce07f0e546c1d54f'] = 'Vedi dettaglio';
|
||||
$_MODULE['<{fianetfraud}prestashop>fianetfraud_b086843368d1c92d0a86cbee76b20b6f'] = 'Valutaz.';
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 230 B |
Binary file not shown.
|
Before Width: | Height: | Size: 15 KiB |
Reference in New Issue
Block a user