1369 lines
29 KiB
PHP
1369 lines
29 KiB
PHP
<?php
|
||
namespace app\common\services\wechat\lib;
|
||
/**
|
||
*
|
||
* 只使用md5算法进行签名, 不管配置的是什么签名方式,都只支持md5签名方式
|
||
*
|
||
**/
|
||
class WxPayDataBaseSignMd5 extends WxPayDataBase
|
||
{
|
||
/**
|
||
* 生成签名 - 重写该方法
|
||
* @param WxPayConfigInterface $config 配置对象
|
||
* @param bool $needSignType 是否需要补signtype
|
||
* @return 签名,本函数不覆盖sign成员变量,如要设置签名需要调用SetSign方法赋值
|
||
*/
|
||
public function MakeSign($config, $needSignType = false)
|
||
{
|
||
if($needSignType) {
|
||
$this->SetSignType($config->GetSignType());
|
||
}
|
||
//签名步骤一:按字典序排序参数
|
||
ksort($this->values);
|
||
$string = $this->ToUrlParams();
|
||
//签名步骤二:在string后加入KEY
|
||
$string = $string . "&key=".$config->GetKey();
|
||
//签名步骤三:MD5加密
|
||
$string = md5($string);
|
||
//签名步骤四:所有字符转为大写
|
||
$result = strtoupper($string);
|
||
return $result;
|
||
}
|
||
}
|
||
|
||
|
||
/**
|
||
*
|
||
* 回调回包数据基类
|
||
*
|
||
**/
|
||
class WxPayNotifyResults extends WxPayResults
|
||
{
|
||
/**
|
||
* 将xml转为array
|
||
* @param WxPayConfigInterface $config
|
||
* @param string $xml
|
||
* @return WxPayNotifyResults
|
||
* @throws WxPayException
|
||
*/
|
||
public static function Init($config, $xml)
|
||
{
|
||
$obj = new self();
|
||
$obj->FromXml($xml);
|
||
//失败则直接返回失败
|
||
$obj->CheckSign($config);
|
||
return $obj;
|
||
}
|
||
}
|
||
|
||
/**
|
||
*
|
||
* 回调基础类
|
||
* @author widyhu
|
||
*
|
||
*/
|
||
class WxPayNotifyReply extends WxPayDataBaseSignMd5
|
||
{
|
||
/**
|
||
*
|
||
* 设置错误码 FAIL 或者 SUCCESS
|
||
* @param string
|
||
*/
|
||
public function SetReturn_code($return_code)
|
||
{
|
||
$this->values['return_code'] = $return_code;
|
||
}
|
||
|
||
/**
|
||
*
|
||
* 获取错误码 FAIL 或者 SUCCESS
|
||
* @return string $return_code
|
||
*/
|
||
public function GetReturn_code()
|
||
{
|
||
return $this->values['return_code'];
|
||
}
|
||
|
||
/**
|
||
*
|
||
* 设置错误信息
|
||
* @param string $return_code
|
||
*/
|
||
public function SetReturn_msg($return_msg)
|
||
{
|
||
$this->values['return_msg'] = $return_msg;
|
||
}
|
||
|
||
/**
|
||
*
|
||
* 获取错误信息
|
||
* @return string
|
||
*/
|
||
public function GetReturn_msg()
|
||
{
|
||
return $this->values['return_msg'];
|
||
}
|
||
|
||
/**
|
||
*
|
||
* 设置返回参数
|
||
* @param string $key
|
||
* @param string $value
|
||
*/
|
||
public function SetData($key, $value)
|
||
{
|
||
$this->values[$key] = $value;
|
||
}
|
||
}
|
||
|
||
/**
|
||
*
|
||
* 关闭订单输入对象
|
||
* @author widyhu
|
||
*
|
||
*/
|
||
class WxPayCloseOrder extends WxPayDataBase
|
||
{
|
||
/**
|
||
* 设置微信分配的公众账号ID
|
||
* @param string $value
|
||
**/
|
||
public function SetAppid($value)
|
||
{
|
||
$this->values['appid'] = $value;
|
||
}
|
||
/**
|
||
* 获取微信分配的公众账号ID的值
|
||
* @return 值
|
||
**/
|
||
public function GetAppid()
|
||
{
|
||
return $this->values['appid'];
|
||
}
|
||
/**
|
||
* 判断微信分配的公众账号ID是否存在
|
||
* @return true 或 false
|
||
**/
|
||
public function IsAppidSet()
|
||
{
|
||
return array_key_exists('appid', $this->values);
|
||
}
|
||
|
||
|
||
/**
|
||
* 设置微信支付分配的商户号
|
||
* @param string $value
|
||
**/
|
||
public function SetMch_id($value)
|
||
{
|
||
$this->values['mch_id'] = $value;
|
||
}
|
||
/**
|
||
* 获取微信支付分配的商户号的值
|
||
* @return 值
|
||
**/
|
||
public function GetMch_id()
|
||
{
|
||
return $this->values['mch_id'];
|
||
}
|
||
/**
|
||
* 判断微信支付分配的商户号是否存在
|
||
* @return true 或 false
|
||
**/
|
||
public function IsMch_idSet()
|
||
{
|
||
return array_key_exists('mch_id', $this->values);
|
||
}
|
||
|
||
|
||
/**
|
||
* 设置商户系统内部的订单号
|
||
* @param string $value
|
||
**/
|
||
public function SetOut_trade_no($value)
|
||
{
|
||
$this->values['out_trade_no'] = $value;
|
||
}
|
||
/**
|
||
* 获取商户系统内部的订单号的值
|
||
* @return 值
|
||
**/
|
||
public function GetOut_trade_no()
|
||
{
|
||
return $this->values['out_trade_no'];
|
||
}
|
||
/**
|
||
* 判断商户系统内部的订单号是否存在
|
||
* @return true 或 false
|
||
**/
|
||
public function IsOut_trade_noSet()
|
||
{
|
||
return array_key_exists('out_trade_no', $this->values);
|
||
}
|
||
|
||
|
||
/**
|
||
* 设置商户系统内部的订单号,32个字符内、可包含字母, 其他说明见商户订单号
|
||
* @param string $value
|
||
**/
|
||
public function SetNonce_str($value)
|
||
{
|
||
$this->values['nonce_str'] = $value;
|
||
}
|
||
/**
|
||
* 获取商户系统内部的订单号,32个字符内、可包含字母, 其他说明见商户订单号的值
|
||
* @return 值
|
||
**/
|
||
public function GetNonce_str()
|
||
{
|
||
return $this->values['nonce_str'];
|
||
}
|
||
/**
|
||
* 判断商户系统内部的订单号,32个字符内、可包含字母, 其他说明见商户订单号是否存在
|
||
* @return true 或 false
|
||
**/
|
||
public function IsNonce_strSet()
|
||
{
|
||
return array_key_exists('nonce_str', $this->values);
|
||
}
|
||
}
|
||
|
||
/**
|
||
*
|
||
* 退款查询输入对象
|
||
* @author widyhu
|
||
*
|
||
*/
|
||
class WxPayRefundQuery extends WxPayDataBase
|
||
{
|
||
/**
|
||
* 设置微信分配的公众账号ID
|
||
* @param string $value
|
||
**/
|
||
public function SetAppid($value)
|
||
{
|
||
$this->values['appid'] = $value;
|
||
}
|
||
/**
|
||
* 获取微信分配的公众账号ID的值
|
||
* @return 值
|
||
**/
|
||
public function GetAppid()
|
||
{
|
||
return $this->values['appid'];
|
||
}
|
||
/**
|
||
* 判断微信分配的公众账号ID是否存在
|
||
* @return true 或 false
|
||
**/
|
||
public function IsAppidSet()
|
||
{
|
||
return array_key_exists('appid', $this->values);
|
||
}
|
||
|
||
|
||
/**
|
||
* 设置微信支付分配的商户号
|
||
* @param string $value
|
||
**/
|
||
public function SetMch_id($value)
|
||
{
|
||
$this->values['mch_id'] = $value;
|
||
}
|
||
/**
|
||
* 获取微信支付分配的商户号的值
|
||
* @return 值
|
||
**/
|
||
public function GetMch_id()
|
||
{
|
||
return $this->values['mch_id'];
|
||
}
|
||
/**
|
||
* 判断微信支付分配的商户号是否存在
|
||
* @return true 或 false
|
||
**/
|
||
public function IsMch_idSet()
|
||
{
|
||
return array_key_exists('mch_id', $this->values);
|
||
}
|
||
|
||
|
||
/**
|
||
* 设置微信支付分配的终端设备号
|
||
* @param string $value
|
||
**/
|
||
public function SetDevice_info($value)
|
||
{
|
||
$this->values['device_info'] = $value;
|
||
}
|
||
/**
|
||
* 获取微信支付分配的终端设备号的值
|
||
* @return 值
|
||
**/
|
||
public function GetDevice_info()
|
||
{
|
||
return $this->values['device_info'];
|
||
}
|
||
/**
|
||
* 判断微信支付分配的终端设备号是否存在
|
||
* @return true 或 false
|
||
**/
|
||
public function IsDevice_infoSet()
|
||
{
|
||
return array_key_exists('device_info', $this->values);
|
||
}
|
||
|
||
|
||
/**
|
||
* 设置随机字符串,不长于32位。推荐随机数生成算法
|
||
* @param string $value
|
||
**/
|
||
public function SetNonce_str($value)
|
||
{
|
||
$this->values['nonce_str'] = $value;
|
||
}
|
||
/**
|
||
* 获取随机字符串,不长于32位。推荐随机数生成算法的值
|
||
* @return 值
|
||
**/
|
||
public function GetNonce_str()
|
||
{
|
||
return $this->values['nonce_str'];
|
||
}
|
||
/**
|
||
* 判断随机字符串,不长于32位。推荐随机数生成算法是否存在
|
||
* @return true 或 false
|
||
**/
|
||
public function IsNonce_strSet()
|
||
{
|
||
return array_key_exists('nonce_str', $this->values);
|
||
}
|
||
|
||
/**
|
||
* 设置微信订单号
|
||
* @param string $value
|
||
**/
|
||
public function SetTransaction_id($value)
|
||
{
|
||
$this->values['transaction_id'] = $value;
|
||
}
|
||
/**
|
||
* 获取微信订单号的值
|
||
* @return 值
|
||
**/
|
||
public function GetTransaction_id()
|
||
{
|
||
return $this->values['transaction_id'];
|
||
}
|
||
/**
|
||
* 判断微信订单号是否存在
|
||
* @return true 或 false
|
||
**/
|
||
public function IsTransaction_idSet()
|
||
{
|
||
return array_key_exists('transaction_id', $this->values);
|
||
}
|
||
|
||
|
||
/**
|
||
* 设置商户系统内部的订单号
|
||
* @param string $value
|
||
**/
|
||
public function SetOut_trade_no($value)
|
||
{
|
||
$this->values['out_trade_no'] = $value;
|
||
}
|
||
/**
|
||
* 获取商户系统内部的订单号的值
|
||
* @return 值
|
||
**/
|
||
public function GetOut_trade_no()
|
||
{
|
||
return $this->values['out_trade_no'];
|
||
}
|
||
/**
|
||
* 判断商户系统内部的订单号是否存在
|
||
* @return true 或 false
|
||
**/
|
||
public function IsOut_trade_noSet()
|
||
{
|
||
return array_key_exists('out_trade_no', $this->values);
|
||
}
|
||
|
||
|
||
/**
|
||
* 设置商户退款单号
|
||
* @param string $value
|
||
**/
|
||
public function SetOut_refund_no($value)
|
||
{
|
||
$this->values['out_refund_no'] = $value;
|
||
}
|
||
/**
|
||
* 获取商户退款单号的值
|
||
* @return 值
|
||
**/
|
||
public function GetOut_refund_no()
|
||
{
|
||
return $this->values['out_refund_no'];
|
||
}
|
||
/**
|
||
* 判断商户退款单号是否存在
|
||
* @return true 或 false
|
||
**/
|
||
public function IsOut_refund_noSet()
|
||
{
|
||
return array_key_exists('out_refund_no', $this->values);
|
||
}
|
||
|
||
|
||
/**
|
||
* 设置微信退款单号refund_id、out_refund_no、out_trade_no、transaction_id四个参数必填一个,如果同时存在优先级为:refund_id>out_refund_no>transaction_id>out_trade_no
|
||
* @param string $value
|
||
**/
|
||
public function SetRefund_id($value)
|
||
{
|
||
$this->values['refund_id'] = $value;
|
||
}
|
||
/**
|
||
* 获取微信退款单号refund_id、out_refund_no、out_trade_no、transaction_id四个参数必填一个,如果同时存在优先级为:refund_id>out_refund_no>transaction_id>out_trade_no的值
|
||
* @return 值
|
||
**/
|
||
public function GetRefund_id()
|
||
{
|
||
return $this->values['refund_id'];
|
||
}
|
||
/**
|
||
* 判断微信退款单号refund_id、out_refund_no、out_trade_no、transaction_id四个参数必填一个,如果同时存在优先级为:refund_id>out_refund_no>transaction_id>out_trade_no是否存在
|
||
* @return true 或 false
|
||
**/
|
||
public function IsRefund_idSet()
|
||
{
|
||
return array_key_exists('refund_id', $this->values);
|
||
}
|
||
}
|
||
|
||
/**
|
||
*
|
||
* 下载对账单输入对象
|
||
* @author widyhu
|
||
*
|
||
*/
|
||
class WxPayDownloadBill extends WxPayDataBase
|
||
{
|
||
/**
|
||
* 设置微信分配的公众账号ID
|
||
* @param string $value
|
||
**/
|
||
public function SetAppid($value)
|
||
{
|
||
$this->values['appid'] = $value;
|
||
}
|
||
/**
|
||
* 获取微信分配的公众账号ID的值
|
||
* @return 值
|
||
**/
|
||
public function GetAppid()
|
||
{
|
||
return $this->values['appid'];
|
||
}
|
||
/**
|
||
* 判断微信分配的公众账号ID是否存在
|
||
* @return true 或 false
|
||
**/
|
||
public function IsAppidSet()
|
||
{
|
||
return array_key_exists('appid', $this->values);
|
||
}
|
||
|
||
|
||
/**
|
||
* 设置微信支付分配的商户号
|
||
* @param string $value
|
||
**/
|
||
public function SetMch_id($value)
|
||
{
|
||
$this->values['mch_id'] = $value;
|
||
}
|
||
/**
|
||
* 获取微信支付分配的商户号的值
|
||
* @return 值
|
||
**/
|
||
public function GetMch_id()
|
||
{
|
||
return $this->values['mch_id'];
|
||
}
|
||
/**
|
||
* 判断微信支付分配的商户号是否存在
|
||
* @return true 或 false
|
||
**/
|
||
public function IsMch_idSet()
|
||
{
|
||
return array_key_exists('mch_id', $this->values);
|
||
}
|
||
|
||
|
||
/**
|
||
* 设置微信支付分配的终端设备号,填写此字段,只下载该设备号的对账单
|
||
* @param string $value
|
||
**/
|
||
public function SetDevice_info($value)
|
||
{
|
||
$this->values['device_info'] = $value;
|
||
}
|
||
/**
|
||
* 获取微信支付分配的终端设备号,填写此字段,只下载该设备号的对账单的值
|
||
* @return 值
|
||
**/
|
||
public function GetDevice_info()
|
||
{
|
||
return $this->values['device_info'];
|
||
}
|
||
/**
|
||
* 判断微信支付分配的终端设备号,填写此字段,只下载该设备号的对账单是否存在
|
||
* @return true 或 false
|
||
**/
|
||
public function IsDevice_infoSet()
|
||
{
|
||
return array_key_exists('device_info', $this->values);
|
||
}
|
||
|
||
|
||
/**
|
||
* 设置随机字符串,不长于32位。推荐随机数生成算法
|
||
* @param string $value
|
||
**/
|
||
public function SetNonce_str($value)
|
||
{
|
||
$this->values['nonce_str'] = $value;
|
||
}
|
||
/**
|
||
* 获取随机字符串,不长于32位。推荐随机数生成算法的值
|
||
* @return 值
|
||
**/
|
||
public function GetNonce_str()
|
||
{
|
||
return $this->values['nonce_str'];
|
||
}
|
||
/**
|
||
* 判断随机字符串,不长于32位。推荐随机数生成算法是否存在
|
||
* @return true 或 false
|
||
**/
|
||
public function IsNonce_strSet()
|
||
{
|
||
return array_key_exists('nonce_str', $this->values);
|
||
}
|
||
|
||
/**
|
||
* 设置下载对账单的日期,格式:20140603
|
||
* @param string $value
|
||
**/
|
||
public function SetBill_date($value)
|
||
{
|
||
$this->values['bill_date'] = $value;
|
||
}
|
||
/**
|
||
* 获取下载对账单的日期,格式:20140603的值
|
||
* @return 值
|
||
**/
|
||
public function GetBill_date()
|
||
{
|
||
return $this->values['bill_date'];
|
||
}
|
||
/**
|
||
* 判断下载对账单的日期,格式:20140603是否存在
|
||
* @return true 或 false
|
||
**/
|
||
public function IsBill_dateSet()
|
||
{
|
||
return array_key_exists('bill_date', $this->values);
|
||
}
|
||
|
||
|
||
/**
|
||
* 设置ALL,返回当日所有订单信息,默认值SUCCESS,返回当日成功支付的订单REFUND,返回当日退款订单REVOKED,已撤销的订单
|
||
* @param string $value
|
||
**/
|
||
public function SetBill_type($value)
|
||
{
|
||
$this->values['bill_type'] = $value;
|
||
}
|
||
/**
|
||
* 获取ALL,返回当日所有订单信息,默认值SUCCESS,返回当日成功支付的订单REFUND,返回当日退款订单REVOKED,已撤销的订单的值
|
||
* @return 值
|
||
**/
|
||
public function GetBill_type()
|
||
{
|
||
return $this->values['bill_type'];
|
||
}
|
||
/**
|
||
* 判断ALL,返回当日所有订单信息,默认值SUCCESS,返回当日成功支付的订单REFUND,返回当日退款订单REVOKED,已撤销的订单是否存在
|
||
* @return true 或 false
|
||
**/
|
||
public function IsBill_typeSet()
|
||
{
|
||
return array_key_exists('bill_type', $this->values);
|
||
}
|
||
}
|
||
|
||
/**
|
||
*
|
||
* 测速上报输入对象
|
||
* @author widyhu
|
||
*
|
||
*/
|
||
class WxPayReport extends WxPayDataBase
|
||
{
|
||
/**
|
||
* 设置微信分配的公众账号ID
|
||
* @param string $value
|
||
**/
|
||
public function SetAppid($value)
|
||
{
|
||
$this->values['appid'] = $value;
|
||
}
|
||
/**
|
||
* 获取微信分配的公众账号ID的值
|
||
* @return 值
|
||
**/
|
||
public function GetAppid()
|
||
{
|
||
return $this->values['appid'];
|
||
}
|
||
/**
|
||
* 判断微信分配的公众账号ID是否存在
|
||
* @return true 或 false
|
||
**/
|
||
public function IsAppidSet()
|
||
{
|
||
return array_key_exists('appid', $this->values);
|
||
}
|
||
|
||
|
||
/**
|
||
* 设置微信支付分配的商户号
|
||
* @param string $value
|
||
**/
|
||
public function SetMch_id($value)
|
||
{
|
||
$this->values['mch_id'] = $value;
|
||
}
|
||
/**
|
||
* 获取微信支付分配的商户号的值
|
||
* @return 值
|
||
**/
|
||
public function GetMch_id()
|
||
{
|
||
return $this->values['mch_id'];
|
||
}
|
||
/**
|
||
* 判断微信支付分配的商户号是否存在
|
||
* @return true 或 false
|
||
**/
|
||
public function IsMch_idSet()
|
||
{
|
||
return array_key_exists('mch_id', $this->values);
|
||
}
|
||
|
||
|
||
/**
|
||
* 设置微信支付分配的终端设备号,商户自定义
|
||
* @param string $value
|
||
**/
|
||
public function SetDevice_info($value)
|
||
{
|
||
$this->values['device_info'] = $value;
|
||
}
|
||
/**
|
||
* 获取微信支付分配的终端设备号,商户自定义的值
|
||
* @return 值
|
||
**/
|
||
public function GetDevice_info()
|
||
{
|
||
return $this->values['device_info'];
|
||
}
|
||
/**
|
||
* 判断微信支付分配的终端设备号,商户自定义是否存在
|
||
* @return true 或 false
|
||
**/
|
||
public function IsDevice_infoSet()
|
||
{
|
||
return array_key_exists('device_info', $this->values);
|
||
}
|
||
|
||
|
||
/**
|
||
* 设置随机字符串,不长于32位。推荐随机数生成算法
|
||
* @param string $value
|
||
**/
|
||
public function SetNonce_str($value)
|
||
{
|
||
$this->values['nonce_str'] = $value;
|
||
}
|
||
/**
|
||
* 获取随机字符串,不长于32位。推荐随机数生成算法的值
|
||
* @return 值
|
||
**/
|
||
public function GetNonce_str()
|
||
{
|
||
return $this->values['nonce_str'];
|
||
}
|
||
/**
|
||
* 判断随机字符串,不长于32位。推荐随机数生成算法是否存在
|
||
* @return true 或 false
|
||
**/
|
||
public function IsNonce_strSet()
|
||
{
|
||
return array_key_exists('nonce_str', $this->values);
|
||
}
|
||
|
||
|
||
/**
|
||
* 设置上报对应的接口的完整URL,类似:https://api.mch.weixin.qq.com/pay/unifiedorder对于被扫支付,为更好的和商户共同分析一次业务行为的整体耗时情况,对于两种接入模式,请都在门店侧对一次被扫行为进行一次单独的整体上报,上报URL指定为:https://api.mch.weixin.qq.com/pay/micropay/total关于两种接入模式具体可参考本文档章节:被扫支付商户接入模式其它接口调用仍然按照调用一次,上报一次来进行。
|
||
* @param string $value
|
||
**/
|
||
public function SetInterface_url($value)
|
||
{
|
||
$this->values['interface_url'] = $value;
|
||
}
|
||
/**
|
||
* 获取上报对应的接口的完整URL,类似:https://api.mch.weixin.qq.com/pay/unifiedorder对于被扫支付,为更好的和商户共同分析一次业务行为的整体耗时情况,对于两种接入模式,请都在门店侧对一次被扫行为进行一次单独的整体上报,上报URL指定为:https://api.mch.weixin.qq.com/pay/micropay/total关于两种接入模式具体可参考本文档章节:被扫支付商户接入模式其它接口调用仍然按照调用一次,上报一次来进行。的值
|
||
* @return 值
|
||
**/
|
||
public function GetInterface_url()
|
||
{
|
||
return $this->values['interface_url'];
|
||
}
|
||
/**
|
||
* 判断上报对应的接口的完整URL,类似:https://api.mch.weixin.qq.com/pay/unifiedorder对于被扫支付,为更好的和商户共同分析一次业务行为的整体耗时情况,对于两种接入模式,请都在门店侧对一次被扫行为进行一次单独的整体上报,上报URL指定为:https://api.mch.weixin.qq.com/pay/micropay/total关于两种接入模式具体可参考本文档章节:被扫支付商户接入模式其它接口调用仍然按照调用一次,上报一次来进行。是否存在
|
||
* @return true 或 false
|
||
**/
|
||
public function IsInterface_urlSet()
|
||
{
|
||
return array_key_exists('interface_url', $this->values);
|
||
}
|
||
|
||
|
||
/**
|
||
* 设置接口耗时情况,单位为毫秒
|
||
* @param string $value
|
||
**/
|
||
public function SetExecute_time_($value)
|
||
{
|
||
$this->values['execute_time_'] = $value;
|
||
}
|
||
/**
|
||
* 获取接口耗时情况,单位为毫秒的值
|
||
* @return 值
|
||
**/
|
||
public function GetExecute_time_()
|
||
{
|
||
return $this->values['execute_time_'];
|
||
}
|
||
/**
|
||
* 判断接口耗时情况,单位为毫秒是否存在
|
||
* @return true 或 false
|
||
**/
|
||
public function IsExecute_time_Set()
|
||
{
|
||
return array_key_exists('execute_time_', $this->values);
|
||
}
|
||
|
||
|
||
/**
|
||
* 设置SUCCESS/FAIL此字段是通信标识,非交易标识,交易是否成功需要查看trade_state来判断
|
||
* @param string $value
|
||
**/
|
||
public function SetReturn_code($value)
|
||
{
|
||
$this->values['return_code'] = $value;
|
||
}
|
||
/**
|
||
* 获取SUCCESS/FAIL此字段是通信标识,非交易标识,交易是否成功需要查看trade_state来判断的值
|
||
* @return 值
|
||
**/
|
||
public function GetReturn_code()
|
||
{
|
||
return $this->values['return_code'];
|
||
}
|
||
/**
|
||
* 判断SUCCESS/FAIL此字段是通信标识,非交易标识,交易是否成功需要查看trade_state来判断是否存在
|
||
* @return true 或 false
|
||
**/
|
||
public function IsReturn_codeSet()
|
||
{
|
||
return array_key_exists('return_code', $this->values);
|
||
}
|
||
|
||
|
||
/**
|
||
* 设置返回信息,如非空,为错误原因签名失败参数格式校验错误
|
||
* @param string $value
|
||
**/
|
||
public function SetReturn_msg($value)
|
||
{
|
||
$this->values['return_msg'] = $value;
|
||
}
|
||
/**
|
||
* 获取返回信息,如非空,为错误原因签名失败参数格式校验错误的值
|
||
* @return 值
|
||
**/
|
||
public function GetReturn_msg()
|
||
{
|
||
return $this->values['return_msg'];
|
||
}
|
||
/**
|
||
* 判断返回信息,如非空,为错误原因签名失败参数格式校验错误是否存在
|
||
* @return true 或 false
|
||
**/
|
||
public function IsReturn_msgSet()
|
||
{
|
||
return array_key_exists('return_msg', $this->values);
|
||
}
|
||
|
||
|
||
/**
|
||
* 设置SUCCESS/FAIL
|
||
* @param string $value
|
||
**/
|
||
public function SetResult_code($value)
|
||
{
|
||
$this->values['result_code'] = $value;
|
||
}
|
||
/**
|
||
* 获取SUCCESS/FAIL的值
|
||
* @return 值
|
||
**/
|
||
public function GetResult_code()
|
||
{
|
||
return $this->values['result_code'];
|
||
}
|
||
/**
|
||
* 判断SUCCESS/FAIL是否存在
|
||
* @return true 或 false
|
||
**/
|
||
public function IsResult_codeSet()
|
||
{
|
||
return array_key_exists('result_code', $this->values);
|
||
}
|
||
|
||
|
||
/**
|
||
* 设置ORDERNOTEXIST—订单不存在SYSTEMERROR—系统错误
|
||
* @param string $value
|
||
**/
|
||
public function SetErr_code($value)
|
||
{
|
||
$this->values['err_code'] = $value;
|
||
}
|
||
/**
|
||
* 获取ORDERNOTEXIST—订单不存在SYSTEMERROR—系统错误的值
|
||
* @return 值
|
||
**/
|
||
public function GetErr_code()
|
||
{
|
||
return $this->values['err_code'];
|
||
}
|
||
/**
|
||
* 判断ORDERNOTEXIST—订单不存在SYSTEMERROR—系统错误是否存在
|
||
* @return true 或 false
|
||
**/
|
||
public function IsErr_codeSet()
|
||
{
|
||
return array_key_exists('err_code', $this->values);
|
||
}
|
||
|
||
|
||
/**
|
||
* 设置结果信息描述
|
||
* @param string $value
|
||
**/
|
||
public function SetErr_code_des($value)
|
||
{
|
||
$this->values['err_code_des'] = $value;
|
||
}
|
||
/**
|
||
* 获取结果信息描述的值
|
||
* @return 值
|
||
**/
|
||
public function GetErr_code_des()
|
||
{
|
||
return $this->values['err_code_des'];
|
||
}
|
||
/**
|
||
* 判断结果信息描述是否存在
|
||
* @return true 或 false
|
||
**/
|
||
public function IsErr_code_desSet()
|
||
{
|
||
return array_key_exists('err_code_des', $this->values);
|
||
}
|
||
|
||
|
||
/**
|
||
* 设置商户系统内部的订单号,商户可以在上报时提供相关商户订单号方便微信支付更好的提高服务质量。
|
||
* @param string $value
|
||
**/
|
||
public function SetOut_trade_no($value)
|
||
{
|
||
$this->values['out_trade_no'] = $value;
|
||
}
|
||
/**
|
||
* 获取商户系统内部的订单号,商户可以在上报时提供相关商户订单号方便微信支付更好的提高服务质量。 的值
|
||
* @return 值
|
||
**/
|
||
public function GetOut_trade_no()
|
||
{
|
||
return $this->values['out_trade_no'];
|
||
}
|
||
/**
|
||
* 判断商户系统内部的订单号,商户可以在上报时提供相关商户订单号方便微信支付更好的提高服务质量。 是否存在
|
||
* @return true 或 false
|
||
**/
|
||
public function IsOut_trade_noSet()
|
||
{
|
||
return array_key_exists('out_trade_no', $this->values);
|
||
}
|
||
|
||
|
||
/**
|
||
* 设置发起接口调用时的机器IP
|
||
* @param string $value
|
||
**/
|
||
public function SetUser_ip($value)
|
||
{
|
||
$this->values['user_ip'] = $value;
|
||
}
|
||
/**
|
||
* 获取发起接口调用时的机器IP 的值
|
||
* @return 值
|
||
**/
|
||
public function GetUser_ip()
|
||
{
|
||
return $this->values['user_ip'];
|
||
}
|
||
/**
|
||
* 判断发起接口调用时的机器IP 是否存在
|
||
* @return true 或 false
|
||
**/
|
||
public function IsUser_ipSet()
|
||
{
|
||
return array_key_exists('user_ip', $this->values);
|
||
}
|
||
|
||
|
||
/**
|
||
* 设置系统时间,格式为yyyyMMddHHmmss,如2009年12月27日9点10分10秒表示为20091227091010。其他详见时间规则
|
||
* @param string $value
|
||
**/
|
||
public function SetTime($value)
|
||
{
|
||
$this->values['time'] = $value;
|
||
}
|
||
/**
|
||
* 获取系统时间,格式为yyyyMMddHHmmss,如2009年12月27日9点10分10秒表示为20091227091010。其他详见时间规则的值
|
||
* @return 值
|
||
**/
|
||
public function GetTime()
|
||
{
|
||
return $this->values['time'];
|
||
}
|
||
/**
|
||
* 判断系统时间,格式为yyyyMMddHHmmss,如2009年12月27日9点10分10秒表示为20091227091010。其他详见时间规则是否存在
|
||
* @return true 或 false
|
||
**/
|
||
public function IsTimeSet()
|
||
{
|
||
return array_key_exists('time', $this->values);
|
||
}
|
||
}
|
||
|
||
/**
|
||
*
|
||
* 短链转换输入对象
|
||
* @author widyhu
|
||
*
|
||
*/
|
||
class WxPayShortUrl extends WxPayDataBase
|
||
{
|
||
/**
|
||
* 设置微信分配的公众账号ID
|
||
* @param string $value
|
||
**/
|
||
public function SetAppid($value)
|
||
{
|
||
$this->values['appid'] = $value;
|
||
}
|
||
/**
|
||
* 获取微信分配的公众账号ID的值
|
||
* @return 值
|
||
**/
|
||
public function GetAppid()
|
||
{
|
||
return $this->values['appid'];
|
||
}
|
||
/**
|
||
* 判断微信分配的公众账号ID是否存在
|
||
* @return true 或 false
|
||
**/
|
||
public function IsAppidSet()
|
||
{
|
||
return array_key_exists('appid', $this->values);
|
||
}
|
||
|
||
|
||
/**
|
||
* 设置微信支付分配的商户号
|
||
* @param string $value
|
||
**/
|
||
public function SetMch_id($value)
|
||
{
|
||
$this->values['mch_id'] = $value;
|
||
}
|
||
/**
|
||
* 获取微信支付分配的商户号的值
|
||
* @return 值
|
||
**/
|
||
public function GetMch_id()
|
||
{
|
||
return $this->values['mch_id'];
|
||
}
|
||
/**
|
||
* 判断微信支付分配的商户号是否存在
|
||
* @return true 或 false
|
||
**/
|
||
public function IsMch_idSet()
|
||
{
|
||
return array_key_exists('mch_id', $this->values);
|
||
}
|
||
|
||
|
||
/**
|
||
* 设置需要转换的URL,签名用原串,传输需URL encode
|
||
* @param string $value
|
||
**/
|
||
public function SetLong_url($value)
|
||
{
|
||
$this->values['long_url'] = $value;
|
||
}
|
||
/**
|
||
* 获取需要转换的URL,签名用原串,传输需URL encode的值
|
||
* @return 值
|
||
**/
|
||
public function GetLong_url()
|
||
{
|
||
return $this->values['long_url'];
|
||
}
|
||
/**
|
||
* 判断需要转换的URL,签名用原串,传输需URL encode是否存在
|
||
* @return true 或 false
|
||
**/
|
||
public function IsLong_urlSet()
|
||
{
|
||
return array_key_exists('long_url', $this->values);
|
||
}
|
||
|
||
|
||
/**
|
||
* 设置随机字符串,不长于32位。推荐随机数生成算法
|
||
* @param string $value
|
||
**/
|
||
public function SetNonce_str($value)
|
||
{
|
||
$this->values['nonce_str'] = $value;
|
||
}
|
||
/**
|
||
* 获取随机字符串,不长于32位。推荐随机数生成算法的值
|
||
* @return 值
|
||
**/
|
||
public function GetNonce_str()
|
||
{
|
||
return $this->values['nonce_str'];
|
||
}
|
||
/**
|
||
* 判断随机字符串,不长于32位。推荐随机数生成算法是否存在
|
||
* @return true 或 false
|
||
**/
|
||
public function IsNonce_strSet()
|
||
{
|
||
return array_key_exists('nonce_str', $this->values);
|
||
}
|
||
}
|
||
|
||
|
||
/**
|
||
*
|
||
* 撤销输入对象
|
||
* @author widyhu
|
||
*
|
||
*/
|
||
class WxPayReverse extends WxPayDataBase
|
||
{
|
||
/**
|
||
* 设置微信分配的公众账号ID
|
||
* @param string $value
|
||
**/
|
||
public function SetAppid($value)
|
||
{
|
||
$this->values['appid'] = $value;
|
||
}
|
||
/**
|
||
* 获取微信分配的公众账号ID的值
|
||
* @return 值
|
||
**/
|
||
public function GetAppid()
|
||
{
|
||
return $this->values['appid'];
|
||
}
|
||
/**
|
||
* 判断微信分配的公众账号ID是否存在
|
||
* @return true 或 false
|
||
**/
|
||
public function IsAppidSet()
|
||
{
|
||
return array_key_exists('appid', $this->values);
|
||
}
|
||
|
||
|
||
/**
|
||
* 设置微信支付分配的商户号
|
||
* @param string $value
|
||
**/
|
||
public function SetMch_id($value)
|
||
{
|
||
$this->values['mch_id'] = $value;
|
||
}
|
||
/**
|
||
* 获取微信支付分配的商户号的值
|
||
* @return 值
|
||
**/
|
||
public function GetMch_id()
|
||
{
|
||
return $this->values['mch_id'];
|
||
}
|
||
/**
|
||
* 判断微信支付分配的商户号是否存在
|
||
* @return true 或 false
|
||
**/
|
||
public function IsMch_idSet()
|
||
{
|
||
return array_key_exists('mch_id', $this->values);
|
||
}
|
||
|
||
|
||
/**
|
||
* 设置微信的订单号,优先使用
|
||
* @param string $value
|
||
**/
|
||
public function SetTransaction_id($value)
|
||
{
|
||
$this->values['transaction_id'] = $value;
|
||
}
|
||
/**
|
||
* 获取微信的订单号,优先使用的值
|
||
* @return 值
|
||
**/
|
||
public function GetTransaction_id()
|
||
{
|
||
return $this->values['transaction_id'];
|
||
}
|
||
/**
|
||
* 判断微信的订单号,优先使用是否存在
|
||
* @return true 或 false
|
||
**/
|
||
public function IsTransaction_idSet()
|
||
{
|
||
return array_key_exists('transaction_id', $this->values);
|
||
}
|
||
|
||
|
||
/**
|
||
* 设置商户系统内部的订单号,transaction_id、out_trade_no二选一,如果同时存在优先级:transaction_id> out_trade_no
|
||
* @param string $value
|
||
**/
|
||
public function SetOut_trade_no($value)
|
||
{
|
||
$this->values['out_trade_no'] = $value;
|
||
}
|
||
/**
|
||
* 获取商户系统内部的订单号,transaction_id、out_trade_no二选一,如果同时存在优先级:transaction_id> out_trade_no的值
|
||
* @return 值
|
||
**/
|
||
public function GetOut_trade_no()
|
||
{
|
||
return $this->values['out_trade_no'];
|
||
}
|
||
/**
|
||
* 判断商户系统内部的订单号,transaction_id、out_trade_no二选一,如果同时存在优先级:transaction_id> out_trade_no是否存在
|
||
* @return true 或 false
|
||
**/
|
||
public function IsOut_trade_noSet()
|
||
{
|
||
return array_key_exists('out_trade_no', $this->values);
|
||
}
|
||
|
||
|
||
/**
|
||
* 设置随机字符串,不长于32位。推荐随机数生成算法
|
||
* @param string $value
|
||
**/
|
||
public function SetNonce_str($value)
|
||
{
|
||
$this->values['nonce_str'] = $value;
|
||
}
|
||
/**
|
||
* 获取随机字符串,不长于32位。推荐随机数生成算法的值
|
||
* @return 值
|
||
**/
|
||
public function GetNonce_str()
|
||
{
|
||
return $this->values['nonce_str'];
|
||
}
|
||
/**
|
||
* 判断随机字符串,不长于32位。推荐随机数生成算法是否存在
|
||
* @return true 或 false
|
||
**/
|
||
public function IsNonce_strSet()
|
||
{
|
||
return array_key_exists('nonce_str', $this->values);
|
||
}
|
||
}
|
||
|
||
|
||
|
||
/**
|
||
*
|
||
* 扫码支付模式一生成二维码参数
|
||
* @author widyhu
|
||
*
|
||
*/
|
||
class WxPayBizPayUrl extends WxPayDataBaseSignMd5
|
||
{
|
||
/**
|
||
* 设置微信分配的公众账号ID
|
||
* @param string $value
|
||
**/
|
||
public function SetAppid($value)
|
||
{
|
||
$this->values['appid'] = $value;
|
||
}
|
||
/**
|
||
* 获取微信分配的公众账号ID的值
|
||
* @return 值
|
||
**/
|
||
public function GetAppid()
|
||
{
|
||
return $this->values['appid'];
|
||
}
|
||
/**
|
||
* 判断微信分配的公众账号ID是否存在
|
||
* @return true 或 false
|
||
**/
|
||
public function IsAppidSet()
|
||
{
|
||
return array_key_exists('appid', $this->values);
|
||
}
|
||
|
||
|
||
/**
|
||
* 设置微信支付分配的商户号
|
||
* @param string $value
|
||
**/
|
||
public function SetMch_id($value)
|
||
{
|
||
$this->values['mch_id'] = $value;
|
||
}
|
||
/**
|
||
* 获取微信支付分配的商户号的值
|
||
* @return 值
|
||
**/
|
||
public function GetMch_id()
|
||
{
|
||
return $this->values['mch_id'];
|
||
}
|
||
/**
|
||
* 判断微信支付分配的商户号是否存在
|
||
* @return true 或 false
|
||
**/
|
||
public function IsMch_idSet()
|
||
{
|
||
return array_key_exists('mch_id', $this->values);
|
||
}
|
||
|
||
/**
|
||
* 设置支付时间戳
|
||
* @param string $value
|
||
**/
|
||
public function SetTime_stamp($value)
|
||
{
|
||
$this->values['time_stamp'] = $value;
|
||
}
|
||
/**
|
||
* 获取支付时间戳的值
|
||
* @return 值
|
||
**/
|
||
public function GetTime_stamp()
|
||
{
|
||
return $this->values['time_stamp'];
|
||
}
|
||
/**
|
||
* 判断支付时间戳是否存在
|
||
* @return true 或 false
|
||
**/
|
||
public function IsTime_stampSet()
|
||
{
|
||
return array_key_exists('time_stamp', $this->values);
|
||
}
|
||
|
||
/**
|
||
* 设置随机字符串
|
||
* @param string $value
|
||
**/
|
||
public function SetNonce_str($value)
|
||
{
|
||
$this->values['nonce_str'] = $value;
|
||
}
|
||
/**
|
||
* 获取随机字符串的值
|
||
* @return 值
|
||
**/
|
||
public function GetNonce_str()
|
||
{
|
||
return $this->values['nonce_str'];
|
||
}
|
||
/**
|
||
* 判断随机字符串是否存在
|
||
* @return true 或 false
|
||
**/
|
||
public function IsNonce_strSet()
|
||
{
|
||
return array_key_exists('nonce_str', $this->values);
|
||
}
|
||
|
||
/**
|
||
* 设置商品ID
|
||
* @param string $value
|
||
**/
|
||
public function SetProduct_id($value)
|
||
{
|
||
$this->values['product_id'] = $value;
|
||
}
|
||
/**
|
||
* 获取商品ID的值
|
||
* @return 值
|
||
**/
|
||
public function GetProduct_id()
|
||
{
|
||
return $this->values['product_id'];
|
||
}
|
||
/**
|
||
* 判断商品ID是否存在
|
||
* @return true 或 false
|
||
**/
|
||
public function IsProduct_idSet()
|
||
{
|
||
return array_key_exists('product_id', $this->values);
|
||
}
|
||
}
|
||
|