I am making a payment system. When a user pays and the payment is succeed then the URL returned is like:
success.php?ORDER_NUMBER=123456&TIMESTAMP=1426074386&PAID=DBE92B3F3C&METHOD=1&RETURN_AUTHCODE=1DAD7FA700AEAD89C181EA94A322954F
I have success.php file and have returned value in it. I am just wandering how to get those values in my div that is in another class.
<div id="third_nav" style="display: none"><h1>Receipt</h1></div>
My success.php class;
if ($module->confirmPayment($_GET["ORDER_NUMBER"], $_GET["TIMESTAMP"], $_GET["PAID"], $_GET["METHOD"], $_GET["RETURN_AUTHCODE"])) {
// Payment receipt is valid
$ORDER_NUMBER = mysql_real_escape_string($_GET['ORDER_NUMBER']);
$TIMESTAMP = mysql_real_escape_string($_GET['TIMESTAMP']);
$PAID = mysql_real_escape_string($_GET['PAID']);
date_default_timezone_set('Europe/Helsinki');
$dateTime = date("d/m/Y", $TIMESTAMP);
echo $PAID;
echo "<br/>";
echo $dateTime;
echo "<br/>";
echo $ORDER_NUMBER;
echo "<br/>";
//$_SESSION['cart'] = "";
unset($_SESSION['cart']);
}else {
echo "Payment failed";
}
?>
The URL is sent from the bank after the successful payment. Thanks in advance. My jQuery AJAX;
function paymentSuccess(){
event.preventDefault();
$("#third_nav").html('');
var values = //Don´t know what to be here
$.ajax({
url: "success.php",
type: "get",
data: values,
success: function(html){
alert("success");
$("#third_nav").html(html);
},
error:function(){
$("#third_nav").html('There is error while submit');
}
});
}