diff --git a/wchat/qq/Notify.php b/wchat/qq/Notify.php index a817f81..1b49700 100644 --- a/wchat/qq/Notify.php +++ b/wchat/qq/Notify.php @@ -5,36 +5,29 @@ namespace wchat\qq; use wchat\common\Help; +/** + * Class Notify + * @package wchat\qq + */ class Notify extends SmallProgram { - public $appid = ''; - public $mch_id = ''; - public $device_info = ''; - public $nonce_str = ''; - public $sign = ''; - public $sign_type = ''; - public $result_code = ''; - public $err_code = ''; - public $err_code_des = ''; - public $openid = ''; - public $is_subscribe = ''; - public $trade_type = ''; - public $bank_type = ''; - public $total_fee = ''; - public $settlement_total_fee = ''; - public $fee_type = ''; - public $cash_fee = ''; - 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 = ''; + public $appid = null; + public $mch_id = null; + public $nonce_str = null; + public $sign = null; + public $device_info = null; + public $trade_type = null; + public $trade_state = null; + public $bank_type = null; + public $fee_type = null; + public $total_fee = null; + public $cash_fee = null; + public $coupon_fee = null; + public $transaction_id = null; + public $out_trade_no = null; + public $attach = null; + public $time_end = null; + public $openid = null; /** * @return bool @@ -42,15 +35,7 @@ class Notify extends SmallProgram */ public function isSuccess() { - if ($this->getReturnCode() != "SUCCESS") { - return false; - } - - if ($this->getResultCode() != 'SUCCESS') { - return false; - } - - return true; + return $this->getTradeState() === 'SUCCESS'; } /** @@ -60,8 +45,6 @@ class Notify extends SmallProgram public function setPayNotifyData(array $params) { if (!$this->validation($params)) { - $this->setResultCode('FAIL'); - $this->setErrCodeDes('签名错误'); unset($params['result_code'], $params['err_code_des']); } foreach ($params as $key => $val) { @@ -93,7 +76,7 @@ class Notify extends SmallProgram } /** - * @return mixed + * @return null */ public function getAppid() { @@ -101,7 +84,7 @@ class Notify extends SmallProgram } /** - * @param mixed $appid + * @param null $appid * @return Notify */ public function setAppid($appid) @@ -111,7 +94,7 @@ class Notify extends SmallProgram } /** - * @return mixed + * @return null */ public function getMchId() { @@ -119,7 +102,7 @@ class Notify extends SmallProgram } /** - * @param mixed $mch_id + * @param null $mch_id * @return Notify */ public function setMchId($mch_id) @@ -129,25 +112,7 @@ class Notify extends SmallProgram } /** - * @return mixed - */ - 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 + * @return null */ public function getNonceStr() { @@ -155,7 +120,7 @@ class Notify extends SmallProgram } /** - * @param mixed $nonce_str + * @param null $nonce_str * @return Notify */ public function setNonceStr($nonce_str) @@ -165,7 +130,7 @@ class Notify extends SmallProgram } /** - * @return mixed + * @return null */ public function getSign() { @@ -173,7 +138,7 @@ class Notify extends SmallProgram } /** - * @param mixed $sign + * @param null $sign * @return Notify */ 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 */ - public function setSignType($sign_type) + public function setDeviceInfo($device_info) { - $this->sign_type = $sign_type; + $this->device_info = $device_info; return $this; } /** - * @return mixed - */ - 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 + * @return null */ public function getTradeType() { @@ -299,7 +174,7 @@ class Notify extends SmallProgram } /** - * @param mixed $trade_type + * @param null $trade_type * @return Notify */ 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() { @@ -317,7 +210,7 @@ class Notify extends SmallProgram } /** - * @param mixed $bank_type + * @param null $bank_type * @return Notify */ public function setBankType($bank_type) @@ -327,43 +220,7 @@ class Notify extends SmallProgram } /** - * @return mixed - */ - 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 + * @return null */ public function getFeeType() { @@ -371,7 +228,7 @@ class Notify extends SmallProgram } /** - * @param mixed $fee_type + * @param null $fee_type * @return Notify */ 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() { @@ -389,7 +264,7 @@ class Notify extends SmallProgram } /** - * @param mixed $cash_fee + * @param null $cash_fee * @return Notify */ public function setCashFee($cash_fee) @@ -399,25 +274,7 @@ class Notify extends SmallProgram } /** - * @return mixed - */ - 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 + * @return null */ public function getCouponFee() { @@ -425,7 +282,7 @@ class Notify extends SmallProgram } /** - * @param mixed $coupon_fee + * @param null $coupon_fee * @return Notify */ public function setCouponFee($coupon_fee) @@ -435,79 +292,7 @@ class Notify extends SmallProgram } /** - * @return mixed - */ - 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 + * @return null */ public function getTransactionId() { @@ -515,7 +300,7 @@ class Notify extends SmallProgram } /** - * @param mixed $transaction_id + * @param null $transaction_id * @return Notify */ public function setTransactionId($transaction_id) @@ -525,7 +310,7 @@ class Notify extends SmallProgram } /** - * @return mixed + * @return null */ public function getOutTradeNo() { @@ -533,7 +318,7 @@ class Notify extends SmallProgram } /** - * @param mixed $out_trade_no + * @param null $out_trade_no * @return Notify */ public function setOutTradeNo($out_trade_no) @@ -543,7 +328,7 @@ class Notify extends SmallProgram } /** - * @return mixed + * @return null */ public function getAttach() { @@ -551,7 +336,7 @@ class Notify extends SmallProgram } /** - * @param mixed $attach + * @param null $attach * @return Notify */ public function setAttach($attach) @@ -561,7 +346,7 @@ class Notify extends SmallProgram } /** - * @return mixed + * @return null */ public function getTimeEnd() { @@ -569,7 +354,7 @@ class Notify extends SmallProgram } /** - * @param mixed $time_end + * @param null $time_end * @return Notify */ 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 */ - public function setReturnCode($return_code) + public function setOpenid($openid) { - $this->return_code = $return_code; + $this->openid = $openid; return $this; } + }