<?php
mysqli_report(MYSQLI_REPORT_OFF);
require_once __DIR__ . '/../includes/db.php';
require_once __DIR__ . '/../includes/akpay_gateway_helper.php';

$raw = file_get_contents('php://input');
$payload = json_decode($raw, true);
if (!is_array($payload)) { $payload = $_POST; }

$result = akpay_apply_deposit_callback($conn, $payload);
http_response_code((int)($result['http_code'] ?? 200));
echo (($result['message'] ?? '') === 'ok') ? 'ok' : 'fail';
