<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<meta name="description" content="">
<meta name="author" content="">
<link rel="icon" href="../../favicon.ico">
<title>BNCA: Payment Success</title>
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<!-- Optional theme -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css" integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp" crossorigin="anonymous">
<!-- Latest compiled and minified JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
<style>
#details-container
{
padding-left: 50px;
}
@media(max-width: 600px)
{
#details-container
{padding-left: 20px;}
}
</style>
</head>
<body>
<div class="container">
<div class="page-header">
<h1>Demo Instamojo Product Payment </h1>
</div>
<h3 style="color:#6da552">Thank You, Payment Successful!</h3>
<h4 style="color:#6da552">Keep payment deatils safe for future reference.</h4>
<?php
include 'src/instamojo.php';
$api = new Instamojo\Instamojo('test_471c4569e7c0bbec66bacecaea1', 'test_dbd4f9391fd3909c0736a61506d','https://test.instamojo.com/api/1.1/');
$payid = $_GET["payment_request_id"];
try {
$response = $api->paymentRequestStatus($payid);
echo "<h4>Payment ID: " . $response['payments'][0]['payment_id'] . "</h4>";
echo "<h4>Amount Paid: " . $response['payments'][0]['amount'] . "</h4>";
echo "<h4>Applicant Name: " . $response['payments'][0]['buyer_name'] . "</h4>";
echo "<h4>Applicant Email: " . $response['payments'][0]['buyer_email'] . "</h4>";
echo "<h4>Applicant Mobile Number: " . $response['payments'][0]['buyer_phone'] . "</h4>";
echo "<pre>";
print_r($response);
echo "</pre>";
?>
<?php
}
catch (Exception $e) {
print('Error: ' . $e->getMessage());
}
?>
</div> <!-- /container -->
</body>
</html>