checkWebLogin(); header('Content-Type: application/json'); $data = json_decode(file_get_contents('php://input'), true); $service = new TransactionService(new Database()); $result = $service->fundRequest( $this->getCurrentUserId(), $data['type'] ?? '', floatval($data['amount'] ?? 0), $data['remark'] ?? '' ); echo json_encode($result); } public function transfer() { $this->checkWebLogin(); header('Content-Type: application/json'); $data = json_decode(file_get_contents('php://input'), true); $service = new TransactionService(new Database()); $result = $service->transfer( $this->getCurrentUserId(), trim($data['to_username'] ?? ''), floatval($data['amount'] ?? 0) ); echo json_encode($result); } }