Viewing file: paypal_esito.php (5.09 KB) -rw-r--r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
include 'global.php';
filter_var($_GET["Importo"],FILTER_SANITIZE_STRING); $Importo = $_GET["Importo"];
?>
<!DOCTYPE html>
<html lang="en"> <head> <meta charset="utf-8"> <meta content="IE=edge" http-equiv="X-UA-Compatible"> <meta content="width=device-width,initial-scale=1" name="viewport">
<title><?php echo SITETITLE; ?> - Pagamento online</title><!-- Bootstrap --> <link href="css/bootstrap.min.css" rel="stylesheet"><!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries --><!-- WARNING: Respond.js doesn't work if you view the page via file:// --><!--[if lt IE 9]> <!-- jQuery (necessary for Bootstrap's JavaScript plugins) --> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script> <!-- Include all compiled plugins (below), or include individual files as needed --> <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script> <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script> <script src="//cdnjs.cloudflare.com/ajax/libs/jquery-form-validator/2.1.38/jquery.form-validator.min.js"></script> <script src="js/jquery.mask.min.js"></script> <![endif]-->
<style> body { margin-top:20px; } .container { max-width:960px; } input[disabled] { border: 0px solid transparent!important; background-color: #FFF!important; box-shadow: 0px 0px!important; font-weight: bold; } </style> <script> jQuery(document).ready(function() { jQuery('#form_pagamento input[name="Importo"]').mask('000000000000000.00', { reverse: true }); jQuery.validate({ form: '#form_pagamento', modules: 'security', onError: function() { console.log('----'); console.dir(jQuery("#form_pagamento input[name='Causale']")); console.log('----'+jQuery("#form_pagamento input[name='Causale']").val()); }, onSuccess: function() { /* fData =''; jQuery("#form_pagamento input").each( function(item) { var _k_ = this.name; var _v_ = this.value; fData += _k_ + "=" + _v_ + "&"; }); jQuery.ajax({ url: 'request.php', type: 'GET', data: fData, cache: false, dataType: 'json', processData: false, contentType: false, success: function(data, textStatus, jqXHR) { location = data.url; if (typeof data.error === 'undefined') {} else { alert('ERRORS: ' + data.error); } }, error: function(jqXHR, textStatus, errorThrown) { // Handle errors here console.log('ERRORS: ' + textStatus); } }); */ /* jQuery.ajax({ url: 'request.php', type: 'GET', data: fData, cache: false, dataType: 'json', processData: false, contentType: false, success: function(data, textStatus, jqXHR) { location = data.url; if (typeof data.error === 'undefined') {} else { alert('ERRORS: ' + data.error); } }, error: function(jqXHR, textStatus, errorThrown) { // Handle errors here console.log('ERRORS: ' + textStatus); } }); */
var data ={ 'cmd' : '_xclick', 'business' : '<?php echo $paypal_email;?>', 'lc' :'IT', 'currency_code' : 'EUR', 'button_subtype' : 'services', 'no_note' : 1, 'no_shipping' : 2, 'rm' : 1, 'return' : '<?php echo $paypal_urlreturn_OK;?>', 'cancel_return' : '<?php echo $paypal_urlreturn_KO;?>', 'bn' : 'PP-BuyNowBF:btn_paynowCC_LG.gif:NonHosted', 'item_name' : jQuery("#form_pagamento input[name='Causale']").val(), 'amount' : jQuery("#form_pagamento input[name='Importo']").val() }; var f = jQuery('<form />',{method:'post',action:"paypal.php",target:'_blank'}); var k; /* for(k in data) f.append( jQuery('<input />',{ name : k,value : data[k]}) ); */ jQuery("#form_pagamento input").each( function(item) { var _k_ = this.name; var _v_ = this.value; f.append( jQuery('<input />',{ name : _k_,value : _v_}) ); });
f.appendTo(document.body).submit();
f.remove();
/* jQuery.post({ url: 'https://www.paypal.com/cgi-bin/webscr', data: fData, cache: false, dataType: 'json', processData: false, contentType: false, success: function(data, textStatus, jqXHR) { location = data.url; if (typeof data.error === 'undefined') {} else { alert('ERRORS: ' + data.error); } }, error: function(jqXHR, textStatus, errorThrown) { // Handle errors here console.log('ERRORS: ' + textStatus); } }); */
return false; } }); }); </script> </head>
<body> <div class="container">
<div class="header">
<img src="logo_wt1.jpg" height="100">
<h3 class="pull-right text-muted"><?php echo SITENAME; ?> - Pagamento Online</h3>
</div>
<hr style="color:#EEE;width:100%">
<?php
if($_GET['ok']==1) { echo "Pagamento avvenuto con successo! Grazie"; } else { echo "Si sono verificati dei problemi nel pagamento."; } ?> </div> </body> </html>
|