@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | * |
| 97 | 97 | * @version 2017-08-10 |
| 98 | 98 | * |
| 99 | - * @param [type] $gateway [description] |
|
| 99 | + * @param string $gateway [description] |
|
| 100 | 100 | * |
| 101 | 101 | * @return [type] [description] |
| 102 | 102 | */ |
@@ -118,7 +118,7 @@ discard block |
||
| 118 | 118 | * |
| 119 | 119 | * @version 2017-07-30 |
| 120 | 120 | * |
| 121 | - * @param [type] $gateway [description] |
|
| 121 | + * @param string $gateway [description] |
|
| 122 | 122 | * |
| 123 | 123 | * @return [type] [description] |
| 124 | 124 | */ |
@@ -196,13 +196,13 @@ discard block |
||
| 196 | 196 | */ |
| 197 | 197 | protected function buildPayHtml() |
| 198 | 198 | { |
| 199 | - $sHtml = "<form id='alipaysubmit' name='alipaysubmit' action='".$this->gateway."?charset=utf-8' method='POST'>"; |
|
| 200 | - while (list ($key, $val) = each ($this->config)) { |
|
| 201 | - $val = str_replace("'","'",$val); |
|
| 202 | - $sHtml.= "<input type='hidden' name='".$key."' value='".$val."'/>"; |
|
| 199 | + $sHtml = "<form id='alipaysubmit' name='alipaysubmit' action='" . $this->gateway . "?charset=utf-8' method='POST'>"; |
|
| 200 | + while (list ($key, $val) = each($this->config)) { |
|
| 201 | + $val = str_replace("'", "'", $val); |
|
| 202 | + $sHtml .= "<input type='hidden' name='" . $key . "' value='" . $val . "'/>"; |
|
| 203 | 203 | } |
| 204 | - $sHtml = $sHtml."<input type='submit' value='ok' style='display:none;''></form>"; |
|
| 205 | - $sHtml = $sHtml."<script>document.forms['alipaysubmit'].submit();</script>"; |
|
| 204 | + $sHtml = $sHtml . "<input type='submit' value='ok' style='display:none;''></form>"; |
|
| 205 | + $sHtml = $sHtml . "<script>document.forms['alipaysubmit'].submit();</script>"; |
|
| 206 | 206 | |
| 207 | 207 | return $sHtml; |
| 208 | 208 | } |
@@ -224,7 +224,7 @@ discard block |
||
| 224 | 224 | |
| 225 | 225 | $data = json_decode($this->post($this->gateway, $this->config), true); |
| 226 | 226 | |
| 227 | - if (! isset($data[$method]['code']) || $data[$method]['code'] !== '10000') { |
|
| 227 | + if (!isset($data[$method]['code']) || $data[$method]['code'] !== '10000') { |
|
| 228 | 228 | throw new GatewayException( |
| 229 | 229 | 'get result error:' . $data[$method]['msg'] . ' - ' . $data[$method]['sub_msg'], |
| 230 | 230 | $data[$method]['code'], |