mirror of
				https://github.com/v2board/v2board.git
				synced 2025-10-31 01:11:46 +08:00 
			
		
		
		
	update
This commit is contained in:
		| @@ -12,7 +12,7 @@ class TomatoPay { | |||||||
|         $this->key = $key; |         $this->key = $key; | ||||||
|     } |     } | ||||||
|      |      | ||||||
|     public function pay ($cny, $type, $trade) { |     public function alipay ($cny, $type, $trade) { | ||||||
|         $params = [ |         $params = [ | ||||||
|             'mchid' => $this->mchid, |             'mchid' => $this->mchid, | ||||||
|             'account' => $this->account, |             'account' => $this->account, | ||||||
| @@ -21,16 +21,17 @@ class TomatoPay { | |||||||
|             'trade' => $trade |             'trade' => $trade | ||||||
|         ]; |         ]; | ||||||
|         $params['signs'] = $this->sign(http_build_query($params)); |         $params['signs'] = $this->sign(http_build_query($params)); | ||||||
|         return $this->buildHtml($params); |         return $this->buildHtml('https://b.fanqieui.com/gateways/alipay.php', $params); | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     public function sign ($str) { |     public function sign ($str) { | ||||||
|         return md5($str.$this->key); |         return md5($str.$this->key); | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     public function buildHtml($params, $method = 'post', $target = '_self'){ |     public function buildHtml($url, $params, $method = 'post', $target = '_self'){ | ||||||
|  |  | ||||||
|         // var_dump($params);exit; |         // var_dump($params);exit; | ||||||
| 		$html = "<form id='submit' name='submit' action='https://b.fanqieui.com/gateways/submit.php' method='$method' target='$target'>"; | 		$html = "<form id='submit' name='submit' action='".$url."' method='$method' target='$target'>"; | ||||||
| 		foreach ($params as $key => $value) { | 		foreach ($params as $key => $value) { | ||||||
| 			$html .= "<input type='hidden' name='$key' value='$value'/>"; | 			$html .= "<input type='hidden' name='$key' value='$value'/>"; | ||||||
| 		} | 		} | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user