Partie 3 et FIN
Code
// Update products_ordered (for bestsellers list)
tep_db_query("update " . TABLE_PRODUCTS . " set products_ordered = products_ordered + " . sprintf('%d', $order->products[$i]['qty']) . " where products_id = '" . tep_get_prid($order->products[$i]['id']) . "'");
$sql_data_array = array('orders_id' => $insert_id,
'products_id' => tep_get_prid($order->products[$i]['id']),
'products_model' => $order->products[$i]['model'],
'products_name' => $order->products[$i]['name'],
'products_price' => $order->products[$i]['price'],
'final_price' => $order->products[$i]['final_price'],
'products_tax' => $order->products[$i]['tax'],
'products_quantity' => $order->products[$i]['qty']);
tep_db_perform(TABLE_ORDERS_PRODUCTS, $sql_data_array);
$order_products_id = tep_db_insert_id();
//------insert customer choosen option to order--------
$attributes_exist = '0';
$products_ordered_attributes = '';
if (isset($order->products[$i]['attributes'])) {
$attributes_exist = '1';
for ($j=0, $n2=sizeof($order->products[$i]['attributes']); $j<$n2; $j++) {
if (DOWNLOAD_ENABLED == 'true') {
$attributes_query = "select popt.products_options_name, poval.products_options_values_name, pa.options_values_price, pa.price_prefix, pad.products_attributes_maxdays, pad.products_attributes_maxcount , pad.products_attributes_filename
from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_OPTIONS_VALUES . " poval, " . TABLE_PRODUCTS_ATTRIBUTES . " pa
left join " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . " pad
on pa.products_attributes_id=pad.products_attributes_id
where pa.products_id = '" . $order->products[$i]['id'] . "'
and pa.options_id = '" . $order->products[$i]['attributes'][$j]['option_id'] . "'
and pa.options_id = popt.products_options_id
and pa.options_values_id = '" . $order->products[$i]['attributes'][$j]['value_id'] . "'
and pa.options_values_id = poval.products_options_values_id
and popt.language_id = '" . $languages_id . "'
and poval.language_id = '" . $languages_id . "'";
$attributes = tep_db_query($attributes_query);
} else {
$attributes = tep_db_query("select popt.products_options_name, poval.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_OPTIONS_VALUES . " poval, " . TABLE_PRODUCTS_ATTRIBUTES . " pa where pa.products_id = '" . $order->products[$i]['id'] . "' and pa.options_id = '" . $order->products[$i]['attributes'][$j]['option_id'] . "' and pa.options_id = popt.products_options_id and pa.options_values_id = '" . $order->products[$i]['attributes'][$j]['value_id'] . "' and pa.options_values_id = poval.products_options_values_id and popt.language_id = '" . $languages_id . "' and poval.language_id = '" . $languages_id . "'");
}
$attributes_values = tep_db_fetch_array($attributes);
$sql_data_array = array('orders_id' => $insert_id,
'orders_products_id' => $order_products_id,
'products_options' => $attributes_values['products_options_name'],
'products_options_values' => $attributes_values['products_options_values_name'],
'options_values_price' => $attributes_values['options_values_price'],
'price_prefix' => $attributes_values['price_prefix']);
tep_db_perform(TABLE_ORDERS_PRODUCTS_ATTRIBUTES, $sql_data_array);
if ((DOWNLOAD_ENABLED == 'true') && isset($attributes_values['products_attributes_filename']) && tep_not_null($attributes_values['products_attributes_filename'])) {
$sql_data_array = array('orders_id' => $insert_id,
'orders_products_id' => $order_products_id,
'orders_products_filename' => $attributes_values['products_attributes_filename'],
'download_maxdays' => $attributes_values['products_attributes_maxdays'],
'download_count' => $attributes_values['products_attributes_maxcount']);
tep_db_perform(TABLE_ORDERS_PRODUCTS_DOWNLOAD, $sql_data_array);
}
$products_ordered_attributes .= "\n\t" . $attributes_values['products_options_name'] . ' ' . $attributes_values['products_options_values_name'];
}
}
//------insert customer choosen option eof ----
$total_weight += ($order->products[$i]['qty'] * $order->products[$i]['weight']);
$total_tax += tep_calculate_tax($total_products_price, $products_tax) * $order->products[$i]['qty'];
$total_cost += $total_products_price;
$products_ordered .= "<tr><td><FONT color=#000000 size=2 face=Arial>".$order->products[$i]['qty'] . "</font></td><td><FONT color=#000000 size=2 face=Arial>x</font></td><td><FONT color=#000000 size=2 face=Arial>" . $order->products[$i]['name'] . "</font></td><td align='right'><FONT color=#000000 size=2 face=Arial>" . $currencies->display_price($order->products[$i]['final_price'], $order->products[$i]['tax'], $order->products[$i]['qty']) . $products_ordered_attributes . "</font></td></tr>\n";
}
// lets start with the email confirmation
$email_order = "<a href=\"http://www.ton-site.com\"><img src=\"http://www.ton-site.com/images/ton_logo.jpg\" alt=\"ton-site.com\" border=\"0\"></a><br><br><FONT color=#000000 size=2 face=Arial>Bonjour ".$order->customer['firstname'] . " " . $order->customer['lastname']."\n\n";
$email_order .= "ton-site.com a bien enregistré votre commande\n</FONT>";
$email_order .="<table border='1' width='600px' bordercolor='#000000' cellpadding='10' cellspacing='0'><tr><td width='300px'><FONT color=#000000 size=2 face=Arial>Commande n°" . $insert_id . "</font></td><td width='300px' align='right'><FONT color=#000000 size=2 face=Arial>Date de Commande: ". strftime(DATE_FORMAT_SHORT) . "</font></td></tr>\n";
$email_order .="<tr><td colspan='2' align='center'><FONT color=#000000 size=2 face=Arial>Contact: <u>".$order->customer['email_address']."</u></font></td></tr>";
$email_order .="<tr><td width='300px' valign='top'><FONT color=#000000 size=2 face=Arial>";
if ($order->content_type != 'virtual') {
$email_order .= "<b><u>".EMAIL_TEXT_DELIVERY_ADDRESS . "</u>:</b><br>" .
tep_address_label($customer_id, $sendto, 0, '', "<br>") . "<br>";
}
$email_order .="</font></td><td width='300px' valign='top'><FONT color=#000000 size=2 face=Arial>";
$email_order .= "<b></u>".EMAIL_TEXT_BILLING_ADDRESS . "</u>:</b><br>" .
tep_address_label($customer_id, $billto, 0, '', "<br>") . "<br>";
$email_order .="</font></td></tr>\n";
$email_order .= "<tr><td colspan='2'><FONT color=#000000 size=2 face=Arial><b><u>Liste des produits commandés</u>:</b><br>" .
"<br><table width='100%' border='0'>".$products_ordered . "\n";
$email_order .="<tr><td colspan='3'> </td><td align='right'>__________</font></tr> ";
for ($i=0, $n=sizeof($order_totals); $i<$n; $i++) {
$email_order .= "<tr><td align='right' colspan='3'><FONT color=#000000 size=2 face=Arial>".strip_tags($order_totals[$i]['title']) . "</font></td><td align='right'><FONT color=#000000 size=2 face=Arial>" . strip_tags($order_totals[$i]['text']) . "</font></td></tr>";
}
$email_order .="</table></td></tr>\n";
if ($order->info['comments']) {
$email_order .= "<tr><td colspan='2'><FONT color=#000000 size=2 face=Arial><b><u>Commentaire</u>:</b><br> ".strip_tags(tep_db_output($order->info['comments']),'<br>') . "</font></td></tr>\n";
}
$email_order .="<tr><td colspan='2' align='left'><FONT color=#000000 size=2 face=Arial><b><u>".EMAIL_TEXT_PAYMENT_METHOD . "</u>:</b> Carte Bancaire<br><br>".$textepaiement."</font></td></tr></table>";
tep_mail($order->customer['firstname'] . ' ' . $order->customer['lastname'], $order->customer['email_address'], 'Enregistrement de votre commande', $email_order, 'ton-site.com','service.clients@ton-site.com');
// send emails to other people
if (SEND_EXTRA_ORDER_EMAILS_TO != '') {
// tep_mail('', SEND_EXTRA_ORDER_EMAILS_TO, EMAIL_TEXT_SUBJECT, $email_order, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);
}
// load the after_process function from the payment modules
// $payment_modules->after_process();
$cart->reset(true);
// unregister session variables used during checkout
tep_session_unregister('sendto');
tep_session_unregister('billto');
tep_session_unregister('shipping');
tep_session_unregister('payment');
tep_session_unregister('comments');
tep_session_unregister('sms');
break;
case "paiement":
// $payment_modules->before_process();
$sql_data_array = array('customers_id' => $customer_id,
'customers_name' => $order->customer['firstname'] . ' ' . $order->customer['lastname'],
'customers_company' => $order->customer['company'],
'customers_street_address' => $order->customer['street_address'],
'customers_suburb' => $order->customer['suburb'],
'customers_city' => $order->customer['city'],
'customers_postcode' => $order->customer['postcode'],
'customers_state' => $order->customer['state'],
'customers_country' => $order->customer['country']['title'],
'customers_telephone' => $order->customer['telephone'],
'customers_fax' => $order->customer['fax'],
'customers_email_address' => $order->customer['email_address'],
'customers_address_format_id' => $order->customer['format_id'],
'delivery_name' => $order->delivery['firstname'] . ' ' . $order->delivery['lastname'],
'delivery_company' => $order->delivery['company'],
'delivery_street_address' => $order->delivery['street_address'],
'delivery_suburb' => $order->delivery['suburb'],
'delivery_city' => $order->delivery['city'],
'delivery_postcode' => $order->delivery['postcode'],
'delivery_state' => $order->delivery['state'],
'delivery_country' => $order->delivery['country']['title'],
'delivery_address_format_id' => $order->delivery['format_id'],
'billing_name' => $order->billing['firstname'] . ' ' . $order->billing['lastname'],
'billing_company' => $order->billing['company'],
'billing_street_address' => $order->billing['street_address'],
'billing_suburb' => $order->billing['suburb'],
'billing_city' => $order->billing['city'],
'billing_postcode' => $order->billing['postcode'],
'billing_state' => $order->billing['state'],
'billing_country' => $order->billing['country']['title'],
'billing_address_format_id' => $order->billing['format_id'],
'sms' => $order->info['sms'],
'payment_method' => 'Carte Bancaire',
'transaction_id' => tep_db_input($CMCIC_bruteVars['numauto']),
'complementary_info' => tep_db_input($CMCIC_bruteVars['status3ds']).'|'.tep_db_input($CMCIC_bruteVars['originecb']).'|'.tep_db_input($CMCIC_bruteVars['hpancb']).'|'.tep_db_input($CMCIC_bruteVars['ipclient']).'|'.tep_db_input($CMCIC_bruteVars['originetr'].'|'.substr(tep_db_input($CMCIC_bruteVars['texte-libre']),29,8)),
'cc_type' => tep_db_input($CMCIC_bruteVars['brand']),
'cc_owner' => tep_db_input($CMCIC_bruteVars['reference']),
'cc_number' => substr(tep_db_input($CMCIC_bruteVars['bincb']),0,4).' #### #### ##'.substr(tep_db_input($CMCIC_bruteVars['bincb']),4,2),
'cc_bin' => tep_db_input($CMCIC_bruteVars['bincb']),
'cc_expires' => tep_db_input($CMCIC_bruteVars['vld']),
'date_purchased' => 'now()',
'orders_status' => '1',
'ip' => $ip,
'isp' => $isp,
'currency' => $order->info['currency'],
'customers_referer_url' => $referer_url,
'shipping_module' => $shipping['id'],
'currency_value' => $order->info['currency_value']);
tep_db_perform(TABLE_ORDERS, $sql_data_array);
$insert_id = tep_db_insert_id();
for ($i=0, $n=sizeof($order_totals); $i<$n; $i++) {
$sql_data_array = array('orders_id' => $insert_id,
'title' => $order_totals[$i]['title'],
'text' => $order_totals[$i]['text'],
'value' => $order_totals[$i]['value'],
'class' => $order_totals[$i]['code'],
'sort_order' => $order_totals[$i]['sort_order']);
tep_db_perform(TABLE_ORDERS_TOTAL, $sql_data_array);
}
$customer_notification = (SEND_EMAILS == 'true') ? '1' : '0';
$sql_data_array = array('orders_id' => $insert_id,
'orders_status_id' => '1',
'date_added' => 'now()',
'customer_notified' => $customer_notification,
'comments' => $order->info['comments']);
tep_db_perform(TABLE_ORDERS_STATUS_HISTORY, $sql_data_array);
// initialized for the email confirmation
$products_ordered = '';
$subtotal = 0;
$total_tax = 0;
for ($i=0, $n=sizeof($order->products); $i<$n; $i++) {
// Stock Update - Joao Correia
if (STOCK_LIMITED == 'true') {
if (DOWNLOAD_ENABLED == 'true') {
$stock_query_raw = "SELECT products_quantity, pad.products_attributes_filename
FROM " . TABLE_PRODUCTS . " p
LEFT JOIN " . TABLE_PRODUCTS_ATTRIBUTES . " pa
ON p.products_id=pa.products_id
LEFT JOIN " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . " pad
ON pa.products_attributes_id=pad.products_attributes_id
WHERE p.products_id = '" . tep_get_prid($order->products[$i]['id']) . "'";
// Will work with only one option for downloadable products
// otherwise, we have to build the query dynamically with a loop
$products_attributes = $order->products[$i]['attributes'];
if (is_array($products_attributes)) {
$stock_query_raw .= " AND pa.options_id = '" . $products_attributes[0]['option_id'] . "' AND pa.options_values_id = '" . $products_attributes[0]['value_id'] . "'";
}
$stock_query = tep_db_query($stock_query_raw);
} else {
$stock_query = tep_db_query("select products_quantity from " . TABLE_PRODUCTS . " where products_id = '" . tep_get_prid($order->products[$i]['id']) . "'");
}
if (tep_db_num_rows($stock_query) > 0) {
$stock_values = tep_db_fetch_array($stock_query);
// do not decrement quantities if products_attributes_filename exists
if ((DOWNLOAD_ENABLED != 'true') || (!$stock_values['products_attributes_filename'])) {
$stock_left = $stock_values['products_quantity'] - $order->products[$i]['qty'];
} else {
$stock_left = $stock_values['products_quantity'];
}
tep_db_query("update " . TABLE_PRODUCTS . " set products_quantity = '" . $stock_left . "' where products_id = '" . tep_get_prid($order->products[$i]['id']) . "'");
$desactive_query = mysql_query("SELECT conditionnement from products where products_id = '" . tep_get_prid($order->products[$i]['id']) . "'");
while($row = mysql_fetch_array($desactive_query))
{
if ($row[conditionnement]==-100) {
if ( ($stock_left < 1) && (STOCK_ALLOW_CHECKOUT == 'false') ) { // pour annuler disparition produit qd stock=0; $stock_left < 1 est devenu $stock_left < 0
tep_db_query("update " . TABLE_PRODUCTS . " set products_status = '0' where products_id = '" . tep_get_prid($order->products[$i]['id']) . "'");
}}
else {
if ( ($stock_left < 0) && (STOCK_ALLOW_CHECKOUT == 'false') ) { // pour annuler disparition produit qd stock=0; $stock_left < 1 est devenu $stock_left < 0
tep_db_query("update " . TABLE_PRODUCTS . " set products_status = '0' where products_id = '" . tep_get_prid($order->products[$i]['id']) . "'");
}}}
}
}
// Update products_ordered (for bestsellers list)
tep_db_query("update " . TABLE_PRODUCTS . " set products_ordered = products_ordered + " . sprintf('%d', $order->products[$i]['qty']) . " where products_id = '" . tep_get_prid($order->products[$i]['id']) . "'");
$sql_data_array = array('orders_id' => $insert_id,
'products_id' => tep_get_prid($order->products[$i]['id']),
'products_model' => $order->products[$i]['model'],
'products_name' => $order->products[$i]['name'],
'products_price' => $order->products[$i]['price'],
'final_price' => $order->products[$i]['final_price'],
'products_tax' => $order->products[$i]['tax'],
'products_quantity' => $order->products[$i]['qty']);
tep_db_perform(TABLE_ORDERS_PRODUCTS, $sql_data_array);
$order_products_id = tep_db_insert_id();
//------insert customer choosen option to order--------
$attributes_exist = '0';
$products_ordered_attributes = '';
if (isset($order->products[$i]['attributes'])) {
$attributes_exist = '1';
for ($j=0, $n2=sizeof($order->products[$i]['attributes']); $j<$n2; $j++) {
if (DOWNLOAD_ENABLED == 'true') {
$attributes_query = "select popt.products_options_name, poval.products_options_values_name, pa.options_values_price, pa.price_prefix, pad.products_attributes_maxdays, pad.products_attributes_maxcount , pad.products_attributes_filename
from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_OPTIONS_VALUES . " poval, " . TABLE_PRODUCTS_ATTRIBUTES . " pa
left join " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . " pad
on pa.products_attributes_id=pad.products_attributes_id
where pa.products_id = '" . $order->products[$i]['id'] . "'
and pa.options_id = '" . $order->products[$i]['attributes'][$j]['option_id'] . "'
and pa.options_id = popt.products_options_id
and pa.options_values_id = '" . $order->products[$i]['attributes'][$j]['value_id'] . "'
and pa.options_values_id = poval.products_options_values_id
and popt.language_id = '" . $languages_id . "'
and poval.language_id = '" . $languages_id . "'";
$attributes = tep_db_query($attributes_query);
} else {
$attributes = tep_db_query("select popt.products_options_name, poval.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_OPTIONS_VALUES . " poval, " . TABLE_PRODUCTS_ATTRIBUTES . " pa where pa.products_id = '" . $order->products[$i]['id'] . "' and pa.options_id = '" . $order->products[$i]['attributes'][$j]['option_id'] . "' and pa.options_id = popt.products_options_id and pa.options_values_id = '" . $order->products[$i]['attributes'][$j]['value_id'] . "' and pa.options_values_id = poval.products_options_values_id and popt.language_id = '" . $languages_id . "' and poval.language_id = '" . $languages_id . "'");
}
$attributes_values = tep_db_fetch_array($attributes);
$sql_data_array = array('orders_id' => $insert_id,
'orders_products_id' => $order_products_id,
'products_options' => $attributes_values['products_options_name'],
'products_options_values' => $attributes_values['products_options_values_name'],
'options_values_price' => $attributes_values['options_values_price'],
'price_prefix' => $attributes_values['price_prefix']);
tep_db_perform(TABLE_ORDERS_PRODUCTS_ATTRIBUTES, $sql_data_array);
if ((DOWNLOAD_ENABLED == 'true') && isset($attributes_values['products_attributes_filename']) && tep_not_null($attributes_values['products_attributes_filename'])) {
$sql_data_array = array('orders_id' => $insert_id,
'orders_products_id' => $order_products_id,
'orders_products_filename' => $attributes_values['products_attributes_filename'],
'download_maxdays' => $attributes_values['products_attributes_maxdays'],
'download_count' => $attributes_values['products_attributes_maxcount']);
tep_db_perform(TABLE_ORDERS_PRODUCTS_DOWNLOAD, $sql_data_array);
}
$products_ordered_attributes .= "\n\t" . $attributes_values['products_options_name'] . ' ' . $attributes_values['products_options_values_name'];
}
}
//------insert customer choosen option eof ----
$total_weight += ($order->products[$i]['qty'] * $order->products[$i]['weight']);
$total_tax += tep_calculate_tax($total_products_price, $products_tax) * $order->products[$i]['qty'];
$total_cost += $total_products_price;
$products_ordered .= "<tr><td><FONT color=#000000 size=2 face=Arial>".$order->products[$i]['qty'] . "</font></td><td><FONT color=#000000 size=2 face=Arial>x</font></td><td><FONT color=#000000 size=2 face=Arial>" . $order->products[$i]['name'] . "</font></td><td align='right'><FONT color=#000000 size=2 face=Arial>" . $currencies->display_price($order->products[$i]['final_price'], $order->products[$i]['tax'], $order->products[$i]['qty']) . $products_ordered_attributes . "</font></td></tr>\n";
}
// lets start with the email confirmation
$email_order = "<a href=\"http://www.ton-site.com\"><img src=\"http://www.ton-site.com/images/ton_logo.jpg\" alt=\"ton-site.com\" border=\"0\"></a><br><br><FONT color=#000000 size=2 face=Arial>Bonjour ".$order->customer['firstname'] . " " . $order->customer['lastname']."\n\n";
$email_order .= "ton-site.com a bien enregistré votre commande\n</FONT>";
$email_order .="<table border='1' width='600px' bordercolor='#000000' cellpadding='10' cellspacing='0'><tr><td width='300px'><FONT color=#000000 size=2 face=Arial>Commande n°" . $insert_id . "</font></td><td width='300px' align='right'><FONT color=#000000 size=2 face=Arial>Date de Commande: ". strftime(DATE_FORMAT_SHORT) . "</font></td></tr>\n";
$email_order .="<tr><td colspan='2' align='center'><FONT color=#000000 size=2 face=Arial>Contact: <u>".$order->customer['email_address']."</u></font></td></tr>";
$email_order .="<tr><td width='300px' valign='top'><FONT color=#000000 size=2 face=Arial>";
if ($order->content_type != 'virtual') {
$email_order .= "<b><u>".EMAIL_TEXT_DELIVERY_ADDRESS . "</u>:</b><br>" .
tep_address_label($customer_id, $sendto, 0, '', "<br>") . "<br>";
}
$email_order .="</font></td><td width='300px' valign='top'><FONT color=#000000 size=2 face=Arial>";
$email_order .= "<b></u>".EMAIL_TEXT_BILLING_ADDRESS . "</u>:</b><br>" .
tep_address_label($customer_id, $billto, 0, '', "<br>") . "<br>";
$email_order .="</font></td></tr>\n";
$email_order .= "<tr><td colspan='2'><FONT color=#000000 size=2 face=Arial><b><u>Liste des produits commandés</u>:</b><br>" .
"<br><table width='100%' border='0'>".$products_ordered . "\n";
$email_order .="<tr><td colspan='3'> </td><td align='right'>__________</font></tr> ";
for ($i=0, $n=sizeof($order_totals); $i<$n; $i++) {
$email_order .= "<tr><td align='right' colspan='3'><FONT color=#000000 size=2 face=Arial>".strip_tags($order_totals[$i]['title']) . "</font></td><td align='right'><FONT color=#000000 size=2 face=Arial>" . strip_tags($order_totals[$i]['text']) . "</font></td></tr>";
}
$email_order .="</table></td></tr>\n";
if ($order->info['comments']) {
$email_order .= "<tr><td colspan='2'><FONT color=#000000 size=2 face=Arial><b><u>Commentaire</u>:</b><br> ".strip_tags(tep_db_output($order->info['comments']),'<br>') . "</font></td></tr>\n";
}
$email_order .="<tr><td colspan='2' align='left'><FONT color=#000000 size=2 face=Arial><b><u>".EMAIL_TEXT_PAYMENT_METHOD . "</u>:</b> Carte Bancaire<br><br>".$textepaiement."</font></td></tr></table>";
tep_mail($order->customer['firstname'] . ' ' . $order->customer['lastname'], $order->customer['email_address'], 'Enregistrement de votre commande', $email_order, 'ton-site.com','service.clients@ton-site.com');
// send emails to other people
if (SEND_EXTRA_ORDER_EMAILS_TO != '') {
// tep_mail('', SEND_EXTRA_ORDER_EMAILS_TO, EMAIL_TEXT_SUBJECT, $email_order, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);
}
// load the after_process function from the payment modules
// $payment_modules->after_process();
$cart->reset(true);
// unregister session variables used during checkout
tep_session_unregister('sendto');
tep_session_unregister('billto');
tep_session_unregister('shipping');
tep_session_unregister('payment');
tep_session_unregister('comments');
tep_session_unregister('sms');
break;
}
$receipt = CMCIC_CGI2_MACOK;
}
else
{
// your code if the HMAC doesn't match
$receipt = CMCIC_CGI2_MACNOTOK.$cgi2_fields;
}
//-----------------------------------------------------------------------------
// Send receipt to CMCIC server
//-----------------------------------------------------------------------------
printf (CMCIC_CGI2_RECEIPT, $receipt);
// Copyright (c) 2009 Euro-Information ( mailto:centrecom@e-i.com )
// All rights reserved. ---
?>
Les 3 parties de codes font le meme fichier