Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if( !defined( '_VALID_MOS' ) && !defined( '_JEXEC' ) ) die( 'Direct Access to '.basename(__FILE__).' is not allowed.' );
- /**
- * @version $Id: checkout.sips_cc_form.php Version 2.x Joomla 1.5 / Virtuemart 1.1
- * @package VirtueMart
- * @subpackage html
- * @author Valérie Isaksen <[email protected]>
- * @copyright Copyright (C) 2004-2005 Soeren Eberhardt. All rights reserved.
- * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
- * VirtueMart is free software. This version may have been modified pursuant
- * to the GNU General Public License, and as distributed it includes or
- * is derivative of works licensed under the GNU General Public License or
- * other free or open source software licenses.
- * See /administrator/components/com_virtuemart/COPYRIGHT.php for copyright notices and details.
- *
- * The ps_sips class, containing the payment processing code
- * for transactions with SIPS Payment Gateways
- *
- * For the Joomla >= 1.10 WINDOWS or Linux and SIPS 500 or 600
- *
- */
- mm_showMyFileName( __FILE__ );
- require_once( CLASSPATH ."payment/ps_sips.cfg.php");
- require_once( CLASSPATH ."payment/ps_sips.php");
- $sips = new sips();
- $SIPS_LANG =& new ps_sips_Language();
- global $mosConfig_absolute_path, $mosConfig_live_site, $mosConfig_lang, $ps_vendor_id , $vendor_country_2_code;
- global $VM_LANG, $Itemid;
- $amount = $db->f("order_total")*100;
- $order_id = $db->f("order_id") % 1000000;
- $parm="merchant_id=".SIPS_MERCHANT_ID;
- $parm.=" merchant_country=fr";
- $parm.=" amount=".$amount;
- $parm.=" currency_code=".$sips->getCurrencyIsoCode($db->f("order_currency"));
- $parm.=" pathfile=".$sips->getPathfileFileName();
- $parm.=" transaction_id=".substr(time(),-5,5).rand(0,9);//numéro unique sur la journée
- $parm.=" normal_return_url=".SECUREURL."index.php?page=checkout.sips_response&ItemId=".$Itemid."&option=".$option;
- $parm.=" cancel_return_url=".SECUREURL."index.php?page=checkout.sips_response&ItemId=".$Itemid."&option=".$option;
- $parm.=" automatic_response_url=".SECUREURL."index.php?page=checkout.sips_autoresponse&ItemId=".$Itemid."&option=".$option;
- $parm.=" language=".$sips->getLanguageCode($mosConfig_lang);
- $parm.=" merchant_language=".$sips->getLanguageCode($mosConfig_lang);
- $parm.=" payment_means=".SIPS_PAYMENT_MEANS;
- $parm.=" header_flag=".SIPS_HEADER_FLAG;
- $parm.=" capture_day=";
- $parm.=isset($sips_capture_n_day)? $sips_capture_n_day:SIPS_CAPTURE_DAY;
- $parm.=" capture_mode=";
- $parm.=isset($sips_capture_n_mode)? $sips_capture_n_mode:SIPS_CAPTURE_MODE;
- $parm.=" block_align=".SIPS_BLOCK_ALIGN;
- $parm.=" block_order=".SIPS_BLOCK_ORDER;
- $parm.=" customer_id=".$db->f("user_id");
- $parm.=" customer_email=".$user->email;
- $parm.=" customer_ip_address=".$db->f("ip_address");
- if (isset($sips_data)) $parm.=" data=".$sips_data;
- $parm.=" return_context=".$ps_vendor_id;
- $parm.=" order_id=".$order_id;
- //
- if (SIPS_DEBUG ) {
- echo $parm;
- }
- if ($sips->getOSName()!='WIN') $parm=escapeshellcmd($parm);
- $bin_request = $sips->getBinRequest ("request");
- $result=exec("$bin_request $parm");
- $tableau = explode ("!", "$result");
- $code = $tableau[1];
- $error = $tableau[2];
- $message = $tableau[3];
- if (( $code == "" ) && ( $error == "" ) )
- {
- alert_error ($SIPS_LANG->_('PS_SIPS_EXEC_REQ_NOT_FOUND').SIPS_CGI_BIN_PATH.$SIPS_LANG->_('PS_SIPS_EXEC_REQ_FILE')." ".$path_bin);
- if (file_exists($path_bin)) {
- print "Le fichier $path_bin existe";
- } else {
- print "Le fichier $path_bin n'existe pas";
- }
- echo "<br />Accès de ".$path_bin." ".substr(sprintf('%o', fileperms($path_bin)), -4);
- }
- // Erreur, affiche le message d'erreur
- else if ($code != 0){
- alert_error ($SIPS_LANG->_('PS_SIPS_ERROR_REQUEST')." ".$error);
- }
- else {
- echo (" $message ");
- }
- /**
- * alert_error
- * affiche les messages d'alerte lors d'une erreur
- */
- function alert_error ($message) {
- echo $message;
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment