<?php 
	include "../../conn.php";
	include "../../functions2.php";

	header('Content-Type: application/json; charset=utf-8');
	header('Strict-Transport-Security: max-age=31536000');
	header('Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept, Authorization');
	header('Access-Control-Allow-Credentials: true');

	$origin = isset($_SERVER['HTTP_ORIGIN']) ? $_SERVER['HTTP_ORIGIN'] : '';
	header('Access-Control-Allow-Origin: ' . $origin);
	header('vary: Origin');

	date_default_timezone_set("Asia/Kolkata");
	$shnunc = date("Y-m-d H:i:s");

	$res = [
		'code' => 0,
		'msg' => 'Succeed',
		'msgCode' => 0,
		'serviceNowTime' => $shnunc,
		'data' => [
			'typelist' => [

				/* ✅ 1) Nagad FIRST */
				[
					'payID' => 2,
					'payTypeID' => 0,
					'payName' => 'Nagad',
					'paySysName' => 'Nagad',
					'payNameUrl' => 'https://ossimg.crhhh.com/bdtgame/payNameIcon/payNameIcon2_202305271853108ybn.png',
					'payNameUrl2' => 'https://ossimg.crhhh.com/bdtgame/payNameIcon/payNameIcon2_202305271853108ybn.png',
					'minPrice' => 0,
					'maxPrice' => 0,
					'scope' => null,
					'typeName' => 'Nagad',
					'typeNameCode' => 0,
					'maxRechargeRifts' => 0.05,
					'sort' => 34
				],

				/* ✅ 2) bkash SECOND */
				[
					'payID' => 1,
					'payTypeID' => 0,
					'payName' => 'bkash',
					'paySysName' => 'bkash',
					'payNameUrl' => 'https://ossimg.crhhh.com/bdtgame/payNameIcon/payNameIcon2_202305271852268s4b.png',
					'payNameUrl2' => 'https://ossimg.crhhh.com/bdtgame/payNameIcon/payNameIcon2_202305271852268s4b.png',
					'minPrice' => 0,
					'maxPrice' => 0,
					'scope' => null,
					'typeName' => 'bkash',
					'typeNameCode' => 0,
					'maxRechargeRifts' => 0.05,
					'sort' => 30
				],

				/* ✅ 3) USDT (as it was) */
				[
					'payID' => 11,
					'payTypeID' => 0,
					'payName' => 'USDT',
					'paySysName' => 'USDT',
					'payNameUrl' => 'https://ossimg.tashanedc.com/Tashanwin/payNameIcon/payNameIcon_202504111358463w2c.jpg',
					'payNameUrl2' => 'https://ossimg.tashanedc.com/Tashanwin/payNameIcon/payNameIcon2_202504111358465sjf.jpg',
					'minPrice' => 0,
					'maxPrice' => 0,
					'scope' => null,
					'typeName' => 'USDT',
					'typeNameCode' => 9205,
					'maxRechargeRifts' => 0.05,
					'sort' => 24
				],
			]
		]
	];

	http_response_code(200);
	echo json_encode($res);
?>
