$rocket]); $radar = $rocket->getRadar(); $response = 'GET' === $radar->getMethod() ? $this->buildRedirect($radar->getUri()->__toString(), $rocket->getPayload()) : $this->buildHtml($radar->getUri()->__toString(), $rocket->getPayload()); $rocket->setDestination($response); Logger::info('[alipay][HtmlResponsePlugin] 插件装载完毕', ['rocket' => $rocket]); return $rocket; } protected function buildRedirect(string $endpoint, Collection $payload): Response { $url = $endpoint.(false === strpos($endpoint, '?') ? '?' : '&').$payload->query(); $content = sprintf( ' Redirecting to %1$s Redirecting to %1$s. ', htmlspecialchars($url, ENT_QUOTES) ); return new Response(302, ['Location' => $url], $content); } protected function buildHtml(string $endpoint, Collection $payload): Response { $sHtml = "
"; foreach ($payload->all() as $key => $val) { $val = str_replace("'", ''', $val); $sHtml .= ""; } $sHtml .= "
"; $sHtml .= ""; return new Response(200, [], $sHtml); } }