mirror of
https://github.com/v2board/v2board.git
synced 2025-01-10 16:19:10 +08:00
update
This commit is contained in:
parent
0f5942bc03
commit
db9743a67f
@ -18,12 +18,11 @@ class PayTaro
|
|||||||
public function pay($params)
|
public function pay($params)
|
||||||
{
|
{
|
||||||
ksort($params);
|
ksort($params);
|
||||||
reset($params);
|
$str = http_build_query($params) . $this->appSecret;
|
||||||
$str = stripslashes(http_build_query($params)) . $this->appSecret;
|
|
||||||
$params['sign'] = md5($str);
|
$params['sign'] = md5($str);
|
||||||
$params['sign_type'] = 'MD5';
|
|
||||||
$curl = new Curl();
|
$curl = new Curl();
|
||||||
$curl->post('http://api.paytaro.com/v1/gateway/fetch', http_build_query($params));
|
$curl->post('http://api.paytaro.com/v1/gateway/fetch', http_build_query($params));
|
||||||
|
var_dump($str, $params, $curl->response);exit;
|
||||||
if ($curl->error) {
|
if ($curl->error) {
|
||||||
abort(500, '接口请求失败');
|
abort(500, '接口请求失败');
|
||||||
}
|
}
|
||||||
@ -39,10 +38,9 @@ class PayTaro
|
|||||||
{
|
{
|
||||||
$sign = $params['sign'];
|
$sign = $params['sign'];
|
||||||
unset($params['sign']);
|
unset($params['sign']);
|
||||||
unset($params['sign_type']);
|
|
||||||
ksort($params);
|
ksort($params);
|
||||||
reset($params);
|
reset($params);
|
||||||
$str = stripslashes(http_build_query($params)) . $this->appId;
|
$str = http_build_query($params) . $this->appId;
|
||||||
if ($sign !== md5($str)) {
|
if ($sign !== md5($str)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user