add clear

This commit is contained in:
2022-09-09 16:42:55 +08:00
parent ad76b45b45
commit 7273fe1ce5
63 changed files with 2625 additions and 5287 deletions
+158 -203
View File
@@ -3,43 +3,44 @@
namespace wchat\wx;
use wchat\common\Help;
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 mixed $appid = '';
public mixed $mch_id = '';
public mixed $device_info = '';
public mixed $nonce_str = '';
public mixed $sign = '';
public mixed $sign_type = '';
public mixed $result_code = '';
public mixed $err_code = '';
public mixed $err_code_des = '';
public mixed $openid = '';
public mixed $is_subscribe = '';
public mixed $trade_type = '';
public mixed $bank_type = '';
public mixed $total_fee = '';
public mixed $settlement_total_fee = '';
public mixed $fee_type = '';
public mixed $cash_fee = '';
public mixed $cash_fee_type = '';
public mixed $coupon_fee = '';
public mixed $coupon_count = '';
public mixed $coupon_type_n = '';
public mixed $coupon_id_n = '';
public mixed $coupon_fee_n = '';
public mixed $transaction_id = '';
public mixed $out_trade_no = '';
public mixed $attach = '';
public mixed $time_end = '';
public mixed $return_code = '';
/**
* @return bool
* 判断是否完成支付
*/
public function isSuccess()
public function isSuccess(): bool
{
if ($this->getReturnCode() != "SUCCESS") {
return false;
@@ -56,7 +57,7 @@ class Notify extends SmallProgram
* @param array $params
* @return $this
*/
public function setPayNotifyData(array $params)
public function setPayNotifyData(array $params): static
{
if (!$this->validation($params)) {
$this->setResultCode('FAIL');
@@ -64,20 +65,30 @@ class Notify extends SmallProgram
unset($params['result_code'], $params['err_code_des']);
}
foreach ($params as $key => $val) {
if (!property_exists($this, $key)) {
continue;
}
$this->$key = $val;
$this->__set($key, $val);
}
return $this;
}
/**
* @param string $name
* @param $value
* @return void
*/
public function __set(string $name, $value): void
{
if (property_exists($this, $name)) {
$this->$name = $value;
}
}
/**
* @param array $params
* @return bool
*/
public function validation(array $params)
public function validation(array $params): bool
{
$sign = $params['sign'];
unset($params['sign']);
@@ -92,507 +103,451 @@ class Notify extends SmallProgram
}
/**
* @return mixed
* @return mixed|string
*/
public function getAppid()
public function getAppid(): mixed
{
return $this->appid;
}
/**
* @param mixed $appid
* @return Notify
* @param mixed|string $appid
*/
public function setAppid($appid)
public function setAppid(mixed $appid): void
{
$this->appid = $appid;
return $this;
}
/**
* @return mixed
* @return mixed|string
*/
public function getMchId()
public function getMchId(): mixed
{
return $this->mch_id;
}
/**
* @param mixed $mch_id
* @return Notify
* @param mixed|string $mch_id
*/
public function setMchId($mch_id)
public function setMchId(mixed $mch_id): void
{
$this->mch_id = $mch_id;
return $this;
}
/**
* @return mixed
* @return mixed|string
*/
public function getDeviceInfo()
public function getDeviceInfo(): mixed
{
return $this->device_info;
}
/**
* @param mixed $device_info
* @return Notify
* @param mixed|string $device_info
*/
public function setDeviceInfo($device_info)
public function setDeviceInfo(mixed $device_info): void
{
$this->device_info = $device_info;
return $this;
}
/**
* @return mixed
* @return mixed|string
*/
public function getNonceStr()
public function getNonceStr(): mixed
{
return $this->nonce_str;
}
/**
* @param mixed $nonce_str
* @return Notify
* @param mixed|string $nonce_str
*/
public function setNonceStr($nonce_str)
public function setNonceStr(mixed $nonce_str): void
{
$this->nonce_str = $nonce_str;
return $this;
}
/**
* @return mixed
* @return mixed|string
*/
public function getSign()
public function getSign(): mixed
{
return $this->sign;
}
/**
* @param mixed $sign
* @return Notify
* @param mixed|string $sign
*/
public function setSign($sign)
public function setSign(mixed $sign): void
{
$this->sign = $sign;
return $this;
}
/**
* @return mixed
* @return mixed|string
*/
public function getSignType()
public function getSignType(): mixed
{
return $this->sign_type;
}
/**
* @param mixed $sign_type
* @return Notify
* @param mixed|string $sign_type
*/
public function setSignType($sign_type)
public function setSignType(mixed $sign_type): void
{
$this->sign_type = $sign_type;
return $this;
}
/**
* @return mixed
* @return mixed|string
*/
public function getResultCode()
public function getResultCode(): mixed
{
return $this->result_code;
}
/**
* @param mixed $result_code
* @return Notify
* @param mixed|string $result_code
*/
public function setResultCode($result_code)
public function setResultCode(mixed $result_code): void
{
$this->result_code = $result_code;
return $this;
}
/**
* @return mixed
* @return mixed|string
*/
public function getErrCode()
public function getErrCode(): mixed
{
return $this->err_code;
}
/**
* @param mixed $err_code
* @return Notify
* @param mixed|string $err_code
*/
public function setErrCode($err_code)
public function setErrCode(mixed $err_code): void
{
$this->err_code = $err_code;
return $this;
}
/**
* @return mixed
* @return mixed|string
*/
public function getErrCodeDes()
public function getErrCodeDes(): mixed
{
return $this->err_code_des;
}
/**
* @param mixed $err_code_des
* @return Notify
* @param mixed|string $err_code_des
*/
public function setErrCodeDes($err_code_des)
public function setErrCodeDes(mixed $err_code_des): void
{
$this->err_code_des = $err_code_des;
return $this;
}
/**
* @return mixed
* @return mixed|string
*/
public function getOpenid()
public function getOpenid(): mixed
{
return $this->openid;
}
/**
* @param mixed $openid
* @return Notify
* @param mixed|string $openid
*/
public function setOpenid($openid)
public function setOpenid(mixed $openid): void
{
$this->openid = $openid;
return $this;
}
/**
* @return mixed
* @return mixed|string
*/
public function getIsSubscribe()
public function getIsSubscribe(): mixed
{
return $this->is_subscribe;
}
/**
* @param mixed $is_subscribe
* @return Notify
* @param mixed|string $is_subscribe
*/
public function setIsSubscribe($is_subscribe)
public function setIsSubscribe(mixed $is_subscribe): void
{
$this->is_subscribe = $is_subscribe;
return $this;
}
/**
* @return mixed
* @return mixed|string
*/
public function getTradeType()
public function getTradeType(): mixed
{
return $this->trade_type;
}
/**
* @param mixed $trade_type
* @return Notify
* @param mixed|string $trade_type
*/
public function setTradeType($trade_type)
public function setTradeType(mixed $trade_type): void
{
$this->trade_type = $trade_type;
return $this;
}
/**
* @return mixed
* @return mixed|string
*/
public function getBankType()
public function getBankType(): mixed
{
return $this->bank_type;
}
/**
* @param mixed $bank_type
* @return Notify
* @param mixed|string $bank_type
*/
public function setBankType($bank_type)
public function setBankType(mixed $bank_type): void
{
$this->bank_type = $bank_type;
return $this;
}
/**
* @return mixed
* @return mixed|string
*/
public function getTotalFee()
public function getTotalFee(): mixed
{
return $this->total_fee;
}
/**
* @param mixed $total_fee
* @return Notify
* @param mixed|string $total_fee
*/
public function setTotalFee($total_fee)
public function setTotalFee(mixed $total_fee): void
{
$this->total_fee = $total_fee;
return $this;
}
/**
* @return mixed
* @return mixed|string
*/
public function getSettlementTotalFee()
public function getSettlementTotalFee(): mixed
{
return $this->settlement_total_fee;
}
/**
* @param mixed $settlement_total_fee
* @return Notify
* @param mixed|string $settlement_total_fee
*/
public function setSettlementTotalFee($settlement_total_fee)
public function setSettlementTotalFee(mixed $settlement_total_fee): void
{
$this->settlement_total_fee = $settlement_total_fee;
return $this;
}
/**
* @return mixed
* @return mixed|string
*/
public function getFeeType()
public function getFeeType(): mixed
{
return $this->fee_type;
}
/**
* @param mixed $fee_type
* @return Notify
* @param mixed|string $fee_type
*/
public function setFeeType($fee_type)
public function setFeeType(mixed $fee_type): void
{
$this->fee_type = $fee_type;
return $this;
}
/**
* @return mixed
* @return mixed|string
*/
public function getCashFee()
public function getCashFee(): mixed
{
return $this->cash_fee;
}
/**
* @param mixed $cash_fee
* @return Notify
* @param mixed|string $cash_fee
*/
public function setCashFee($cash_fee)
public function setCashFee(mixed $cash_fee): void
{
$this->cash_fee = $cash_fee;
return $this;
}
/**
* @return mixed
* @return mixed|string
*/
public function getCashFeeType()
public function getCashFeeType(): mixed
{
return $this->cash_fee_type;
}
/**
* @param mixed $cash_fee_type
* @return Notify
* @param mixed|string $cash_fee_type
*/
public function setCashFeeType($cash_fee_type)
public function setCashFeeType(mixed $cash_fee_type): void
{
$this->cash_fee_type = $cash_fee_type;
return $this;
}
/**
* @return mixed
* @return mixed|string
*/
public function getCouponFee()
public function getCouponFee(): mixed
{
return $this->coupon_fee;
}
/**
* @param mixed $coupon_fee
* @return Notify
* @param mixed|string $coupon_fee
*/
public function setCouponFee($coupon_fee)
public function setCouponFee(mixed $coupon_fee): void
{
$this->coupon_fee = $coupon_fee;
return $this;
}
/**
* @return mixed
* @return mixed|string
*/
public function getCouponCount()
public function getCouponCount(): mixed
{
return $this->coupon_count;
}
/**
* @param mixed $coupon_count
* @return Notify
* @param mixed|string $coupon_count
*/
public function setCouponCount($coupon_count)
public function setCouponCount(mixed $coupon_count): void
{
$this->coupon_count = $coupon_count;
return $this;
}
/**
* @return mixed
* @return mixed|string
*/
public function getCouponTypeN()
public function getCouponTypeN(): mixed
{
return $this->coupon_type_n;
}
/**
* @param mixed $coupon_type_n
* @return Notify
* @param mixed|string $coupon_type_n
*/
public function setCouponTypeN($coupon_type_n)
public function setCouponTypeN(mixed $coupon_type_n): void
{
$this->coupon_type_n = $coupon_type_n;
return $this;
}
/**
* @return mixed
* @return mixed|string
*/
public function getCouponIdN()
public function getCouponIdN(): mixed
{
return $this->coupon_id_n;
}
/**
* @param mixed $coupon_id_n
* @return Notify
* @param mixed|string $coupon_id_n
*/
public function setCouponIdN($coupon_id_n)
public function setCouponIdN(mixed $coupon_id_n): void
{
$this->coupon_id_n = $coupon_id_n;
return $this;
}
/**
* @return mixed
* @return mixed|string
*/
public function getCouponFeeN()
public function getCouponFeeN(): mixed
{
return $this->coupon_fee_n;
}
/**
* @param mixed $coupon_fee_n
* @return Notify
* @param mixed|string $coupon_fee_n
*/
public function setCouponFeeN($coupon_fee_n)
public function setCouponFeeN(mixed $coupon_fee_n): void
{
$this->coupon_fee_n = $coupon_fee_n;
return $this;
}
/**
* @return mixed
* @return mixed|string
*/
public function getTransactionId()
public function getTransactionId(): mixed
{
return $this->transaction_id;
}
/**
* @param mixed $transaction_id
* @return Notify
* @param mixed|string $transaction_id
*/
public function setTransactionId($transaction_id)
public function setTransactionId(mixed $transaction_id): void
{
$this->transaction_id = $transaction_id;
return $this;
}
/**
* @return mixed
* @return mixed|string
*/
public function getOutTradeNo()
public function getOutTradeNo(): mixed
{
return $this->out_trade_no;
}
/**
* @param mixed $out_trade_no
* @return Notify
* @param mixed|string $out_trade_no
*/
public function setOutTradeNo($out_trade_no)
public function setOutTradeNo(mixed $out_trade_no): void
{
$this->out_trade_no = $out_trade_no;
return $this;
}
/**
* @return mixed
* @return mixed|string
*/
public function getAttach()
public function getAttach(): mixed
{
return $this->attach;
}
/**
* @param mixed $attach
* @return Notify
* @param mixed|string $attach
*/
public function setAttach($attach)
public function setAttach(mixed $attach): void
{
$this->attach = $attach;
return $this;
}
/**
* @return mixed
* @return mixed|string
*/
public function getTimeEnd()
public function getTimeEnd(): mixed
{
return $this->time_end;
}
/**
* @param mixed $time_end
* @return Notify
* @param mixed|string $time_end
*/
public function setTimeEnd($time_end)
public function setTimeEnd(mixed $time_end): void
{
$this->time_end = $time_end;
return $this;
}
/**
* @return mixed
* @return mixed|string
*/
public function getReturnCode()
public function getReturnCode(): mixed
{
return $this->return_code;
}
/**
* @param mixed $return_code
* @return Notify
* @param mixed|string $return_code
*/
public function setReturnCode($return_code)
public function setReturnCode(mixed $return_code): void
{
$this->return_code = $return_code;
return $this;
}
}