je suis en train de finaliser l'intégration du systeme de paiement cetrel.lu mais je rencontre quelques petits soucis et j'aurais besoin d'un petit coup de pousse pour conclure.
voici où j'en suis dans l'intégration :
j'ai créé le module cetrel.php que j'ai rajouté dans mes systèmes de paiement :
CITATION
<?php
/*
$Id: secpay.php,v 1.31 2003/01/29 19:57:15 hpdl Exp $
osCommerce, Open Source E-Commerce Solutions
http://www.oscommerce.com
Copyright © 2003 osCommerce
Released under the GNU General Public License
*/
class cetrel {
var $code, $title, $description, $enabled;
// class constructor
function cetrel() {
global $order;
$this->code = 'cetrel';
$this->title = MODULE_PAYMENT_CETREL_TITRE_DESCRIPTION;
$this->description = MODULE_PAYMENT_CETREL_TEXT_DESCRIPTION;
$this->sort_order = MODULE_PAYMENT_CETREL_SORT_ORDER;
$this->enabled = ((MODULE_PAYMENT_CETREL_STATUS == 'True') ? true : false);
if ((int)MODULE_PAYMENT_CETREL_ORDER_STATUS_ID > 0) {
$this->order_status = MODULE_PAYMENT_CETREL_ORDER_STATUS_ID;
}
$this->form_action_url = 'https://pos.cetrel.lu/cgi-bin/pos1/intro.pl';
}
function javascript_validation() {
return false;
}
function selection() {
return array('id' => $this->code,
'module' => $this->title);
}
function pre_confirmation_check() {
return false;
}
function confirmation() {
return false;
}
function process_button() {
global $order, $currencies, $currency;
$lastname= strtolower($order->customer['lastname']);
$lastname= str_replace(array("é","è","ë","ê","ù","û","ï","î","ô","ö"),array("e","e","e","e","u","u","i","i","o","o"),$lastname);
$arrayAutorise=array("a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","1","2","3","4","5","6","7","8","9","0");
$lastnameFinal="";
for($i=0;$i<strlen($lastname);$i++){
if(in_array(substr($lastname,$i,1), $arrayAutorise)){
$lastnameFinal.=substr($lastname,$i,1);
}
}
$trefnum=substr(strtoupper($lastnameFinal),0,.date("dmYHi");
$process_button_string=tep_draw_hidden_field('merchid', MODULE_PAYMENT_CETREL_MERCHANT_ID) .
tep_draw_hidden_field('amount', $order->info['total']) .
tep_draw_hidden_field('msgnr', MODULE_PAYMENT_CETREL_MSGNR) .
tep_draw_hidden_field('trefnum', $trefnum) .
tep_draw_hidden_field('currency', 'EUR') .
tep_draw_hidden_field('language', 'FR') .
tep_draw_hidden_field('currencylabel', 'Euro');
// on valide automatiquement
if(substr(HTTP_SERVER,strlen(HTTP_SERVER)-1,1)=="/"){
$url=HTTP_SERVER.FILENAME_CHECKOUT_PROCESS;
} else {
$url=HTTP_SERVER."/".FILENAME_CHECKOUT_PROCESS;
}
$url.="?".tep_session_name()."=".tep_session_id()."&pass=1";
//echo $url;
$texte= $this->http_request($url,array() );
if ( is_int(strpos($texte, "<")) ) {
$headers=substr($texte, 0, strpos($texte, "<")) ;
$texte=substr($texte, strpos($texte, "<")) ;
} else {
$headers=$texte ;
}
//echo "<br>url : ".$url;
// Si le texte retourné contient Location, cela veut dire qu'il y a un appel à une autre page par un header (Location:
// Donc on inclu le nouveau fichier jusque ce qu'il n'y ait plus d'appel à une autre page
while ( is_int(strpos(strtolower($headers), "location:")) ) {
//$_COOKIE=array_merge($_COOKIE, $this->createCookies($headers)) ;
$array=explode("\r\n", $headers) ;
reset($array) ;
while ( list(, $value)=each($array) ) {
if ( is_int(strpos(strtolower($value), "location:")) ) {
$location=trim(substr($value, strpos($value, ":")+1)) ;
if ( !is_int(strpos($location, "http://") ) ) {
/************************************************************************
* Ce n'est pas bon si le fichier de location se trouve dans un autre repertoire -> à revoir ! *
************************************************************************/
$location=dirname($url)."/".basename($location) ;
}
//Réinitiallisation des variables
$ME_REQUEST=array() ;
if ( is_int(strpos($location, "?")) ) {
$arrayTmp=substr($location, strpos($location, "?")+1) ;
$arrayTmp=explode("&", $arrayTmp) ;
while ( list(, $value)=each($arrayTmp) ) {
$tmpValue=explode("=", $value) ;
$ME_REQUEST[$tmpValue[0]]=$tmpValue[1] ;
}
}
$location.="?".tep_session_name()."=".tep_session_id();
//echo "<br>redirection : ".$location;
$texte=$this->http_request($location, array()) ;
if ( is_int(strpos($texte, "<")) ) {
$headers=substr($texte, 0, strpos($texte, "<")) ;
$texte=substr($texte, strpos($texte, "<")) ;
} else {
$headers=$texte ;
}
}
}
}
return $process_button_string;
}
function before_process() {
return false;
}
function after_process() {
return false;
}
function get_error() {
global $HTTP_GET_VARS;
if (isset($HTTP_GET_VARS['message']) && (strlen($HTTP_GET_VARS['message']) > 0)) {
$error = stripslashes(urldecode($HTTP_GET_VARS['message']));
} else {
$error = MODULE_PAYMENT_CETREL_TEXT_ERROR_MESSAGE;
}
return array('title' => MODULE_PAYMENT_CETREL_TEXT_ERROR,
'error' => $error);
}
function check() {
if (!isset($this->_check)) {
$check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_PAYMENT_CETREL_STATUS'");
$this->_check = tep_db_num_rows($check_query);
}
return $this->_check;
}
function install() {
tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Payment Cetrel', 'MODULE_PAYMENT_CETREL_STATUS', 'True', 'Voulez-vous accepter le paiement Cetrel ?', '6', '0', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");
tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Identification du Négociant', 'MODULE_PAYMENT_CETREL_MERCHANT_ID', '2126026692', 'Identification du négociant à employer pour le service de Cetrel.', '6', '1', now())");
tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('msgnr', 'MODULE_PAYMENT_CETREL_MSGNR', '200', 'Laisser à 200 sauf si vous voulez utiliser les préautorisations ?', '6', '2', now())");
tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Ordre de trie', 'MODULE_PAYMENT_CETREL_SORT_ORDER', '0', 'Ordre de trie pour l\'affichage (Le plus petit nombre est montrer en premier).', '6', '0', now())");
tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, use_function, date_added) values ('Etat de la commande', 'MODULE_PAYMENT_CETREL_ORDER_STATUS_ID', '0', 'Sélectionner l\'état de la commande que vous voulez par défault.', '6', '0', 'tep_cfg_pull_down_order_statuses(', 'tep_get_order_status_name', now())");
}
function remove() {
tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')");
}
function keys() {
return array('MODULE_PAYMENT_CETREL_STATUS', 'MODULE_PAYMENT_CETREL_MERCHANT_ID', 'MODULE_PAYMENT_CETREL_MSGNR','MODULE_PAYMENT_CETREL_SORT_ORDER','MODULE_PAYMENT_CETREL_ORDER_STATUS_ID');
}
function http_request($url, $post=false, $cookie=false, $head=false, $referer=false) {
$headers = '';
$data = '';
$res = '';
$method = $post ? 'POST' : 'GET';
$method = $head ? 'HEAD' : $method;
if($url=="http://"){
return ;
}
extract(parse_url($url));
$cport = isset($port) ? (int)$port : 80;
$port = isset($port) ? ':'.$port : '';
$headers .= $method.' '.$path;
$headers .= isset($query) ? '?'.$query : '';
$headers .= " HTTP/1.0\r\n";
$headers .= "Host: $host$port\r\n";
$headers .= ($referer) ? "Referer: $referer\r\n" : '';
if($post && !$head) {
/*
//remplacé par la l'appel à la fonction http_request_encode_url pour permettre le passage de tableaux dans le socket
$tmpvars = array();
foreach($post as $key=>$val) {
$tmpvars[] = rawurlencode($key).'='.rawurlencode($val);
}
*/
$tmpvars=$this->http_request_encode_url($post) ;
//$data .= implode('&', $tmpvars) . "\r\n";
$data .= implode('&', $tmpvars) ;
$headers .= "Content-type: application/x-www-form-urlencoded\r\n";
}
if ( $cookie ) {
$tmpvars=array() ;
foreach ( $cookie as $key=>$val ) {
$tmpvars[].=rawurlencode($key).'='.rawurlencode($val) ;
}
$headers.='Cookie: '.implode('; ', $tmpvars)."\r\n" ;
}
$headers .= "Connection: close\r\n";
if($data) {
$headers .= 'Content-length: '.strlen($data)."\r\n";
}
$request = $headers."\r\n".$data;
$fs = @fsockopen($host, $cport, $error, $errno, 20) ;
//stream_set_timeout($fs, 10) ;
if ( !$fs ) {
echo "Erreur $errno: $error<br />\r\n";
} else {
fputs($fs, $request);
$indice=0 ;
while ( !feof($fs) ) {
++$indice ;
$res .= fgets($fs, 2048) ;
}
fclose($fs);
return $res;
}
return false;
}
function http_request_encode_url($array, $keyParent=NULL, $tmpvars=array()) {
reset($array) ;
while ( list($key, $value)=each($array) ) {
if ( is_array($value) ) {
if ( $keyParent!==NULL ) {
$tmpKey=$keyParent.'['.$key.']' ;
} else {
$tmpKey=$key ;
}
$tmpvars=http_request_encode_url($value, $tmpKey, $tmpvars) ;
} else {
if ( $keyParent===NULL ) {
$tmpvars[] = rawurlencode($key).'='.rawurlencode($value) ;
} else {
$tmpvars[] = rawurlencode($keyParent."[".$key."]")."=".rawurlencode($value) ;
}
}
}
return $tmpvars ;
}
}
?>
/*
$Id: secpay.php,v 1.31 2003/01/29 19:57:15 hpdl Exp $
osCommerce, Open Source E-Commerce Solutions
http://www.oscommerce.com
Copyright © 2003 osCommerce
Released under the GNU General Public License
*/
class cetrel {
var $code, $title, $description, $enabled;
// class constructor
function cetrel() {
global $order;
$this->code = 'cetrel';
$this->title = MODULE_PAYMENT_CETREL_TITRE_DESCRIPTION;
$this->description = MODULE_PAYMENT_CETREL_TEXT_DESCRIPTION;
$this->sort_order = MODULE_PAYMENT_CETREL_SORT_ORDER;
$this->enabled = ((MODULE_PAYMENT_CETREL_STATUS == 'True') ? true : false);
if ((int)MODULE_PAYMENT_CETREL_ORDER_STATUS_ID > 0) {
$this->order_status = MODULE_PAYMENT_CETREL_ORDER_STATUS_ID;
}
$this->form_action_url = 'https://pos.cetrel.lu/cgi-bin/pos1/intro.pl';
}
function javascript_validation() {
return false;
}
function selection() {
return array('id' => $this->code,
'module' => $this->title);
}
function pre_confirmation_check() {
return false;
}
function confirmation() {
return false;
}
function process_button() {
global $order, $currencies, $currency;
$lastname= strtolower($order->customer['lastname']);
$lastname= str_replace(array("é","è","ë","ê","ù","û","ï","î","ô","ö"),array("e","e","e","e","u","u","i","i","o","o"),$lastname);
$arrayAutorise=array("a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","1","2","3","4","5","6","7","8","9","0");
$lastnameFinal="";
for($i=0;$i<strlen($lastname);$i++){
if(in_array(substr($lastname,$i,1), $arrayAutorise)){
$lastnameFinal.=substr($lastname,$i,1);
}
}
$trefnum=substr(strtoupper($lastnameFinal),0,.date("dmYHi");
$process_button_string=tep_draw_hidden_field('merchid', MODULE_PAYMENT_CETREL_MERCHANT_ID) .
tep_draw_hidden_field('amount', $order->info['total']) .
tep_draw_hidden_field('msgnr', MODULE_PAYMENT_CETREL_MSGNR) .
tep_draw_hidden_field('trefnum', $trefnum) .
tep_draw_hidden_field('currency', 'EUR') .
tep_draw_hidden_field('language', 'FR') .
tep_draw_hidden_field('currencylabel', 'Euro');
// on valide automatiquement
if(substr(HTTP_SERVER,strlen(HTTP_SERVER)-1,1)=="/"){
$url=HTTP_SERVER.FILENAME_CHECKOUT_PROCESS;
} else {
$url=HTTP_SERVER."/".FILENAME_CHECKOUT_PROCESS;
}
$url.="?".tep_session_name()."=".tep_session_id()."&pass=1";
//echo $url;
$texte= $this->http_request($url,array() );
if ( is_int(strpos($texte, "<")) ) {
$headers=substr($texte, 0, strpos($texte, "<")) ;
$texte=substr($texte, strpos($texte, "<")) ;
} else {
$headers=$texte ;
}
//echo "<br>url : ".$url;
// Si le texte retourné contient Location, cela veut dire qu'il y a un appel à une autre page par un header (Location:
// Donc on inclu le nouveau fichier jusque ce qu'il n'y ait plus d'appel à une autre page
while ( is_int(strpos(strtolower($headers), "location:")) ) {
//$_COOKIE=array_merge($_COOKIE, $this->createCookies($headers)) ;
$array=explode("\r\n", $headers) ;
reset($array) ;
while ( list(, $value)=each($array) ) {
if ( is_int(strpos(strtolower($value), "location:")) ) {
$location=trim(substr($value, strpos($value, ":")+1)) ;
if ( !is_int(strpos($location, "http://") ) ) {
/************************************************************************
* Ce n'est pas bon si le fichier de location se trouve dans un autre repertoire -> à revoir ! *
************************************************************************/
$location=dirname($url)."/".basename($location) ;
}
//Réinitiallisation des variables
$ME_REQUEST=array() ;
if ( is_int(strpos($location, "?")) ) {
$arrayTmp=substr($location, strpos($location, "?")+1) ;
$arrayTmp=explode("&", $arrayTmp) ;
while ( list(, $value)=each($arrayTmp) ) {
$tmpValue=explode("=", $value) ;
$ME_REQUEST[$tmpValue[0]]=$tmpValue[1] ;
}
}
$location.="?".tep_session_name()."=".tep_session_id();
//echo "<br>redirection : ".$location;
$texte=$this->http_request($location, array()) ;
if ( is_int(strpos($texte, "<")) ) {
$headers=substr($texte, 0, strpos($texte, "<")) ;
$texte=substr($texte, strpos($texte, "<")) ;
} else {
$headers=$texte ;
}
}
}
}
return $process_button_string;
}
function before_process() {
return false;
}
function after_process() {
return false;
}
function get_error() {
global $HTTP_GET_VARS;
if (isset($HTTP_GET_VARS['message']) && (strlen($HTTP_GET_VARS['message']) > 0)) {
$error = stripslashes(urldecode($HTTP_GET_VARS['message']));
} else {
$error = MODULE_PAYMENT_CETREL_TEXT_ERROR_MESSAGE;
}
return array('title' => MODULE_PAYMENT_CETREL_TEXT_ERROR,
'error' => $error);
}
function check() {
if (!isset($this->_check)) {
$check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_PAYMENT_CETREL_STATUS'");
$this->_check = tep_db_num_rows($check_query);
}
return $this->_check;
}
function install() {
tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Payment Cetrel', 'MODULE_PAYMENT_CETREL_STATUS', 'True', 'Voulez-vous accepter le paiement Cetrel ?', '6', '0', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");
tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Identification du Négociant', 'MODULE_PAYMENT_CETREL_MERCHANT_ID', '2126026692', 'Identification du négociant à employer pour le service de Cetrel.', '6', '1', now())");
tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('msgnr', 'MODULE_PAYMENT_CETREL_MSGNR', '200', 'Laisser à 200 sauf si vous voulez utiliser les préautorisations ?', '6', '2', now())");
tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Ordre de trie', 'MODULE_PAYMENT_CETREL_SORT_ORDER', '0', 'Ordre de trie pour l\'affichage (Le plus petit nombre est montrer en premier).', '6', '0', now())");
tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, use_function, date_added) values ('Etat de la commande', 'MODULE_PAYMENT_CETREL_ORDER_STATUS_ID', '0', 'Sélectionner l\'état de la commande que vous voulez par défault.', '6', '0', 'tep_cfg_pull_down_order_statuses(', 'tep_get_order_status_name', now())");
}
function remove() {
tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')");
}
function keys() {
return array('MODULE_PAYMENT_CETREL_STATUS', 'MODULE_PAYMENT_CETREL_MERCHANT_ID', 'MODULE_PAYMENT_CETREL_MSGNR','MODULE_PAYMENT_CETREL_SORT_ORDER','MODULE_PAYMENT_CETREL_ORDER_STATUS_ID');
}
function http_request($url, $post=false, $cookie=false, $head=false, $referer=false) {
$headers = '';
$data = '';
$res = '';
$method = $post ? 'POST' : 'GET';
$method = $head ? 'HEAD' : $method;
if($url=="http://"){
return ;
}
extract(parse_url($url));
$cport = isset($port) ? (int)$port : 80;
$port = isset($port) ? ':'.$port : '';
$headers .= $method.' '.$path;
$headers .= isset($query) ? '?'.$query : '';
$headers .= " HTTP/1.0\r\n";
$headers .= "Host: $host$port\r\n";
$headers .= ($referer) ? "Referer: $referer\r\n" : '';
if($post && !$head) {
/*
//remplacé par la l'appel à la fonction http_request_encode_url pour permettre le passage de tableaux dans le socket
$tmpvars = array();
foreach($post as $key=>$val) {
$tmpvars[] = rawurlencode($key).'='.rawurlencode($val);
}
*/
$tmpvars=$this->http_request_encode_url($post) ;
//$data .= implode('&', $tmpvars) . "\r\n";
$data .= implode('&', $tmpvars) ;
$headers .= "Content-type: application/x-www-form-urlencoded\r\n";
}
if ( $cookie ) {
$tmpvars=array() ;
foreach ( $cookie as $key=>$val ) {
$tmpvars[].=rawurlencode($key).'='.rawurlencode($val) ;
}
$headers.='Cookie: '.implode('; ', $tmpvars)."\r\n" ;
}
$headers .= "Connection: close\r\n";
if($data) {
$headers .= 'Content-length: '.strlen($data)."\r\n";
}
$request = $headers."\r\n".$data;
$fs = @fsockopen($host, $cport, $error, $errno, 20) ;
//stream_set_timeout($fs, 10) ;
if ( !$fs ) {
echo "Erreur $errno: $error<br />\r\n";
} else {
fputs($fs, $request);
$indice=0 ;
while ( !feof($fs) ) {
++$indice ;
$res .= fgets($fs, 2048) ;
}
fclose($fs);
return $res;
}
return false;
}
function http_request_encode_url($array, $keyParent=NULL, $tmpvars=array()) {
reset($array) ;
while ( list($key, $value)=each($array) ) {
if ( is_array($value) ) {
if ( $keyParent!==NULL ) {
$tmpKey=$keyParent.'['.$key.']' ;
} else {
$tmpKey=$key ;
}
$tmpvars=http_request_encode_url($value, $tmpKey, $tmpvars) ;
} else {
if ( $keyParent===NULL ) {
$tmpvars[] = rawurlencode($key).'='.rawurlencode($value) ;
} else {
$tmpvars[] = rawurlencode($keyParent."[".$key."]")."=".rawurlencode($value) ;
}
}
}
return $tmpvars ;
}
}
?>
Ensuite j'ai modifier mon html_outpout.php comme ceci :
CITATION
////
// The HTML href link wrapper function
function tep_href_link($page = '', $parameters = '', $connection = 'NONSSL', $add_session_id = true, $search_engine_safe = true) {
global $request_type, $session_started, $SID;
if (!tep_not_null($page)) { $SID=PHP_SESSION_NAME.'='.session_id();
die('</td></tr></table></td></tr></table><br><br><font color="#ff0000"><b>Error!</b></font><br><br><b>Unable to determine the page link!<br><br>');
}
// The HTML href link wrapper function
function tep_href_link($page = '', $parameters = '', $connection = 'NONSSL', $add_session_id = true, $search_engine_safe = true) {
global $request_type, $session_started, $SID;
if (!tep_not_null($page)) { $SID=PHP_SESSION_NAME.'='.session_id();
die('</td></tr></table></td></tr></table><br><br><font color="#ff0000"><b>Error!</b></font><br><br><b>Unable to determine the page link!<br><br>');
}
au lieu de ça :
CITATION
////
// The HTML href link wrapper function
function tep_href_link($page = '', $parameters = '', $connection = 'NONSSL', $add_session_id = true, $search_engine_safe = true) {
global $request_type, $session_started, $SID;
if (!tep_not_null($page)) {
die('</td></tr></table></td></tr></table><br><br><font color="#ff0000"><b>Error!</b></font><br><br><b>Unable to determine the page link!<br><br>');
}
// The HTML href link wrapper function
function tep_href_link($page = '', $parameters = '', $connection = 'NONSSL', $add_session_id = true, $search_engine_safe = true) {
global $request_type, $session_started, $SID;
if (!tep_not_null($page)) {
die('</td></tr></table></td></tr></table><br><br><font color="#ff0000"><b>Error!</b></font><br><br><b>Unable to determine the page link!<br><br>');
}
et enfin mon checkout_process.php en mettant ça :
CITATION
// if the customer is not logged on, redirect them to the login page
echo "pass=".$HTTP_GET_VARS["pass"];
if($HTTP_GET_VARS["pass"]!=1){
if (!tep_session_is_registered('customer_id')) {
$navigation->set_snapshot(array('mode' => 'SSL', 'page' => FILENAME_CHECKOUT_PAYMENT));
tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));
}
if (!tep_session_is_registered('sendto')) {
tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL'));
}
if ( (tep_not_null(MODULE_PAYMENT_INSTALLED)) && (!tep_session_is_registered('payment')) ) {
tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL'));
}
// avoid hack attempts during the checkout procedure by checking the internal cartID
if (isset($cart->cartID) && tep_session_is_registered('cartID')) {
if ($cart->cartID != $cartID) {
tep_redirect(tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'));
}
}
}
echo "pass=".$HTTP_GET_VARS["pass"];
if($HTTP_GET_VARS["pass"]!=1){
if (!tep_session_is_registered('customer_id')) {
$navigation->set_snapshot(array('mode' => 'SSL', 'page' => FILENAME_CHECKOUT_PAYMENT));
tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));
}
if (!tep_session_is_registered('sendto')) {
tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL'));
}
if ( (tep_not_null(MODULE_PAYMENT_INSTALLED)) && (!tep_session_is_registered('payment')) ) {
tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL'));
}
// avoid hack attempts during the checkout procedure by checking the internal cartID
if (isset($cart->cartID) && tep_session_is_registered('cartID')) {
if ($cart->cartID != $cartID) {
tep_redirect(tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'));
}
}
}
au lieu de ça :
CITATION
// if the customer is not logged on, redirect them to the login page
if (!tep_session_is_registered('customer_id')) {
$navigation->set_snapshot(array('mode' => 'SSL', 'page' => FILENAME_CHECKOUT_PAYMENT));
tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));
}
if (!tep_session_is_registered('sendto')) {
tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL'));
}
if ( (tep_not_null(MODULE_PAYMENT_INSTALLED)) && (!tep_session_is_registered('payment')) ) {
tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL'));
}
if (!tep_session_is_registered('customer_id')) {
$navigation->set_snapshot(array('mode' => 'SSL', 'page' => FILENAME_CHECKOUT_PAYMENT));
tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));
}
if (!tep_session_is_registered('sendto')) {
tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL'));
}
if ( (tep_not_null(MODULE_PAYMENT_INSTALLED)) && (!tep_session_is_registered('payment')) ) {
tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL'));
}
Dans le principe, le retour de cetrel est à mon sens incompatible avec os commerce, j'ai donc fait le choix d'enregistrer la commande dans la base au moment où le client clique sur confirmer et après je vérifie si j'ai reçu la confirmation de paiement de cetrel, et les emails envoyés aux clients sont modifiés dans ce sens.
Dans la pratique tout marche bien sauf pour les autres paiement chèques et virements et là je bloque, j'obtiens le message d'erreur suivant :
CITATION
pass=
Warning: Cannot modify header information - headers already sent by (output started at /home/xxx/www/site/boutique/checkout_process.php:17) in /home/xxx/www/site/boutique/includes/functions/general.php on line 29
Warning: Cannot modify header information - headers already sent by (output started at /home/xxx/www/site/boutique/checkout_process.php:17) in /home/xxx/www/site/boutique/includes/functions/general.php on line 29
Et là impossible d'arriver à corriger ce message d'erreur, la commande s'enregistre bien mais j'ai ce message. Quelqu'un pourrait t'il m'aider car je désespère
Merci par avance
David