File: /var/www/html/sarvodayahospital/public/mapp/paymentgatway/request_info_mobile.php
<?php
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
$rawdata = file_get_contents("php://input");
try {
$data = json_decode($rawdata,1);
} catch (JsonException $e) {
$this ->send_response("102", "json parsing error");
}
if(isset($data["facilityGUID"])
&& $data["facilityGUID"]=="f6de8499-0004-5896-ab8c-jduik8JODHJ"){
}else{
exit("404");
}
if(!isset($data["orderid"])){
exit("4041");
}else if(!isset($data["amount"])){
exit("4042");
}else if(!isset($data["name"])){
exit("4043");
}else if(!isset($data["mobile"])){
exit("4044");
}else if(!isset($data["type"])){
exit("4045");
}
$data["interest"] = 'whatsapp booking payment';
$data["redirect_url"] = 'https://www.sarvodayahospital.com/mapp/paymentgatway/mobile_payment.php';
$data["cancel_url"] = 'https://www.sarvodayahospital.com/mapp/paymentgatway/mobile_payment.php';
$time = time();
$data["time"] =$time;
$name = $data["orderid"].'_'.$time;
$myfile = fopen('payment_info/'.$name.'.txt', "w") or die("Unable to open file!");
$txt = json_encode($data);
fwrite($myfile, $txt);
fclose($myfile);
echo json_encode (array(
"code" => "101",
"message" => "Success",
"result" => array( "link" => "https://www.sarvodayahospital.com/mapp/paymentgatway/pay_mobile.php?token=".base64_encode($name)
))
);
?>