<?php
define('GAME_API_SKIP_MAINTENANCE', true);
require __DIR__ . '/../includes/db.php';
require __DIR__ . '/../includes/propay_gateway_helper.php';
require __DIR__ . '/../includes/akpay_gateway_helper.php';
require __DIR__ . '/../includes/cowpay_gateway_helper.php';

$raw = file_get_contents('php://input');
$payload = json_decode($raw, true);
if (!is_array($payload)) { $payload = array(); }
$result = cowpay_apply_deposit_callback($conn, $payload);
http_response_code(intval($result['http_code'] ?? 200));
echo !empty($result['success']) ? 'success' : 'fail';
?>
