|
@@ -23,8 +23,7 @@ discard block |
|
|
block discarded – undo |
|
23
|
23
|
$radar = $rocket->getRadar(); |
|
24
|
24
|
|
|
25
|
25
|
$response = 'GET' === $radar->getMethod() ? |
|
26
|
|
- $this->buildRedirect($radar->getUri()->__toString(), $rocket->getPayload()) : |
|
27
|
|
- $this->buildHtml($radar->getUri()->__toString(), $rocket->getPayload()); |
|
|
26
|
+ $this->buildRedirect($radar->getUri()->__toString(), $rocket->getPayload()) : $this->buildHtml($radar->getUri()->__toString(), $rocket->getPayload()); |
|
28
|
27
|
|
|
29
|
28
|
$rocket->setDestination($response); |
|
30
|
29
|
|
|
@@ -35,7 +34,7 @@ discard block |
|
|
block discarded – undo |
|
35
|
34
|
|
|
36
|
35
|
protected function buildRedirect(string $endpoint, Collection $payload): Response |
|
37
|
36
|
{ |
|
38
|
|
- $url = $endpoint.(false === strpos($endpoint, '?') ? '?' : '&').$payload->query(); |
|
|
37
|
+ $url = $endpoint . (false === strpos($endpoint, '?') ? '?' : '&') . $payload->query(); |
|
39
|
38
|
|
|
40
|
39
|
$content = sprintf( |
|
41
|
40
|
'<!DOCTYPE html> |
|
@@ -58,10 +57,10 @@ discard block |
|
|
block discarded – undo |
|
58
|
57
|
|
|
59
|
58
|
protected function buildHtml(string $endpoint, Collection $payload): Response |
|
60
|
59
|
{ |
|
61
|
|
- $sHtml = "<form id='alipay_submit' name='alipay_submit' action='".$endpoint."' method='POST'>"; |
|
|
60
|
+ $sHtml = "<form id='alipay_submit' name='alipay_submit' action='" . $endpoint . "' method='POST'>"; |
|
62
|
61
|
foreach ($payload->all() as $key => $val) { |
|
63
|
62
|
$val = str_replace("'", ''', $val); |
|
64
|
|
- $sHtml .= "<input type='hidden' name='".$key."' value='".$val."'/>"; |
|
|
63
|
+ $sHtml .= "<input type='hidden' name='" . $key . "' value='" . $val . "'/>"; |
|
65
|
64
|
} |
|
66
|
65
|
$sHtml .= "<input type='submit' value='ok' style='display:none;'></form>"; |
|
67
|
66
|
$sHtml .= "<script>document.forms['alipay_submit'].submit();</script>"; |