-
Notifications
You must be signed in to change notification settings - Fork 0
/
payer.php
367 lines (310 loc) · 21.3 KB
/
payer.php
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
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
<?php
include("config.php");
include("include/util.php");
if (!isset($_SESSION['user']))
header("location:connect.php");
$user = mysql_fetch_array(mysql_query("select * from immat_users where email='" . $_SESSION['user'] . "'"));
$id_cmd = $_SESSION["id_cmd"];
$oo = mysql_query("select * from immat_user_info_voiture where id=" . $id_cmd)or die(mysql_error());
$commande = mysql_fetch_array($oo);
$last_amount = number_format($commande['total'], 2, '.', ' ');
$chaine_cmd = $commande['matricule'];
?>
<?php
/* * ***************************************************************************
*
* "Open source" kit for Monetico Paiement (TM)
*
* File "Phase1Go.php":
*
* Author : Euro-Information/e-Commerce
* Version : 4.0
* Date : 06/06/2014
*
* Copyright: (c) 2014 Euro-Information. All rights reserved.
* License : see attached document "License.txt".
*
* *************************************************************************** */
// =============================================================================================================================================================
// SECTION INCLUDE : Cette section ne doit pas être modifié.
// Attention !! MoneticoPaiement_Config contient la clé, vous devez protéger ce fichier avec tous les mécanismes disponibles dans votre environnement de développement.
// Vous pouvez pour l'instance mettre ce fichier dans un autre répertoire et/ou changer son nom. Dans ce cas, n'oubliez pas d'adapter le chemin d'inclusion ci-dessous.
//
// INCLUDE SECTION : This section must not be modified
// Warning !! MoneticoPaiement_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("MoneticoPaiement_Config.php");
// PHP implementation of RFC2104 hmac sha1 ---
require_once("MoneticoPaiement_Ept.inc.php");
// =============================================================================================================================================================
// FIN SECTION INCLUDE
//
// END INCLUDE SECTION
// =============================================================================================================================================================
// =============================================================================================================================================================
// SECTION PAIEMENT : Cette section doit être modifiée
// Ci-après, vous trouverez un exemple des valeurs requises pour effectuer un paiement en utilisant la solution Monetico Paiement.
// L'ordre des variables et le format des valeurs doivent correspondre aux spécifications techniques.
//
// PAYMENT SECTION : This section must be modified
// Here after, you will find an example of the values needed to demand a payment using the Monetico paiement solution.
// The order of the variables and the format of the values must follow the technical specification.
// =============================================================================================================================================================
// -------------------------------------------------------------------------------------------------------------------------------------------------------------
// SECTION PAIEMENT - Section générale
//
// PAYMENT SECTION - General section
// -------------------------------------------------------------------------------------------------------------------------------------------------------------
// Reference: unique, alphaNum (A-Z a-z 0-9), 12 characters max
$sReference = $commande['ref_cmd'];
// Amount : format "xxxxx.yy" (no spaces)
$sMontant = $last_amount;
$tranche = $last_amount / 3;
// Currency : ISO 4217 compliant
$sDevise = "EUR";
// free texte : a bigger reference, session context for the return on the merchant website
$sTexteLibre = "";
// 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 = $_SESSION['user'];
$sOptions = "";
// -------------------------------------------------------------------------------------------------------------------------------------------------------------
// SECTION PAIEMENT FRACTIONNE - Section spécifique au paiement fractionné
//
// INSTALMENT PAYMENT SECTION - Section specific to the installment payment
// -------------------------------------------------------------------------------------------------------------------------------------------------------------
// between 2 and 4
// entre 2 et 4
//$sNbrEch = "4";
$sNbrEch = 3;
$ladate = date("Y-m-d");
$ech1 = date('d/m/Y', strtotime('+0 month', strtotime($ladate)));
$ech2 = date('d/m/Y', strtotime('+1 month', strtotime($ladate)));
$ech3 = date('d/m/Y', strtotime('+2 month', strtotime($ladate)));
// date echeance 1 - format dd/mm/yyyy
//$sDateEcheance1 = date("d/m/Y");
$sDateEcheance1 = $ech1;
// montant �ch�ance 1 - format "xxxxx.yy" (no spaces)
//$sMontantEcheance1 = "0.26" . $sDevise;
$sMontantEcheance1 = "$tranche"."EUR";
// date echeance 2 - format dd/mm/yyyy
$sDateEcheance2 = $ech2;
// montant �ch�ance 2 - format "xxxxx.yy" (no spaces)
//$sMontantEcheance2 = "0.25" . $sDevise;
$sMontantEcheance2 = "$tranche"."EUR";
// date echeance 3 - format dd/mm/yyyy
$sDateEcheance3 = $ech3;
// montant �ch�ance 3 - format "xxxxx.yy" (no spaces)
//$sMontantEcheance3 = "0.25" . $sDevise;
$sMontantEcheance3 = "$tranche"."EUR";
// date echeance 4 - format dd/mm/yyyy
$sDateEcheance4 = "";
// montant �ch�ance 4 - format "xxxxx.yy" (no spaces)
//$sMontantEcheance4 = "0.25" . $sDevise;
$sMontantEcheance4 = "";
// =============================================================================================================================================================
// FIN SECTION PAIEMENT
//
// END PAYMENT SECTION
// =============================================================================================================================================================
// =============================================================================================================================================================
// SECTION CODE : Cette section ne doit pas être modifiée
//
// CODE SECTION : This section must not be modified
// =============================================================================================================================================================
$oEpt = new MoneticoPaiement_Ept($sLangue);
$oHmac = new MoneticoPaiement_Hmac($oEpt);
// Control String for support
$CtlHmac = sprintf(MONETICOPAIEMENT_CTLHMAC, $oEpt->sVersion, $oEpt->sNumero, $oHmac->computeHmac(sprintf(MONETICOPAIEMENT_CTLHMACSTR, $oEpt->sVersion, $oEpt->sNumero)));
// Data to certify
$phase1go_fields = sprintf(MONETICOPAIEMENT_phase1go_fields, $oEpt->sNumero, $sDate, $sMontant, $sDevise, $sReference, $sTexteLibre, $oEpt->sVersion, $oEpt->sLangue, $oEpt->sCodeSociete, $sEmail, $sNbrEch, $sDateEcheance1, $sMontantEcheance1, $sDateEcheance2, $sMontantEcheance2, $sDateEcheance3, $sMontantEcheance3, $sDateEcheance4, $sMontantEcheance4, $sOptions);
// MAC computation
$sMAC = $oHmac->computeHmac($phase1go_fields);
// =============================================================================================================================================================
// FIN SECTION CODE
//
// END CODE SECTION
// =============================================================================================================================================================
?>
<!DOCTYPE HTML>
<html class="no-js">
<head>
<!-- Basic Page Needs
================================================== -->
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Paiement sécurisé</title>
<meta name="description" content="">
<meta name="keywords" content="">
<meta name="author" content="Sami Jilani">
<!-- Mobile Specific Metas
================================================== -->
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0">
<meta name="format-detection" content="telephone=no">
<!-- CSS
================================================== -->
<link href="css/bootstrap.css" rel="stylesheet" type="text/css">
<link href="css/bootstrap-theme.css" rel="stylesheet" type="text/css">
<link href="css/style.css" rel="stylesheet" type="text/css">
<link href="vendor/prettyphoto/css/prettyPhoto.css" rel="stylesheet" type="text/css">
<link href="vendor/owl-carousel/css/owl.carousel.css" rel="stylesheet" type="text/css">
<link href="vendor/owl-carousel/css/owl.theme.css" rel="stylesheet" type="text/css">
<!--[if lte IE 9]><link rel="stylesheet" type="text/css" href="css/ie.css" media="screen" /><![endif]-->
<link href="css/custom.css" rel="stylesheet" type="text/css"><!-- CUSTOM STYLESHEET FOR STYLING -->
<!-- Color Style -->
<link href="colors/color1.css" rel="stylesheet" type="text/css">
<!-- SCRIPTS
================================================== -->
<script src="js/modernizr.js"></script><!-- Modernizr -->
<script>
(function (i, s, o, g, r, a, m) {
i['GoogleAnalyticsObject'] = r;
i[r] = i[r] || function () {
(i[r].q = i[r].q || []).push(arguments)
}, i[r].l = 1 * new Date();
a = s.createElement(o),
m = s.getElementsByTagName(o)[0];
a.async = 1;
a.src = g;
m.parentNode.insertBefore(a, m)
})(window, document, 'script', '//www.google-analytics.com/analytics.js', 'ga');
ga('create', 'UA-71574959-1', 'auto');
ga('send', 'pageview');
</script>
</head>
<body>
<!--[if lt IE 7]>
<p class="chromeframe">You are using an outdated browser. <a href="http://browsehappy.com/">Upgrade your browser today</a> or <a href="http://www.google.com/chromeframe/?redirect=true">install Google Chrome Frame</a> to better experience this site.</p>
<![endif]-->
<div class="body">
<!-- Start Site Header -->
<div class="site-header-wrapper">
<?php include("module/header.php"); ?>
<!-- End Site Header -->
<?php include("module/menu.php"); ?>
</div>
<!-- Start Body Content -->
<div class="main" role="main">
<div id="content" class="content full dashboard-pages">
<div class="container">
<div class="dashboard-wrapper">
<div class="row">
<div class="col-md-12 col-sm-12">
<h2>Récapitulatif</h2>
<div class="dashboard-block">
<div class="dashboard-block-head">
<h3>Ma commande</h3>
</div>
<div class="table-responsive">
<table class="table table-bordered dashboard-tables saved-cars-table">
<thead>
<tr>
<td>Description</td>
<td>Prix</td>
</tr>
</thead>
<tbody>
<?php
$detail_sql = mysql_query("select * from immat_cmd_detail where idcmd=" . $id_cmd);
while ($detail = mysql_fetch_array($detail_sql)) {
?>
<tr>
<td>
<div class="search-find-results" style="padding-left: 20px;">
<h5><?php echo stripslashes($detail['prestation']); ?></h5>
</div>
</td>
<td><span class="price">€ <?php echo number_format($detail['montant'], 2, ',', ' '); ?></span></td>
</tr>
<?php
}
?>
</tbody>
</table>
</div>
</div>
<div class="row">
<div class="col-md-4 col-sm-4 dealer-block">
<h2>Adresse de Livraison</h2>
<?php
$sql_adr = mysql_query("select * from immat_adresselivraison where idcmd=" . $id_cmd);
$adr = mysql_fetch_array($sql_adr);
?>
<div style="font-size: 16px; line-height: 36px;">
<div><?php echo $adr['nom']; ?></div>
<div><?php echo $adr['rue'] . ", " . $adr['adresse']; ?></div>
<div><?php echo $adr['cp'] . ", " . $adr['ville']; ?></div>
<div>France</div>
</div>
</div>
<div class="col-md-4 col-sm-4 dealer-block"></div>
<div class="col-md-4 col-sm-4 dealer-block">
<div style="background-color:#ccc" class="dealer-block-inner">
<div class="dealer-block-cont">
<div class="dealer-block-info" style="text-align: right; margin-top: 10px;">
<span class="label label-default" style="font-size: 30px ! important;">€ <?php echo number_format($last_amount, 2, ',', ' '); ?></span>
</div>
<div class="dealer-block-text">
<p>Vous pouvez procéder au paiement en cliquant sur le bouton Payer</p>
</div>
<div class="text-align-center">
<form action="<?php echo $oEpt->sUrlPaiement; ?>" method="post" id="PaymentRequest">
<input type="hidden" name="version" id="version" value="<?php echo $oEpt->sVersion; ?>" />
<input type="hidden" name="TPE" id="TPE" value="<?php echo $oEpt->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 $oEpt->sUrlKO; ?>" />
<input type="hidden" name="url_retour_ok" id="url_retour_ok" value="<?php echo $oEpt->sUrlOK; ?>" />
<input type="hidden" name="url_retour_err" id="url_retour_err" value="<?php echo $oEpt->sUrlKO; ?>" />
<input type="hidden" name="lgue" id="lgue" value="<?php echo $oEpt->sLangue; ?>" />
<input type="hidden" name="societe" id="societe" value="<?php echo $oEpt->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="hidden" name="nbrech" id="nbrech" value="<?php echo $sNbrEch; ?>" />
<input type="hidden" name="dateech1" id="dateech1" value="<?php echo $sDateEcheance1; ?>" />
<input type="hidden" name="montantech1" id="montantech1" value="<?php echo $sMontantEcheance1; ?>" />
<input type="hidden" name="dateech2" id="dateech2" value="<?php echo $sDateEcheance2; ?>" />
<input type="hidden" name="montantech2" id="montantech2" value="<?php echo $sMontantEcheance2; ?>" />
<input type="hidden" name="dateech3" id="dateech3" value="<?php echo $sDateEcheance3; ?>" />
<input type="hidden" name="montantech3" id="montantech3" value="<?php echo $sMontantEcheance3; ?>" />
<input type="hidden" name="dateech4" id="dateech4" value="<?php echo $sDateEcheance4; ?>" />
<input type="hidden" name="montantech4" id="montantech4" value="<?php echo $sMontantEcheance4; ?>" />
<input type="checkbox" required="" value=""> <a href="CVG ILLICO IMMAT.pdf" target="_blanc"> J'accepte les conditions d'utilisations</a>
<button type="submit" class="btn btn-primary" id="payerfact">PAYER</button>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- End Body Content -->
<!-- Start site footer -->
<?php include("module/footer.php") ?>
<!-- End site footer -->
<a id="back-to-top"><i class="fa fa-angle-double-up"></i></a>
</div>
<!-- LOGIN POPUP -->
<?php include("module/login.php") ?>
<script src="js/jquery-2.0.0.min.js"></script> <!-- Jquery Library Call -->
<script src="vendor/prettyphoto/js/prettyphoto.js"></script> <!-- PrettyPhoto Plugin -->
<script src="js/ui-plugins.js"></script> <!-- UI Plugins -->
<script src="js/helper-plugins.js"></script> <!-- Helper Plugins -->
<script src="vendor/owl-carousel/js/owl.carousel.min.js"></script> <!-- Owl Carousel -->
<script src="vendor/password-checker.js"></script> <!-- Password Checker -->
<script src="js/bootstrap.js"></script> <!-- UI -->
<script src="js/init.js"></script> <!-- All Scripts -->
<script src="vendor/flexslider/js/jquery.flexslider.js"></script> <!-- FlexSlider -->
<script src="http://maps.googleapis.com/maps/api/js?sensor=false"></script>
</body>
</html>