title: Payment Navigation form php to payment gateway and back to php (response back to php page )
body: <p>i created a login.php file where the user can will be navigated to instamojo payment page . After completing the transaction the user is getting the success message from instamojo , but i  need to display the successful transaction in my domain or in own php file . so how can i get the transation related information to my webpage or to my login.php file</p>
  
  <p>Ex: Redirecting from our login.php to instamojo(payment gateway)and response back (success message)to our login.php intimating the user that payment is success</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>var rootURL = "cgshealthcare.com/HealthCareSystem/";;
  $(document).ready(function() {
    $('#login').click(function() {
      if ($('#username').val() == "" || $('#password').val() == "") {
        alert("Please enter username or password");
        return false;
      }
      cardloginUser($('#username').val(), $('#password').val());
    });
  });
  
  function forwardtoRegister() {
    window.location = "login.php?page=register";
  }
  
  function cardloginUser(userName, password) {
    console.log('userName: ' + userName);
    console.log('password: ' + password);
    if (userName.length &lt; 1) {
      $('#errorlist').html("&lt;font color='red'&gt;&lt;b&gt; Please enter User ID&lt;/b&gt;&lt;/font&gt;");
      return false;
    }
    if (password.length &lt; 1) {
      $('#errorlist').html(" &lt;font color='red'&gt;&lt;b&gt; Please enter Password&lt;/b&gt;&lt;/font&gt;");
      return false;
    }
    console.log(rootURL + '/authenticate/' + userName + '/' + password);
    $.ajax({
      type: 'GET',
      url: rootURL + '/authenticate/' + userName + '/' + password,
      dataType: "json",
      success: function(data) {
        console.log("hello" + data.responseMessageDetails);
        var list = data == null ? [] : (data.responseMessageDetails instanceof Array ? data.responseMessageDetails : [data.responseMessageDetails]);
        console.log("List : " + list);
        if ((list).length &lt; 1) {
          $('#errorlist').html("&lt;font color='red'&gt;&lt;b&gt; Invalid User Name and Password Combination &lt;/b&gt;&lt;/font&gt;");
          $('#errorblock').css("visibility") == "visible";
        }
        $.each(list, function(index, responseMessageDetails) {
          console.log("Status " + responseMessageDetails);
          var message = responseMessageDetails.message;
          if (message.indexOf("]:") &gt; 0) message = message.substring(0, message.indexOf("]:") + 2);
          console.log("message" + message);
          console.log("USer Data" + responseMessageDetails.status);
          console.log("USer Data" + responseMessageDetails.message);
          if (responseMessageDetails.status == "Success") {
            window.location = "imjo.in/NpKxN";;
          } else if (responseMessageDetails.status == "Fail") {
            window.location = "www.google.com";
            console.log("Fail1");
            $('#errorlist').html("&lt;font color='red'&gt;&lt;b&gt;" + message + "&lt;/b&gt;&lt;/font&gt;");
          } else {
            console.log("Fail111");
            $('#errorlist').html("&lt;font color='red'&gt;&lt;b&gt; We are sorry some intermittent Issue. Please try after some time. &lt;/b&gt;&lt;/font&gt;");
          }
        });
      },
      error: function(data) {
        console.log("data...." + data);
        var list = data == null ? [] : (data.responseMessageDetails instanceof Array ? data.responseMessageDetails : [data.responseMessageDetails]);
        console.log("data...." + data);
        $.each(list, function(index, responseMessageDetails) {
          console.log(responseMessageDetails);
          var message = responseMessageDetails.message;
          if (message.indexOf("]:") &gt; 0) message = message.substring(0, message.indexOf("]:") + 2);
          $('#errorlist').html("&lt;font color='red'&gt;&lt;b&gt;" + message + "&lt;/b&gt;&lt;/font&gt;");
        });
      }
    });
  }
  
  function showLogin() {
    window.location = "login.php";
  }</code></pre>
  </div>
  </div>
  </p>