Sid Gifari From Gifari Industries - BD Cyber Security Team
Home
/
home
/
airmobeuag
/
2020
/
commande_v2
/
form
/
✏️
Editing: paiement.php
<script src="https://js.stripe.com/v3/"></script> <?php $ClassCdeV2 = new ClassCdeV2(); $_SESSION['AIRCMDV2']['Param']['btnSuivant'] = "enabled"; // Liste Quantité sur l etape (1) $EtapeCourante = $_SESSION['AIRCMDV2']['etape']; // FIBRE : Comprotement si FTTH ou FTTO $idP = $_SESSION['AIRCMDV2']['Commande']['f']['1']['1']['id']; $NomProduit = $_SESSION['AIRCMDV2']['NomProduits'][$idP]['nom']; ?> <div class="form-row"> <div class="col"> <label for="name">Nom prénom :</label> <input type="text" id="name" name="name" class="form-control" value="<?=$_SESSION['AIRCMDV2']['Commande']['Utilisateur']['nomprenom']?>" required> </div> <div class="col"> <label for="email" >Adresse email :</label> <input id="email" name="email" type="email" class="form-control" value="<?=$_SESSION['AIRCMDV2']['Commande']['Utilisateur']['email']?>" required> </div> </div> <br> <div class="form-row"> <div class="col-4"> <label for="name">Code PROMO</label> <input type="text" id="description" name="description" class="form-control" value="<?=$_SESSION['AIRCMDV2']['CodePROMO']['nom']?>" OnChange="ControleBtnSuivant(<?=$_SESSION['AIRCMDV2']['etape']?>)"> </div> </div> <?php // Si internet ou Telephonie OU Fibre mais FTTO if ( ($_REQUEST['type']=='f' && $NomProduit!="FTTH") || $_REQUEST['type']<>'f') { $LibellBtn = "Règlement"; ?> <br> <div class="form-row"> <div class="col"> <nav> <div class="nav nav-tabs" id="nav-tab" role="tablist"> <!-- <?php if($_REQUEST['type']=='f') {?> <?php } else { ?> <a class="nav-item nav-link active" href="form/stripe.cb.v2.php" data-target="#stripeCB" role="tab" id="stripeCB_tab" data-toggle="tab" rel="tooltip" aria-selected="true"> Carte Bancaire </a> <a class="nav-item nav-link " href="form/stripe.sepa.php" data-target="#stripeSEPA" role="tab" id="stripeSEPA_tab" data-toggle="tab" rel="tooltip" aria-selected="false"> SEPA </a> <?php } ?> --> <?php if($_REQUEST['type']=='f') {?> <a class="nav-item nav-link active" role="tab" href="javascript:Charge('SEPA');">SEPA</a> <?php } else { if(!$_REQUEST['m'] || $_REQUEST['m']=="cb") $active1="active"; else $active2="active"; ?> <a class="nav-item nav-link <?=$active1?>" role="tab" href="javascript:Charge('CB');">Carte Bancaire</a> <a class="nav-item nav-link <?=$active2?>" role="tab" href="javascript:Charge('SEPA');">SEPA</a> <?php } ?> </div> </nav> <div class="tab-content" id="nav-tabContent"> <br> <?php // $_SESSION['AIRCMDV2']['TotalCmd'] vient de panier.php $TotalFact = $_SESSION['AIRCMDV2']['TotalCmd']; $MontantWeb = number_format($TotalFact, 2, ',', ''); $MontantCB = $TotalFact*100; ?> <h3><b>Montant à régler : <?=$MontantWeb?> € TTC</b></h3> <b>Règlement des frais de mise en service et de votre premier mois d'abonnement.</b> <input id="amount" name="amount" type="hidden" value="<?=$MontantCB?>" required> <input id="nobdc" name="nobdc" type="hidden" value="<?=$_SESSION['AIRCMDV2']['idunique']?>" required> <?php if($_REQUEST['type']=='f') { $activeS="in active"; } else { $activeC="in active"; } ?> <div class="" id="stripeCB" ></div> <div class="" id="stripeSEPA"></div> </div> </div> </div> <?php } else { $LibellBtn = "SUIVANT"; ?> <div class="form-row"> <div class="col"><br><br> <h4>Votre éligibilité nécessite une étude complémentaire.<br>Nous vous remercions et allons vous contacter très rapidement. </h4> <input type="hidden" name="FTTH_contact" value="Ok"> </div> </div> <?php } ?> <?php //if($ZoneReglement) {?> <br><br> <div style="text-align:center; border:0px solid #000;"> <?php $urlretour = "commande.v2.php?type=".$_REQUEST['type']."&p=".$_REQUEST['p']."&e=4";?> <a class="btn btn-retour" name="btn_precedent" type="button" value="" OnClick="javascript:location=('<?=$urlretour?>')"> RETOUR </a> </div> <?php //} ?> <!-- <div style="text-align:center;"> <form method="post" name="form1" id="form1"> <button name="Retour" type="submit" class="btn btn-default" value="1" OnClick="Annule();">RETOUR</button> </form> </div>--> <?php if(!$_REQUEST['m']) {?> <?php if($_REQUEST['type']=='f') {?> <script> $.get('form/stripe.sepa.php', function(data) { $('#stripeSEPA').html(data); }); </script> <?php } else { ?> <script> $.get('form/stripe.cb.v2.php', function(data) { $('#stripeCB').html(data); }); </script> <?php } ?> <?php } ?> <?php if ($_REQUEST['m']=="sepa") { ?> <script> $.get('form/stripe.sepa.php', function(data) { $('#stripeSEPA').html(data); }); </script> <?php } ?> <?php if ($_REQUEST['m']=="cb") { ?> <script> $.get('form/stripe.cb.v2.php', function(data) { $('#stripeCB').html(data); }); </script> <?php } ?> <script> function Charge(type) { if(type=="SEPA") { $('#Btn_Regler').css('display','block'); /*$('#stripeCB').html(''); $.get('form/stripe.sepa.php', function(data) { $('#stripeSEPA').html(data); });*/ location=('commande.v2.php?type=i&p=30&e=5&m=sepa'); } else { $('#Btn_Regler').css('display','none'); location=('commande.v2.php?type=i&p=30&e=5&m=cb'); /* $('#stripeSEPA').html(''); $.get('form/stripe.cb.v2.php', function(data) { $('#stripeCB').html(data); });*/ } } </script> <?php if($_REQUEST['type']=='f') {?> <script> //Charge('SEPA'); //$.get('form/stripe.sepa.php', function(data) { // $('#stripeSEPA').html(data); // $('#stripeCB').html(); //}); </script> <?php } else { ?> <script> //Charge('CB'); //$.get('form/stripe.cb.php', function(data) {$('#stripeCB').html(data);}); //$.get('form/stripe.cb.v2.php', function(data) { //$('#stripeCB').html(data); // $('#stripeSEPA').html(); //}); </script> <?php } ?> <script> function confirmation( ope ) { if(ope=="SUIVANT") var str = "Nous allons étudier votre demande et vous contactons rapidement."; else var str = "AVERTISSEMENT : En cliquant sur le bouton OK, vous confirmez défintivement votre règlement.\n\n Voulez-vous réellement continuer ?"; var ret = confirm(str); // Lance le Submit if(ret==true) { $('#zone_reglement').css('display','none'); $('#wait2').css('display','block'); document.formSaisie.submit(); } else { return false; } $('#zone_reglement').css('display','block'); $('#wait2').css('display','none'); } function Annule() { $("#name").removeAttr("required"); $("#email").removeAttr("required"); } $('#Btn_Regler').click(function(e) { }); // Force CB // Change mode de paiement $('[data-toggle="tab"]').click(function(e) { var $this = $(this), loadurl = $this.attr('href'), targ = $this.attr('data-target'); $.get(loadurl, function(data) { $(targ).html(data); }); $this.tab('show'); return false; }); </script> <?php if($_SESSION['AIRCMDV2']['TEST001']['mode']=="OK") {?> <script> //var stripe = Stripe('pk_test_VLb2CrCzsRuWvarkzoXSFga4'); /* var paymentRequest = stripe.paymentRequest({ country: 'FR', currency: 'eur', total: { label: 'Commande AIRMOB', amount: 005, }, requestPayerName: true, requestPayerEmail: true, }); var elements = stripe.elements(); var prButton = elements.create('paymentRequestButton', { paymentRequest: paymentRequest, }); // Check the availability of the Payment Request API first. paymentRequest.canMakePayment().then(function(result) { if (result) { prButton.mount('#payment-request-button'); } else { document.getElementById('payment-request-button').style.display = 'none'; } }); paymentRequest.on('paymentmethod', function(ev) { // Confirm the PaymentIntent without handling potential next actions (yet). stripe.confirmCardPayment( clientSecret, {payment_method: ev.paymentMethod.id}, {handleActions: false} ).then(function(confirmResult) { if (confirmResult.error) { // Report to the browser that the payment failed, prompting it to // re-show the payment interface, or show an error message and close // the payment interface. ev.complete('fail'); } else { // Report to the browser that the confirmation was successful, prompting // it to close the browser payment method collection interface. ev.complete('success'); // Let Stripe.js handle the rest of the payment flow. stripe.confirmCardPayment(clientSecret).then(function(result) { if (result.error) { // The payment failed -- ask your customer for a new payment method. } else { // The payment has succeeded. alert('OK'); } }); } }); }); */ </script> <?php }?> <script> // sideScroll(container,'right',20,610,10); </script> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"></script>
💾 Save
❌ Cancel