Add remaining project files (exclude ignored folders)

This commit is contained in:
WD - Dev
2025-07-05 15:11:40 +07:00
parent a96eb2b958
commit b440b80882
4697 changed files with 1365702 additions and 0 deletions
+47
View File
@@ -0,0 +1,47 @@
<?php
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
header('Content-Type: application/json');
include "/www/wwwroot/bilspro/config/connect.php";
// Validasi metode
if ($_SERVER['REQUEST_METHOD'] !== 'POST') {
echo json_encode(['success' => false, 'message' => 'Metode tidak diperbolehkan']);
exit;
}
// Validasi input
$order_id = $_POST['order_id'] ?? '';
if (empty($order_id)) {
echo json_encode(['success' => false, 'message' => 'Order ID tidak ditemukan']);
exit;
}
// Cek status dari database
$stmt = $pdo->prepare("SELECT status FROM apk_payment WHERE order_id = :order_id");
$stmt->bindParam(':order_id', $order_id);
$stmt->execute();
$data = $stmt->fetch(PDO::FETCH_ASSOC);
if (!$data) {
echo json_encode(['success' => false, 'message' => 'Transaksi tidak ditemukan']);
exit;
}
$status = strtoupper($data['status']);
if (in_array($status, ['SUCCESS', 'PENDING', 'CANCELED', 'LUNAS'])) {
echo json_encode([
'success' => true,
'status' => ucfirst(strtolower($status)) // Output: Success, Pending, etc.
]);
} else {
echo json_encode([
'success' => false,
'message' => 'Status tidak dikenali: ' . $status
]);
}