<?php
require __DIR__.'/_bootstrap.php';
use Zoo\Database;
use Zoo\Withdrawal\RaastAgentService;
try{
 $in=input_json();
 $r=(new RaastAgentService(Database::connect()))->login(
   (string)($in['agent_code']??''),(string)($in['secret']??'')
 );
 json_out(['ok'=>true]+$r);
}catch(Throwable $e){json_out(['ok'=>false,'error'=>$e->getMessage()],401);}
