include("../../configuration.inc.php"); $root=$_SERVER['DOCUMENT_ROOT']; require_once("".$root."/boutique/modules/cybermut2009/CMCIC_Config.php"); if(empty($_POST['montant'])) { $_POST['montant']=0; } if(empty($_POST['mail'])) { $_POST['mail']=""; } if(empty($_POST['formulaire'])) { $_POST['formulaire']=""; } if(empty($_POST['reference'])) { $_POST['reference']=""; $reference="N°CDE OU NOM"; $sReference=$reference; }else{ $sReference=$_POST['reference']; $reference=$sReference; } // PHP implementation of RFC2104 hmac sha1 --- require_once("".$root."/boutique/modules/cybermut2009/CMCIC_Tpe.inc.php"); $result = mysql_query("SELECT max(id) as total FROM peel_commandes "); $com = mysql_fetch_object($result); $commandeid=$com->total+1; // $reference="N°CDE OU NOM"; $sOptions = ""; //$sMontant=$total; //$sEmail = $com->email; // ---------------------------------------------------------------------------- // CheckOut Stub setting fictious Merchant and Order datas. // That's your job to set actual order fields. Here is a stub. // ----------------------------------------------------------------------------- // Reference: unique, alphaNum (A-Z a-z 0-9), 12 characters max //$sReference = "ref" . date("His"); // Amount : format "xxxxx.yy" (no spaces) //$sMontant = 1.01; // Currency : ISO 4217 compliant $sDevise = "EUR"; // free texte : a bigger reference, session context for the return on the merchant website $sTexteLibre = "Texte Libre"; // transaction date : format d/m/y:h:m:s $sDate = date("d/m/Y:H:i:s"); // Language of the company code $sLangue = "FR"; // customer email //$sEmail = "test@test.zz"; // ---------------------------------------------------------------------------- // between 2 and 4 //$sNbrEch = "4"; $sNbrEch = ""; // date echeance 1 - format dd/mm/yyyy //$sDateEcheance1 = date("d/m/Y"); $sDateEcheance1 = ""; // montant échéance 1 - format "xxxxx.yy" (no spaces) //$sMontantEcheance1 = "0.26" . $sDevise; $sMontantEcheance1 = ""; // date echeance 2 - format dd/mm/yyyy $sDateEcheance2 = ""; // montant échéance 2 - format "xxxxx.yy" (no spaces) //$sMontantEcheance2 = "0.25" . $sDevise; $sMontantEcheance2 = ""; // date echeance 3 - format dd/mm/yyyy $sDateEcheance3 = ""; // montant échéance 3 - format "xxxxx.yy" (no spaces) //$sMontantEcheance3 = "0.25" . $sDevise; $sMontantEcheance3 = ""; // date echeance 4 - format dd/mm/yyyy $sDateEcheance4 = ""; // montant échéance 4 - format "xxxxx.yy" (no spaces) //$sMontantEcheance4 = "0.25" . $sDevise; $sMontantEcheance4 = ""; // ---------------------------------------------------------------------------- $sMontant=$_POST['montant']; $sEmail=$_POST['mail']; $oTpe = new CMCIC_Tpe($sLangue); $oHmac = new CMCIC_Hmac($oTpe); // Control String for support $CtlHmac = sprintf(CMCIC_CTLHMAC, $oTpe->sVersion, $oTpe->sNumero, $oHmac->computeHmac(sprintf(CMCIC_CTLHMACSTR, $oTpe->sVersion, $oTpe->sNumero))); // Data to certify $PHP1_FIELDS = sprintf(CMCIC_CGI1_FIELDS, $oTpe->sNumero, $sDate, $sMontant, $sDevise, $sReference, $sTexteLibre, $oTpe->sVersion, $oTpe->sLangue, $oTpe->sCodeSociete, $sEmail, $sNbrEch, $sDateEcheance1, $sMontantEcheance1, $sDateEcheance2, $sMontantEcheance2, $sDateEcheance3, $sMontantEcheance3, $sDateEcheance4, $sMontantEcheance4, $sOptions); // MAC computation $sMAC = $oHmac->computeHmac($PHP1_FIELDS); // --------------------------------------------------- End Stub --------------- // ---------------------------------------------------------------------------- // Your Page displaying payment button to be customized // ---------------------------------------------------------------------------- $_SESSION['idcommande']=$commandeid; ?>