78 lines
3.3 KiB
PHP
Executable File
78 lines
3.3 KiB
PHP
Executable File
<?php
|
|
/**
|
|
* 2007-2014 PrestaShop
|
|
*
|
|
* 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-2014 PrestaShop SA
|
|
* @license http:// addons.prestashop.com/en/content/12-terms-and-conditions-of-use
|
|
* International Registered Trademark & Property of PrestaShop SA
|
|
*/
|
|
|
|
include(dirname(__FILE__).'/../../config/config.inc.php');
|
|
if (version_compare(_PS_VERSION_, '1.5', '<'))
|
|
include(dirname(__FILE__).'/../../init.php');
|
|
|
|
function simpleExec($cmd)
|
|
{
|
|
exec($cmd, $output);
|
|
return ($output);
|
|
}
|
|
|
|
// Exec directory (see phpinfo)
|
|
$path = _PS_ROOT_DIR_;
|
|
|
|
// mode d'appel
|
|
$PBX_MODE = (int)trim(Tools::getValue('PBX_MODE')); // pour lancement paiement par exécution
|
|
|
|
// identification
|
|
$PBX_SITE = (int)trim(Tools::getValue('PBX_SITE'));
|
|
$PBX_RANG = (int)trim(Tools::getValue('PBX_RANG'));
|
|
$PBX_IDENTIFIANT = (int)trim(Tools::getValue('PBX_IDENTIFIANT'));
|
|
$PBX_LANGUE = trim(Tools::getValue('PBX_LANGUE'));
|
|
|
|
// gestion de la page de connection : paramétrage "invisible"
|
|
$PBX_WAIT = '0';
|
|
$PBX_TXT = '';
|
|
$PBX_BKGD = 'white';
|
|
|
|
// informations paiement (appel)
|
|
$PBX_TOTAL = (int)trim(Tools::getValue('PBX_TOTAL'));
|
|
$PBX_DEVISE = (int)trim(Tools::getValue('PBX_DEVISE'));
|
|
$PBX_CMD = (int)trim(Tools::getValue('PBX_CMD'));
|
|
$PBX_PORTEUR = trim(Tools::getValue('PBX_PORTEUR'));
|
|
|
|
// informations nécessaires aux traitements (réponse)
|
|
$PBX_RETOUR = trim(Tools::getValue('PBX_RETOUR'));
|
|
|
|
$PBX_EFFECTUE = trim(Tools::getValue('PBX_EFFECTUE'));
|
|
$PBX_REFUSE = trim(Tools::getValue('PBX_REFUSE'));
|
|
$PBX_ANNULE = trim(Tools::getValue('PBX_ANNULE'));
|
|
$PBX_REPONDRE_A = trim(Tools::getValue('PBX_REPONDRE_A'));
|
|
|
|
$PBX_PAYBOX = trim(Tools::getValue('PBX_PAYBOX'));
|
|
$PBX_BACKUP1 = trim(Tools::getValue('PBX_BACKUP1'));
|
|
|
|
|
|
// construction de la chaîne de paramètres
|
|
if (Configuration::get('PBX_DEMO_MODE') == 0)
|
|
$PBX = "PBX_MODE=$PBX_MODE PBX_SITE=$PBX_SITE PBX_RANG=$PBX_RANG PBX_IDENTIFIANT=$PBX_IDENTIFIANT PBX_WAIT=$PBX_WAIT PBX_TXT=$PBX_TXT PBX_BKGD=$PBX_BKGD PBX_LANGUE=$PBX_LANGUE PBX_TOTAL=$PBX_TOTAL PBX_DEVISE=$PBX_DEVISE PBX_CMD=$PBX_CMD PBX_PORTEUR=$PBX_PORTEUR PBX_EFFECTUE=$PBX_EFFECTUE PBX_REFUSE=$PBX_REFUSE PBX_ANNULE=$PBX_ANNULE PBX_RETOUR=$PBX_RETOUR PBX_REPONDRE_A=$PBX_REPONDRE_A PBX_PAYBOX=$PBX_PAYBOX PBX_BACKUP1=$PBX_BACKUP1 PBX_EMPREINTE=$PBX_EMPREINTE";
|
|
else
|
|
$PBX = "PBX_MODE=$PBX_MODE PBX_SITE=$PBX_SITE PBX_RANG=$PBX_RANG PBX_IDENTIFIANT=$PBX_IDENTIFIANT PBX_WAIT=$PBX_WAIT PBX_TXT=$PBX_TXT PBX_BKGD=$PBX_BKGD PBX_LANGUE=$PBX_LANGUE PBX_TOTAL=$PBX_TOTAL PBX_DEVISE=$PBX_DEVISE PBX_CMD=$PBX_CMD PBX_PORTEUR=$PBX_PORTEUR PBX_EFFECTUE=$PBX_EFFECTUE PBX_REFUSE=$PBX_REFUSE PBX_ANNULE=$PBX_ANNULE PBX_RETOUR=$PBX_RETOUR PBX_REPONDRE_A=$PBX_REPONDRE_A";
|
|
|
|
// lancement paiement par exécution
|
|
$shell_exec = simpleExec($path.'/module.cgi '.$PBX);
|
|
|
|
// suppression des headers
|
|
array_shift($shell_exec);
|
|
array_shift($shell_exec);
|
|
array_shift($shell_exec);
|
|
array_shift($shell_exec);
|
|
|
|
// redirection vers PayBox
|
|
echo implode('', $shell_exec); |