eee
This commit is contained in:
@@ -17,7 +17,7 @@ class Enterprise_payment extends SmallProgram
|
||||
{
|
||||
public string $_cash = '/cgi-bin/epay/qpay_epay_b2c.cgi';
|
||||
|
||||
private $_errors = [
|
||||
private array $_errors = [
|
||||
'SYSTEMERROR' => '系统错误',
|
||||
'PARAM_ERROR' => '请求参数未按指引进行填写',
|
||||
'SIGNERROR' => '参数签名结果不正确',
|
||||
@@ -35,40 +35,39 @@ class Enterprise_payment extends SmallProgram
|
||||
'INVALID_CERTIFICATE' => '证书非法',
|
||||
];
|
||||
|
||||
private $_requestParams = [];
|
||||
private array $_requestParams = [];
|
||||
|
||||
/**
|
||||
* @param $value
|
||||
* @param string $value
|
||||
*/
|
||||
public function setOpUserId($value)
|
||||
public function setOpUserId(string $value)
|
||||
{
|
||||
$this->_requestParams['op_user_id'] = $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $value
|
||||
* @param string $value
|
||||
*/
|
||||
public function setOpUserPassword($value)
|
||||
public function setOpUserPassword(string $value)
|
||||
{
|
||||
$this->_requestParams['op_user_passwd'] = $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $value
|
||||
* @param string $value
|
||||
*/
|
||||
public function setSpbillCreateIp($value)
|
||||
public function setSpbillCreateIp(string $value)
|
||||
{
|
||||
$this->_requestParams['spbill_create_ip'] = $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $mch_billno
|
||||
* @param $openId
|
||||
* @param $price
|
||||
* @param string $mch_billno
|
||||
* @param string $openId
|
||||
* @param float $price
|
||||
* @return Result
|
||||
* @throws Exception
|
||||
*/
|
||||
public function mch_send($mch_billno, $openId, $price): Result
|
||||
public function mch_send(string $mch_billno, string $openId, float $price): Result
|
||||
{
|
||||
$client = $this->createClient($this->_cash, $this->orderConfig($mch_billno, $openId, $price));
|
||||
if (!in_array($client->getStatusCode(), [101, 200, 201])) {
|
||||
@@ -85,12 +84,12 @@ class Enterprise_payment extends SmallProgram
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $mch_billno
|
||||
* @param $openId
|
||||
* @param $price
|
||||
* @param string $mch_billno
|
||||
* @param string $openId
|
||||
* @param float $price
|
||||
* @return array
|
||||
*/
|
||||
private function orderConfig($mch_billno, $openId, $price): array
|
||||
private function orderConfig(string $mch_billno, string $openId, float $price): array
|
||||
{
|
||||
$requestParam['input_charset'] = 'UTF-8';
|
||||
$requestParam['nonce_str'] = Help::random(32);
|
||||
|
||||
Reference in New Issue
Block a user