add clear

This commit is contained in:
2020-05-21 18:18:36 +08:00
parent bed2fe1093
commit ebede84969
+7 -9
View File
@@ -21,16 +21,16 @@ class Recharge extends SmallProgram
private $data = []; private $data = [];
private $spbill_create_ip = ''; private $spill_create_ip = '';
private $unifiedorder = 'https://qpay.qq.com/cgi-bin/pay/qpay_unified_order.cgi'; private $uniformer = 'https://qpay.qq.com/cgi-bin/pay/qpay_unified_order.cgi';
/** /**
* @param string $value * @param string $value
*/ */
public function setSpbillCreateIp(string $value) public function setSpillCreateIp(string $value)
{ {
$this->spbill_create_ip = $value; $this->spill_create_ip = $value;
} }
/** /**
@@ -55,15 +55,13 @@ class Recharge extends SmallProgram
$sign = $data['sign']; $sign = $data['sign'];
unset($data['sign']); unset($data['sign']);
} }
if (!isset($sign)) { if (!isset($sign)) {
$return['code'] = -1; $return['code'] = -1;
$return['message'] = '返回数据签名验证失败'; $return['message'] = '返回数据签名验证失败';
} else { } else {
$data['postBody'] = $body;
$return['code'] = 0; $return['code'] = 0;
$return['data'] = $data; $return['data'] = $data;
$return['data']['postBody'] = $body;
if ($data['return_code'] == 'FAIL') { if ($data['return_code'] == 'FAIL') {
$return['code'] = -1; $return['code'] = -1;
$return['message'] = $data['return_msg']; $return['message'] = $data['return_msg'];
@@ -71,7 +69,7 @@ class Recharge extends SmallProgram
} }
return new Result($return); return new Result($return);
}); });
return $this->send($this->unifiedorder, $this->builder()); return $this->send($this->uniformer, $this->builder());
} }
/** /**
@@ -86,7 +84,7 @@ class Recharge extends SmallProgram
'body' => $this->config->getBody(), 'body' => $this->config->getBody(),
'out_trade_no' => $this->orderNo, 'out_trade_no' => $this->orderNo,
'total_fee' => $this->money, 'total_fee' => $this->money,
'spbill_create_ip' => $this->spbill_create_ip, 'spbill_create_ip' => $this->spill_create_ip,
'notify_url' => $this->config->getNotifyUrl(), 'notify_url' => $this->config->getNotifyUrl(),
'trade_type' => $this->config->getTradeType(), 'trade_type' => $this->config->getTradeType(),
]; ];