1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174
| <?php
/*****************************************************************************
*
* "Open source" kit for CM-CIC P@iement (TM)
*
* File "Phase1Aller.php":
*
* Author : Euro-Information/e-Commerce (contact: <a href="mailto:centrecom@e-i.com">centrecom@e-i.com</a>)
* Version : 1.04
* Date : 01/01/2009
*
* Copyright: (c) 2009 Euro-Information. All rights reserved.
* License : see attached document "License.txt".
*
*****************************************************************************/
// TPE Settings
// Warning !! CMCIC_Config contains the key, you have to protect this file with all the mechanism available in your development environment.
// You may for instance put this file in another directory and/or change its name. If so, don't forget to adapt the include path below.
require_once("CMCIC_Config.php");
// PHP implementation of RFC2104 hmac sha1 ---
require_once("CMCIC_Tpe.inc.php");
$sOptions = "";
// ----------------------------------------------------------------------------
// 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 = "";
// ----------------------------------------------------------------------------
$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
// ----------------------------------------------------------------------------
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr">
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" />
<meta http-equiv="cache-control" content="no-store, no-cache, must-revalidate, post-check=0, pre-check=0" />
<meta http-equiv="Expires" content="Mon, 26 Jul 1997 05:00:00 GMT" />
<meta http-equiv="pragma" content="no-cache" />
<title>Connexion au serveur de paiement</title>
<link type="text/css" rel="stylesheet" href="CMCIC.css" />
</head>
<body>
<div id="header"> </div>
<div id="frm">
<p>
Cliquez sur le bouton ci-dessous pour vous connecter au serveur de paiement.<br />
<span class="anglais">Click on the following button to be redirected to the payment server.</span>
</p>
<!-- FORMULAIRE TYPE DE PAIEMENT / PAYMENT FORM TEMPLATE -->
<form action="<?php echo $oTpe->sUrlPaiement;?>" method="post" id="PaymentRequest">
<p>
<input type="hidden" name="version" id="version" value="<?php echo $oTpe->sVersion;?>" />
<input type="hidden" name="TPE" id="TPE" value="<?php echo $oTpe->sNumero;?>" />
<input type="hidden" name="date" id="date" value="<?php echo $sDate;?>" />
<input type="hidden" name="montant" id="montant" value="<?php echo $sMontant . $sDevise;?>" />
<input type="hidden" name="reference" id="reference" value="<?php echo $sReference;?>" />
<input type="hidden" name="MAC" id="MAC" value="<?php echo $sMAC;?>" />
<input type="hidden" name="url_retour" id="url_retour" value="<?php echo $oTpe->sUrlKO;?>" />
<input type="hidden" name="url_retour_ok" id="url_retour_ok" value="<?php echo $oTpe->sUrlOK;?>" />
<input type="hidden" name="url_retour_err" id="url_retour_err" value="<?php echo $oTpe->sUrlKO;?>" />
<input type="hidden" name="lgue" id="lgue" value="<?php echo $oTpe->sLangue;?>" />
<input type="hidden" name="societe" id="societe" value="<?php echo $oTpe->sCodeSociete;?>" />
<input type="hidden" name="texte-libre" id="texte-libre" value="<?php echo HtmlEncode($sTexteLibre);?>" />
<input type="hidden" name="mail" id="mail" value="<?php echo $sEmail;?>" />
<input type="submit" name="bouton" id="bouton" value="Connexion / Connection" />
</p>
</form>
<!-- FIN FORMULAIRE TYPE DE PAIEMENT / END PAYMENT FORM TEMPLATE -->
</div>
<div id="source">
<h2> </h2>
</div>
<div id="footer"></div>
</body>
</html> |
Partager