Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $transaction_id = trim($_POST['transaction_id']);//get the Transaction ID from Ajax request..
- //get the full transaction details as an json from VoguePay
- $json = file_get_contents('https://voguepay.com/?v_transaction_id='.$transaction_id.'&type=json');
- $transaction=json_decode($json, true);
- header('Content-Type: application/json');
- echo json_encode($transaction);
- event.preventDefault();
- //clear the display section
- $("#id-input2").html('');
- var data="";
- //call the Ajax Request..
- $.ajax({
- url: "php/fetch_transaction_id.php",
- type: "POST",
- data: {transaction_id:transaction_id},
- dataType: "json",
- beforeSend: function () {
- $("#transaction_id").attr('disabled', true);
- $('#searchID').attr('disabled', true);
- $('#searchID').val('please wait, sending data...');
- },
- success: function (vp_response) {
- $.map(vp_response, function(index, value) {
- data=index + ' : ' + value;
- $("#id-input2").append($("<li>").append(data));
- $("#id-input2").css('list-style-type', 'none');
- });
- $('#searchID').val('Data Received!');
- },
- error: function () {
- $("#id-input2").append('Sorry, There was an error whilst processing your request');
- $("#transaction_id").removeAttr('disabled');
- $("#transaction_id").val('');
- $("#transaction_id").focus();
- $('#searchID').removeAttr('disabled');
- $('#searchID').val('Query Transaction');
- return false;
- }
- });
Add Comment
Please, Sign In to add comment