%PDF- %GIF98; %PNG;
Server : ApacheSystem : Linux sh00666.bluehost.com 5.14.0-687.26.1.el9_8.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Jul 14 16:32:02 EDT 2026 x86_64 User : ndkhermy ( 1200) PHP Version : 8.5.12 Disable Function : NONE Directory : /home1/ndkhermy/public_html/website_6ca89795/ |
Upload File : |
<?php
header("Content-Type: application/json");
include("../dbcon.php");
$order_id = intval($_GET['order_id'] ?? 0);
if($order_id <= 0)
{
die("Invalid Order ID");
}
/*
|--------------------------------------------------------------------------
| Get Order
|--------------------------------------------------------------------------
*/
$orderQry = mysqli_query(
$conn,
"SELECT *
FROM orders
WHERE id='$order_id'
LIMIT 1"
);
if(mysqli_num_rows($orderQry) == 0)
{
die("Order Not Found");
}
$order = mysqli_fetch_assoc($orderQry);
/*
|--------------------------------------------------------------------------
| Update Order Status
|--------------------------------------------------------------------------
*/
mysqli_query(
$conn,
"UPDATE orders
SET order_status='Failed'
WHERE id='$order_id'"
);
/*
|--------------------------------------------------------------------------
| Response
|--------------------------------------------------------------------------
*/
echo json_encode([
"status" => false,
"message" => "Payment Failed",
"screen_type" => "failed",
"data" => [
"order_id" =>
$order_id,
"order_number" =>
$order['unique_order_id'],
"total_amount" =>
$order['total_amount'],
"payment_type" =>
$order['payment_type'],
"order_status" =>
"Failed"
]
], JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT);
$conn->close();
?>