add clear
This commit is contained in:
+97
-311
@@ -5,36 +5,29 @@ namespace wchat\qq;
|
|||||||
|
|
||||||
use wchat\common\Help;
|
use wchat\common\Help;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class Notify
|
||||||
|
* @package wchat\qq
|
||||||
|
*/
|
||||||
class Notify extends SmallProgram
|
class Notify extends SmallProgram
|
||||||
{
|
{
|
||||||
public $appid = '';
|
public $appid = null;
|
||||||
public $mch_id = '';
|
public $mch_id = null;
|
||||||
public $device_info = '';
|
public $nonce_str = null;
|
||||||
public $nonce_str = '';
|
public $sign = null;
|
||||||
public $sign = '';
|
public $device_info = null;
|
||||||
public $sign_type = '';
|
public $trade_type = null;
|
||||||
public $result_code = '';
|
public $trade_state = null;
|
||||||
public $err_code = '';
|
public $bank_type = null;
|
||||||
public $err_code_des = '';
|
public $fee_type = null;
|
||||||
public $openid = '';
|
public $total_fee = null;
|
||||||
public $is_subscribe = '';
|
public $cash_fee = null;
|
||||||
public $trade_type = '';
|
public $coupon_fee = null;
|
||||||
public $bank_type = '';
|
public $transaction_id = null;
|
||||||
public $total_fee = '';
|
public $out_trade_no = null;
|
||||||
public $settlement_total_fee = '';
|
public $attach = null;
|
||||||
public $fee_type = '';
|
public $time_end = null;
|
||||||
public $cash_fee = '';
|
public $openid = null;
|
||||||
public $cash_fee_type = '';
|
|
||||||
public $coupon_fee = '';
|
|
||||||
public $coupon_count = '';
|
|
||||||
public $coupon_type_n = '';
|
|
||||||
public $coupon_id_n = '';
|
|
||||||
public $coupon_fee_n = '';
|
|
||||||
public $transaction_id = '';
|
|
||||||
public $out_trade_no = '';
|
|
||||||
public $attach = '';
|
|
||||||
public $time_end = '';
|
|
||||||
public $return_code = '';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return bool
|
* @return bool
|
||||||
@@ -42,15 +35,7 @@ class Notify extends SmallProgram
|
|||||||
*/
|
*/
|
||||||
public function isSuccess()
|
public function isSuccess()
|
||||||
{
|
{
|
||||||
if ($this->getReturnCode() != "SUCCESS") {
|
return $this->getTradeState() === 'SUCCESS';
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($this->getResultCode() != 'SUCCESS') {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -60,8 +45,6 @@ class Notify extends SmallProgram
|
|||||||
public function setPayNotifyData(array $params)
|
public function setPayNotifyData(array $params)
|
||||||
{
|
{
|
||||||
if (!$this->validation($params)) {
|
if (!$this->validation($params)) {
|
||||||
$this->setResultCode('FAIL');
|
|
||||||
$this->setErrCodeDes('签名错误');
|
|
||||||
unset($params['result_code'], $params['err_code_des']);
|
unset($params['result_code'], $params['err_code_des']);
|
||||||
}
|
}
|
||||||
foreach ($params as $key => $val) {
|
foreach ($params as $key => $val) {
|
||||||
@@ -93,7 +76,7 @@ class Notify extends SmallProgram
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return mixed
|
* @return null
|
||||||
*/
|
*/
|
||||||
public function getAppid()
|
public function getAppid()
|
||||||
{
|
{
|
||||||
@@ -101,7 +84,7 @@ class Notify extends SmallProgram
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param mixed $appid
|
* @param null $appid
|
||||||
* @return Notify
|
* @return Notify
|
||||||
*/
|
*/
|
||||||
public function setAppid($appid)
|
public function setAppid($appid)
|
||||||
@@ -111,7 +94,7 @@ class Notify extends SmallProgram
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return mixed
|
* @return null
|
||||||
*/
|
*/
|
||||||
public function getMchId()
|
public function getMchId()
|
||||||
{
|
{
|
||||||
@@ -119,7 +102,7 @@ class Notify extends SmallProgram
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param mixed $mch_id
|
* @param null $mch_id
|
||||||
* @return Notify
|
* @return Notify
|
||||||
*/
|
*/
|
||||||
public function setMchId($mch_id)
|
public function setMchId($mch_id)
|
||||||
@@ -129,25 +112,7 @@ class Notify extends SmallProgram
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return mixed
|
* @return null
|
||||||
*/
|
|
||||||
public function getDeviceInfo()
|
|
||||||
{
|
|
||||||
return $this->device_info;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param mixed $device_info
|
|
||||||
* @return Notify
|
|
||||||
*/
|
|
||||||
public function setDeviceInfo($device_info)
|
|
||||||
{
|
|
||||||
$this->device_info = $device_info;
|
|
||||||
return $this;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return mixed
|
|
||||||
*/
|
*/
|
||||||
public function getNonceStr()
|
public function getNonceStr()
|
||||||
{
|
{
|
||||||
@@ -155,7 +120,7 @@ class Notify extends SmallProgram
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param mixed $nonce_str
|
* @param null $nonce_str
|
||||||
* @return Notify
|
* @return Notify
|
||||||
*/
|
*/
|
||||||
public function setNonceStr($nonce_str)
|
public function setNonceStr($nonce_str)
|
||||||
@@ -165,7 +130,7 @@ class Notify extends SmallProgram
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return mixed
|
* @return null
|
||||||
*/
|
*/
|
||||||
public function getSign()
|
public function getSign()
|
||||||
{
|
{
|
||||||
@@ -173,7 +138,7 @@ class Notify extends SmallProgram
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param mixed $sign
|
* @param null $sign
|
||||||
* @return Notify
|
* @return Notify
|
||||||
*/
|
*/
|
||||||
public function setSign($sign)
|
public function setSign($sign)
|
||||||
@@ -183,115 +148,25 @@ class Notify extends SmallProgram
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return mixed
|
* @return null
|
||||||
*/
|
*/
|
||||||
public function getSignType()
|
public function getDeviceInfo()
|
||||||
{
|
{
|
||||||
return $this->sign_type;
|
return $this->device_info;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param mixed $sign_type
|
* @param null $device_info
|
||||||
* @return Notify
|
* @return Notify
|
||||||
*/
|
*/
|
||||||
public function setSignType($sign_type)
|
public function setDeviceInfo($device_info)
|
||||||
{
|
{
|
||||||
$this->sign_type = $sign_type;
|
$this->device_info = $device_info;
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return mixed
|
* @return null
|
||||||
*/
|
|
||||||
public function getResultCode()
|
|
||||||
{
|
|
||||||
return $this->result_code;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param mixed $result_code
|
|
||||||
* @return Notify
|
|
||||||
*/
|
|
||||||
public function setResultCode($result_code)
|
|
||||||
{
|
|
||||||
$this->result_code = $result_code;
|
|
||||||
return $this;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return mixed
|
|
||||||
*/
|
|
||||||
public function getErrCode()
|
|
||||||
{
|
|
||||||
return $this->err_code;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param mixed $err_code
|
|
||||||
* @return Notify
|
|
||||||
*/
|
|
||||||
public function setErrCode($err_code)
|
|
||||||
{
|
|
||||||
$this->err_code = $err_code;
|
|
||||||
return $this;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return mixed
|
|
||||||
*/
|
|
||||||
public function getErrCodeDes()
|
|
||||||
{
|
|
||||||
return $this->err_code_des;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param mixed $err_code_des
|
|
||||||
* @return Notify
|
|
||||||
*/
|
|
||||||
public function setErrCodeDes($err_code_des)
|
|
||||||
{
|
|
||||||
$this->err_code_des = $err_code_des;
|
|
||||||
return $this;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return mixed
|
|
||||||
*/
|
|
||||||
public function getOpenid()
|
|
||||||
{
|
|
||||||
return $this->openid;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param mixed $openid
|
|
||||||
* @return Notify
|
|
||||||
*/
|
|
||||||
public function setOpenid($openid)
|
|
||||||
{
|
|
||||||
$this->openid = $openid;
|
|
||||||
return $this;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return mixed
|
|
||||||
*/
|
|
||||||
public function getIsSubscribe()
|
|
||||||
{
|
|
||||||
return $this->is_subscribe;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param mixed $is_subscribe
|
|
||||||
* @return Notify
|
|
||||||
*/
|
|
||||||
public function setIsSubscribe($is_subscribe)
|
|
||||||
{
|
|
||||||
$this->is_subscribe = $is_subscribe;
|
|
||||||
return $this;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return mixed
|
|
||||||
*/
|
*/
|
||||||
public function getTradeType()
|
public function getTradeType()
|
||||||
{
|
{
|
||||||
@@ -299,7 +174,7 @@ class Notify extends SmallProgram
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param mixed $trade_type
|
* @param null $trade_type
|
||||||
* @return Notify
|
* @return Notify
|
||||||
*/
|
*/
|
||||||
public function setTradeType($trade_type)
|
public function setTradeType($trade_type)
|
||||||
@@ -309,7 +184,25 @@ class Notify extends SmallProgram
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return mixed
|
* @return null
|
||||||
|
*/
|
||||||
|
public function getTradeState()
|
||||||
|
{
|
||||||
|
return $this->trade_state;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param null $trade_state
|
||||||
|
* @return Notify
|
||||||
|
*/
|
||||||
|
public function setTradeState($trade_state)
|
||||||
|
{
|
||||||
|
$this->trade_state = $trade_state;
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return null
|
||||||
*/
|
*/
|
||||||
public function getBankType()
|
public function getBankType()
|
||||||
{
|
{
|
||||||
@@ -317,7 +210,7 @@ class Notify extends SmallProgram
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param mixed $bank_type
|
* @param null $bank_type
|
||||||
* @return Notify
|
* @return Notify
|
||||||
*/
|
*/
|
||||||
public function setBankType($bank_type)
|
public function setBankType($bank_type)
|
||||||
@@ -327,43 +220,7 @@ class Notify extends SmallProgram
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return mixed
|
* @return null
|
||||||
*/
|
|
||||||
public function getTotalFee()
|
|
||||||
{
|
|
||||||
return $this->total_fee;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param mixed $total_fee
|
|
||||||
* @return Notify
|
|
||||||
*/
|
|
||||||
public function setTotalFee($total_fee)
|
|
||||||
{
|
|
||||||
$this->total_fee = $total_fee;
|
|
||||||
return $this;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return mixed
|
|
||||||
*/
|
|
||||||
public function getSettlementTotalFee()
|
|
||||||
{
|
|
||||||
return $this->settlement_total_fee;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param mixed $settlement_total_fee
|
|
||||||
* @return Notify
|
|
||||||
*/
|
|
||||||
public function setSettlementTotalFee($settlement_total_fee)
|
|
||||||
{
|
|
||||||
$this->settlement_total_fee = $settlement_total_fee;
|
|
||||||
return $this;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return mixed
|
|
||||||
*/
|
*/
|
||||||
public function getFeeType()
|
public function getFeeType()
|
||||||
{
|
{
|
||||||
@@ -371,7 +228,7 @@ class Notify extends SmallProgram
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param mixed $fee_type
|
* @param null $fee_type
|
||||||
* @return Notify
|
* @return Notify
|
||||||
*/
|
*/
|
||||||
public function setFeeType($fee_type)
|
public function setFeeType($fee_type)
|
||||||
@@ -381,7 +238,25 @@ class Notify extends SmallProgram
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return mixed
|
* @return null
|
||||||
|
*/
|
||||||
|
public function getTotalFee()
|
||||||
|
{
|
||||||
|
return $this->total_fee;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param null $total_fee
|
||||||
|
* @return Notify
|
||||||
|
*/
|
||||||
|
public function setTotalFee($total_fee)
|
||||||
|
{
|
||||||
|
$this->total_fee = $total_fee;
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return null
|
||||||
*/
|
*/
|
||||||
public function getCashFee()
|
public function getCashFee()
|
||||||
{
|
{
|
||||||
@@ -389,7 +264,7 @@ class Notify extends SmallProgram
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param mixed $cash_fee
|
* @param null $cash_fee
|
||||||
* @return Notify
|
* @return Notify
|
||||||
*/
|
*/
|
||||||
public function setCashFee($cash_fee)
|
public function setCashFee($cash_fee)
|
||||||
@@ -399,25 +274,7 @@ class Notify extends SmallProgram
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return mixed
|
* @return null
|
||||||
*/
|
|
||||||
public function getCashFeeType()
|
|
||||||
{
|
|
||||||
return $this->cash_fee_type;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param mixed $cash_fee_type
|
|
||||||
* @return Notify
|
|
||||||
*/
|
|
||||||
public function setCashFeeType($cash_fee_type)
|
|
||||||
{
|
|
||||||
$this->cash_fee_type = $cash_fee_type;
|
|
||||||
return $this;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return mixed
|
|
||||||
*/
|
*/
|
||||||
public function getCouponFee()
|
public function getCouponFee()
|
||||||
{
|
{
|
||||||
@@ -425,7 +282,7 @@ class Notify extends SmallProgram
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param mixed $coupon_fee
|
* @param null $coupon_fee
|
||||||
* @return Notify
|
* @return Notify
|
||||||
*/
|
*/
|
||||||
public function setCouponFee($coupon_fee)
|
public function setCouponFee($coupon_fee)
|
||||||
@@ -435,79 +292,7 @@ class Notify extends SmallProgram
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return mixed
|
* @return null
|
||||||
*/
|
|
||||||
public function getCouponCount()
|
|
||||||
{
|
|
||||||
return $this->coupon_count;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param mixed $coupon_count
|
|
||||||
* @return Notify
|
|
||||||
*/
|
|
||||||
public function setCouponCount($coupon_count)
|
|
||||||
{
|
|
||||||
$this->coupon_count = $coupon_count;
|
|
||||||
return $this;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return mixed
|
|
||||||
*/
|
|
||||||
public function getCouponTypeN()
|
|
||||||
{
|
|
||||||
return $this->coupon_type_n;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param mixed $coupon_type_n
|
|
||||||
* @return Notify
|
|
||||||
*/
|
|
||||||
public function setCouponTypeN($coupon_type_n)
|
|
||||||
{
|
|
||||||
$this->coupon_type_n = $coupon_type_n;
|
|
||||||
return $this;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return mixed
|
|
||||||
*/
|
|
||||||
public function getCouponIdN()
|
|
||||||
{
|
|
||||||
return $this->coupon_id_n;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param mixed $coupon_id_n
|
|
||||||
* @return Notify
|
|
||||||
*/
|
|
||||||
public function setCouponIdN($coupon_id_n)
|
|
||||||
{
|
|
||||||
$this->coupon_id_n = $coupon_id_n;
|
|
||||||
return $this;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return mixed
|
|
||||||
*/
|
|
||||||
public function getCouponFeeN()
|
|
||||||
{
|
|
||||||
return $this->coupon_fee_n;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param mixed $coupon_fee_n
|
|
||||||
* @return Notify
|
|
||||||
*/
|
|
||||||
public function setCouponFeeN($coupon_fee_n)
|
|
||||||
{
|
|
||||||
$this->coupon_fee_n = $coupon_fee_n;
|
|
||||||
return $this;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return mixed
|
|
||||||
*/
|
*/
|
||||||
public function getTransactionId()
|
public function getTransactionId()
|
||||||
{
|
{
|
||||||
@@ -515,7 +300,7 @@ class Notify extends SmallProgram
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param mixed $transaction_id
|
* @param null $transaction_id
|
||||||
* @return Notify
|
* @return Notify
|
||||||
*/
|
*/
|
||||||
public function setTransactionId($transaction_id)
|
public function setTransactionId($transaction_id)
|
||||||
@@ -525,7 +310,7 @@ class Notify extends SmallProgram
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return mixed
|
* @return null
|
||||||
*/
|
*/
|
||||||
public function getOutTradeNo()
|
public function getOutTradeNo()
|
||||||
{
|
{
|
||||||
@@ -533,7 +318,7 @@ class Notify extends SmallProgram
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param mixed $out_trade_no
|
* @param null $out_trade_no
|
||||||
* @return Notify
|
* @return Notify
|
||||||
*/
|
*/
|
||||||
public function setOutTradeNo($out_trade_no)
|
public function setOutTradeNo($out_trade_no)
|
||||||
@@ -543,7 +328,7 @@ class Notify extends SmallProgram
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return mixed
|
* @return null
|
||||||
*/
|
*/
|
||||||
public function getAttach()
|
public function getAttach()
|
||||||
{
|
{
|
||||||
@@ -551,7 +336,7 @@ class Notify extends SmallProgram
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param mixed $attach
|
* @param null $attach
|
||||||
* @return Notify
|
* @return Notify
|
||||||
*/
|
*/
|
||||||
public function setAttach($attach)
|
public function setAttach($attach)
|
||||||
@@ -561,7 +346,7 @@ class Notify extends SmallProgram
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return mixed
|
* @return null
|
||||||
*/
|
*/
|
||||||
public function getTimeEnd()
|
public function getTimeEnd()
|
||||||
{
|
{
|
||||||
@@ -569,7 +354,7 @@ class Notify extends SmallProgram
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param mixed $time_end
|
* @param null $time_end
|
||||||
* @return Notify
|
* @return Notify
|
||||||
*/
|
*/
|
||||||
public function setTimeEnd($time_end)
|
public function setTimeEnd($time_end)
|
||||||
@@ -579,21 +364,22 @@ class Notify extends SmallProgram
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return mixed
|
* @return null
|
||||||
*/
|
*/
|
||||||
public function getReturnCode()
|
public function getOpenid()
|
||||||
{
|
{
|
||||||
return $this->return_code;
|
return $this->openid;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param mixed $return_code
|
* @param null $openid
|
||||||
* @return Notify
|
* @return Notify
|
||||||
*/
|
*/
|
||||||
public function setReturnCode($return_code)
|
public function setOpenid($openid)
|
||||||
{
|
{
|
||||||
$this->return_code = $return_code;
|
$this->openid = $openid;
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user