WxPay.Data.php 60 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986
  1. <?php
  2. /**
  3. * 2015-06-29 修复签名问题
  4. **/
  5. //require_once "WxPay.Config.php";
  6. require_once "WxPay.Exception.php";
  7. /**
  8. *
  9. * 数据对象基础类,该类中定义数据类最基本的行为,包括:
  10. * 计算/设置/获取签名、输出xml格式的参数、从xml读取数据对象等
  11. * @author widyhu
  12. *
  13. */
  14. class WxPayDataBase
  15. {
  16. protected $values = array();
  17. /**
  18. * 设置签名,详见签名生成算法
  19. * @param string $value
  20. **/
  21. public function SetSign()
  22. {
  23. $sign = $this->MakeSign();
  24. $this->values['sign'] = $sign;
  25. return $sign;
  26. }
  27. /**
  28. * 获取签名,详见签名生成算法的值
  29. * @return 值
  30. **/
  31. public function GetSign()
  32. {
  33. return $this->values['sign'];
  34. }
  35. /**
  36. * 判断签名,详见签名生成算法是否存在
  37. * @return true 或 false
  38. **/
  39. public function IsSignSet()
  40. {
  41. return array_key_exists('sign', $this->values);
  42. }
  43. /**
  44. * 输出xml字符
  45. * @throws WxPayException
  46. **/
  47. public function ToXml()
  48. {
  49. if(!is_array($this->values)
  50. || count($this->values) <= 0)
  51. {
  52. throw new WxPayException("数组数据异常!");
  53. }
  54. $xml = "<xml>";
  55. foreach ($this->values as $key=>$val)
  56. {
  57. if (is_numeric($val)){
  58. $xml.="<".$key.">".$val."</".$key.">";
  59. }else{
  60. $xml.="<".$key."><![CDATA[".$val."]]></".$key.">";
  61. }
  62. }
  63. $xml.="</xml>";
  64. return $xml;
  65. }
  66. /**
  67. * 将xml转为array
  68. * @param string $xml
  69. * @throws WxPayException
  70. */
  71. public function FromXml($xml)
  72. {
  73. if(!$xml){
  74. throw new WxPayException("xml数据异常!");
  75. }
  76. //将XML转为array
  77. //禁止引用外部xml实体
  78. if( function_exists('libxml_disable_entity_loader') ){
  79. libxml_disable_entity_loader(true);
  80. }
  81. $this->values = json_decode(json_encode(simplexml_load_string($xml, 'SimpleXMLElement', LIBXML_NOCDATA)), true);
  82. return $this->values;
  83. }
  84. /**
  85. * 格式化参数格式化成url参数
  86. */
  87. public function ToUrlParams()
  88. {
  89. $buff = "";
  90. foreach ($this->values as $k => $v)
  91. {
  92. if($k != "sign" && $v != "" && !is_array($v)){
  93. $buff .= $k . "=" . $v . "&";
  94. }
  95. }
  96. $buff = trim($buff, "&");
  97. return $buff;
  98. }
  99. /**
  100. * 生成签名
  101. * @return 签名,本函数不覆盖sign成员变量,如要设置签名需要调用SetSign方法赋值
  102. */
  103. public function MakeSign()
  104. {
  105. //签名步骤一:按字典序排序参数
  106. ksort($this->values);
  107. $string = $this->ToUrlParams();
  108. //签名步骤二:在string后加入KEY
  109. $string = $string . "&key=".WxPayConfig::$KEY;
  110. //签名步骤三:MD5加密
  111. $string = md5($string);
  112. //签名步骤四:所有字符转为大写
  113. $result = strtoupper($string);
  114. return $result;
  115. }
  116. /**
  117. * 获取设置的值
  118. */
  119. public function GetValues()
  120. {
  121. return $this->values;
  122. }
  123. }
  124. /**
  125. *
  126. * 接口调用结果类
  127. * @author widyhu
  128. *
  129. */
  130. class WxPayResults extends WxPayDataBase
  131. {
  132. /**
  133. *
  134. * 检测签名
  135. */
  136. public function CheckSign()
  137. {
  138. //fix异常
  139. if(!$this->IsSignSet()){
  140. throw new WxPayException("签名错误!");
  141. }
  142. $sign = $this->MakeSign();
  143. if($this->GetSign() == $sign){
  144. return true;
  145. }
  146. throw new WxPayException("签名错误!");
  147. }
  148. /**
  149. *
  150. * 使用数组初始化
  151. * @param array $array
  152. */
  153. public function FromArray($array)
  154. {
  155. $this->values = $array;
  156. }
  157. /**
  158. *
  159. * 使用数组初始化对象
  160. * @param array $array
  161. * @param 是否检测签名 $noCheckSign
  162. */
  163. public static function InitFromArray($array, $noCheckSign = false)
  164. {
  165. $obj = new self();
  166. $obj->FromArray($array);
  167. if($noCheckSign == false){
  168. $obj->CheckSign();
  169. }
  170. return $obj;
  171. }
  172. /**
  173. *
  174. * 设置参数
  175. * @param string $key
  176. * @param string $value
  177. */
  178. public function SetData($key, $value)
  179. {
  180. $this->values[$key] = $value;
  181. }
  182. /**
  183. * 将xml转为array
  184. * @param string $xml
  185. * @throws WxPayException
  186. */
  187. public static function Init($xml)
  188. {
  189. $obj = new self();
  190. $obj->FromXml($xml);
  191. //fix bug 2015-06-29
  192. if($obj->values['return_code'] != 'SUCCESS'){
  193. return $obj->GetValues();
  194. }
  195. $obj->CheckSign();
  196. return $obj->GetValues();
  197. }
  198. }
  199. /**
  200. *
  201. * 回调基础类
  202. * @author widyhu
  203. *
  204. */
  205. class WxPayNotifyReply extends WxPayDataBase
  206. {
  207. /**
  208. *
  209. * 设置错误码 FAIL 或者 SUCCESS
  210. * @param string
  211. */
  212. public function SetReturn_code($return_code)
  213. {
  214. $this->values['return_code'] = $return_code;
  215. }
  216. /**
  217. *
  218. * 获取错误码 FAIL 或者 SUCCESS
  219. * @return string $return_code
  220. */
  221. public function GetReturn_code()
  222. {
  223. return $this->values['return_code'];
  224. }
  225. /**
  226. *
  227. * 设置错误信息
  228. * @param string $return_code
  229. */
  230. public function SetReturn_msg($return_msg)
  231. {
  232. $this->values['return_msg'] = $return_msg;
  233. }
  234. /**
  235. *
  236. * 获取错误信息
  237. * @return string
  238. */
  239. public function GetReturn_msg()
  240. {
  241. return $this->values['return_msg'];
  242. }
  243. /**
  244. *
  245. * 设置返回参数
  246. * @param string $key
  247. * @param string $value
  248. */
  249. public function SetData($key, $value)
  250. {
  251. $this->values[$key] = $value;
  252. }
  253. }
  254. /**
  255. *
  256. * 统一下单输入对象
  257. * @author widyhu
  258. *
  259. */
  260. class WxPayUnifiedOrder extends WxPayDataBase
  261. {
  262. /**
  263. * 设置微信分配的公众账号ID
  264. * @param string $value
  265. **/
  266. public function SetAppid($value)
  267. {
  268. $this->values['appid'] = $value;
  269. }
  270. /**
  271. * 获取微信分配的公众账号ID的值
  272. * @return 值
  273. **/
  274. public function GetAppid()
  275. {
  276. return $this->values['appid'];
  277. }
  278. /**
  279. * 判断微信分配的公众账号ID是否存在
  280. * @return true 或 false
  281. **/
  282. public function IsAppidSet()
  283. {
  284. return array_key_exists('appid', $this->values);
  285. }
  286. /**
  287. * 设置微信支付分配的商户号
  288. * @param string $value
  289. **/
  290. public function SetMch_id($value)
  291. {
  292. $this->values['mch_id'] = $value;
  293. }
  294. /**
  295. * 获取微信支付分配的商户号的值
  296. * @return 值
  297. **/
  298. public function GetMch_id()
  299. {
  300. return $this->values['mch_id'];
  301. }
  302. /**
  303. * 判断微信支付分配的商户号是否存在
  304. * @return true 或 false
  305. **/
  306. public function IsMch_idSet()
  307. {
  308. return array_key_exists('mch_id', $this->values);
  309. }
  310. /**
  311. * 设置微信支付分配的终端设备号,商户自定义
  312. * @param string $value
  313. **/
  314. public function SetDevice_info($value)
  315. {
  316. $this->values['device_info'] = $value;
  317. }
  318. /**
  319. * 获取微信支付分配的终端设备号,商户自定义的值
  320. * @return 值
  321. **/
  322. public function GetDevice_info()
  323. {
  324. return $this->values['device_info'];
  325. }
  326. /**
  327. * 判断微信支付分配的终端设备号,商户自定义是否存在
  328. * @return true 或 false
  329. **/
  330. public function IsDevice_infoSet()
  331. {
  332. return array_key_exists('device_info', $this->values);
  333. }
  334. /**
  335. * 设置随机字符串,不长于32位。推荐随机数生成算法
  336. * @param string $value
  337. **/
  338. public function SetNonce_str($value)
  339. {
  340. $this->values['nonce_str'] = $value;
  341. }
  342. /**
  343. * 获取随机字符串,不长于32位。推荐随机数生成算法的值
  344. * @return 值
  345. **/
  346. public function GetNonce_str()
  347. {
  348. return $this->values['nonce_str'];
  349. }
  350. /**
  351. * 判断随机字符串,不长于32位。推荐随机数生成算法是否存在
  352. * @return true 或 false
  353. **/
  354. public function IsNonce_strSet()
  355. {
  356. return array_key_exists('nonce_str', $this->values);
  357. }
  358. /**
  359. * 设置商品或支付单简要描述
  360. * @param string $value
  361. **/
  362. public function SetBody($value)
  363. {
  364. $this->values['body'] = $value;
  365. }
  366. /**
  367. * 获取商品或支付单简要描述的值
  368. * @return 值
  369. **/
  370. public function GetBody()
  371. {
  372. return $this->values['body'];
  373. }
  374. /**
  375. * 判断商品或支付单简要描述是否存在
  376. * @return true 或 false
  377. **/
  378. public function IsBodySet()
  379. {
  380. return array_key_exists('body', $this->values);
  381. }
  382. /**
  383. * 设置商品名称明细列表
  384. * @param string $value
  385. **/
  386. public function SetDetail($value)
  387. {
  388. $this->values['detail'] = $value;
  389. }
  390. /**
  391. * 获取商品名称明细列表的值
  392. * @return 值
  393. **/
  394. public function GetDetail()
  395. {
  396. return $this->values['detail'];
  397. }
  398. /**
  399. * 判断商品名称明细列表是否存在
  400. * @return true 或 false
  401. **/
  402. public function IsDetailSet()
  403. {
  404. return array_key_exists('detail', $this->values);
  405. }
  406. /**
  407. * 设置附加数据,在查询API和支付通知中原样返回,该字段主要用于商户携带订单的自定义数据
  408. * @param string $value
  409. **/
  410. public function SetAttach($value)
  411. {
  412. $this->values['attach'] = $value;
  413. }
  414. /**
  415. * 获取附加数据,在查询API和支付通知中原样返回,该字段主要用于商户携带订单的自定义数据的值
  416. * @return 值
  417. **/
  418. public function GetAttach()
  419. {
  420. return $this->values['attach'];
  421. }
  422. /**
  423. * 判断附加数据,在查询API和支付通知中原样返回,该字段主要用于商户携带订单的自定义数据是否存在
  424. * @return true 或 false
  425. **/
  426. public function IsAttachSet()
  427. {
  428. return array_key_exists('attach', $this->values);
  429. }
  430. /**
  431. * 设置商户系统内部的订单号,32个字符内、可包含字母, 其他说明见商户订单号
  432. * @param string $value
  433. **/
  434. public function SetOut_trade_no($value)
  435. {
  436. $this->values['out_trade_no'] = $value;
  437. }
  438. /**
  439. * 获取商户系统内部的订单号,32个字符内、可包含字母, 其他说明见商户订单号的值
  440. * @return 值
  441. **/
  442. public function GetOut_trade_no()
  443. {
  444. return $this->values['out_trade_no'];
  445. }
  446. /**
  447. * 判断商户系统内部的订单号,32个字符内、可包含字母, 其他说明见商户订单号是否存在
  448. * @return true 或 false
  449. **/
  450. public function IsOut_trade_noSet()
  451. {
  452. return array_key_exists('out_trade_no', $this->values);
  453. }
  454. /**
  455. * 设置符合ISO 4217标准的三位字母代码,默认人民币:CNY,其他值列表详见货币类型
  456. * @param string $value
  457. **/
  458. public function SetFee_type($value)
  459. {
  460. $this->values['fee_type'] = $value;
  461. }
  462. /**
  463. * 获取符合ISO 4217标准的三位字母代码,默认人民币:CNY,其他值列表详见货币类型的值
  464. * @return 值
  465. **/
  466. public function GetFee_type()
  467. {
  468. return $this->values['fee_type'];
  469. }
  470. /**
  471. * 判断符合ISO 4217标准的三位字母代码,默认人民币:CNY,其他值列表详见货币类型是否存在
  472. * @return true 或 false
  473. **/
  474. public function IsFee_typeSet()
  475. {
  476. return array_key_exists('fee_type', $this->values);
  477. }
  478. /**
  479. * 设置订单总金额,只能为整数,详见支付金额
  480. * @param string $value
  481. **/
  482. public function SetTotal_fee($value)
  483. {
  484. $this->values['total_fee'] = $value;
  485. }
  486. /**
  487. * 获取订单总金额,只能为整数,详见支付金额的值
  488. * @return 值
  489. **/
  490. public function GetTotal_fee()
  491. {
  492. return $this->values['total_fee'];
  493. }
  494. /**
  495. * 判断订单总金额,只能为整数,详见支付金额是否存在
  496. * @return true 或 false
  497. **/
  498. public function IsTotal_feeSet()
  499. {
  500. return array_key_exists('total_fee', $this->values);
  501. }
  502. /**
  503. * 设置APP和网页支付提交用户端ip,Native支付填调用微信支付API的机器IP。
  504. * @param string $value
  505. **/
  506. public function SetSpbill_create_ip($value)
  507. {
  508. $this->values['spbill_create_ip'] = $value;
  509. }
  510. /**
  511. * 获取APP和网页支付提交用户端ip,Native支付填调用微信支付API的机器IP。的值
  512. * @return 值
  513. **/
  514. public function GetSpbill_create_ip()
  515. {
  516. return $this->values['spbill_create_ip'];
  517. }
  518. /**
  519. * 判断APP和网页支付提交用户端ip,Native支付填调用微信支付API的机器IP。是否存在
  520. * @return true 或 false
  521. **/
  522. public function IsSpbill_create_ipSet()
  523. {
  524. return array_key_exists('spbill_create_ip', $this->values);
  525. }
  526. /**
  527. * 设置订单生成时间,格式为yyyyMMddHHmmss,如2009年12月25日9点10分10秒表示为20091225091010。其他详见时间规则
  528. * @param string $value
  529. **/
  530. public function SetTime_start($value)
  531. {
  532. $this->values['time_start'] = $value;
  533. }
  534. /**
  535. * 获取订单生成时间,格式为yyyyMMddHHmmss,如2009年12月25日9点10分10秒表示为20091225091010。其他详见时间规则的值
  536. * @return 值
  537. **/
  538. public function GetTime_start()
  539. {
  540. return $this->values['time_start'];
  541. }
  542. /**
  543. * 判断订单生成时间,格式为yyyyMMddHHmmss,如2009年12月25日9点10分10秒表示为20091225091010。其他详见时间规则是否存在
  544. * @return true 或 false
  545. **/
  546. public function IsTime_startSet()
  547. {
  548. return array_key_exists('time_start', $this->values);
  549. }
  550. /**
  551. * 设置订单失效时间,格式为yyyyMMddHHmmss,如2009年12月27日9点10分10秒表示为20091227091010。其他详见时间规则
  552. * @param string $value
  553. **/
  554. public function SetTime_expire($value)
  555. {
  556. $this->values['time_expire'] = $value;
  557. }
  558. /**
  559. * 获取订单失效时间,格式为yyyyMMddHHmmss,如2009年12月27日9点10分10秒表示为20091227091010。其他详见时间规则的值
  560. * @return 值
  561. **/
  562. public function GetTime_expire()
  563. {
  564. return $this->values['time_expire'];
  565. }
  566. /**
  567. * 判断订单失效时间,格式为yyyyMMddHHmmss,如2009年12月27日9点10分10秒表示为20091227091010。其他详见时间规则是否存在
  568. * @return true 或 false
  569. **/
  570. public function IsTime_expireSet()
  571. {
  572. return array_key_exists('time_expire', $this->values);
  573. }
  574. /**
  575. * 设置商品标记,代金券或立减优惠功能的参数,说明详见代金券或立减优惠
  576. * @param string $value
  577. **/
  578. public function SetGoods_tag($value)
  579. {
  580. $this->values['goods_tag'] = $value;
  581. }
  582. /**
  583. * 获取商品标记,代金券或立减优惠功能的参数,说明详见代金券或立减优惠的值
  584. * @return 值
  585. **/
  586. public function GetGoods_tag()
  587. {
  588. return $this->values['goods_tag'];
  589. }
  590. /**
  591. * 判断商品标记,代金券或立减优惠功能的参数,说明详见代金券或立减优惠是否存在
  592. * @return true 或 false
  593. **/
  594. public function IsGoods_tagSet()
  595. {
  596. return array_key_exists('goods_tag', $this->values);
  597. }
  598. /**
  599. * 设置接收微信支付异步通知回调地址
  600. * @param string $value
  601. **/
  602. public function SetNotify_url($value)
  603. {
  604. $this->values['notify_url'] = $value;
  605. }
  606. /**
  607. * 获取接收微信支付异步通知回调地址的值
  608. * @return 值
  609. **/
  610. public function GetNotify_url()
  611. {
  612. return $this->values['notify_url'];
  613. }
  614. /**
  615. * 判断接收微信支付异步通知回调地址是否存在
  616. * @return true 或 false
  617. **/
  618. public function IsNotify_urlSet()
  619. {
  620. return array_key_exists('notify_url', $this->values);
  621. }
  622. /**
  623. * 设置取值如下:JSAPI,NATIVE,APP,详细说明见参数规定
  624. * @param string $value
  625. **/
  626. public function SetTrade_type($value)
  627. {
  628. $this->values['trade_type'] = $value;
  629. }
  630. /**
  631. * 获取取值如下:JSAPI,NATIVE,APP,详细说明见参数规定的值
  632. * @return 值
  633. **/
  634. public function GetTrade_type()
  635. {
  636. return $this->values['trade_type'];
  637. }
  638. /**
  639. * 判断取值如下:JSAPI,NATIVE,APP,详细说明见参数规定是否存在
  640. * @return true 或 false
  641. **/
  642. public function IsTrade_typeSet()
  643. {
  644. return array_key_exists('trade_type', $this->values);
  645. }
  646. /**
  647. * 设置trade_type=NATIVE,此参数必传。此id为二维码中包含的商品ID,商户自行定义。
  648. * @param string $value
  649. **/
  650. public function SetProduct_id($value)
  651. {
  652. $this->values['product_id'] = $value;
  653. }
  654. /**
  655. * 获取trade_type=NATIVE,此参数必传。此id为二维码中包含的商品ID,商户自行定义。的值
  656. * @return 值
  657. **/
  658. public function GetProduct_id()
  659. {
  660. return $this->values['product_id'];
  661. }
  662. /**
  663. * 判断trade_type=NATIVE,此参数必传。此id为二维码中包含的商品ID,商户自行定义。是否存在
  664. * @return true 或 false
  665. **/
  666. public function IsProduct_idSet()
  667. {
  668. return array_key_exists('product_id', $this->values);
  669. }
  670. /**
  671. * 设置trade_type=JSAPI,此参数必传,用户在商户appid下的唯一标识。下单前需要调用【网页授权获取用户信息】接口获取到用户的Openid。
  672. * @param string $value
  673. **/
  674. public function SetOpenid($value)
  675. {
  676. $this->values['openid'] = $value;
  677. }
  678. /**
  679. * 获取trade_type=JSAPI,此参数必传,用户在商户appid下的唯一标识。下单前需要调用【网页授权获取用户信息】接口获取到用户的Openid。 的值
  680. * @return 值
  681. **/
  682. public function GetOpenid()
  683. {
  684. return $this->values['openid'];
  685. }
  686. /**
  687. * 判断trade_type=JSAPI,此参数必传,用户在商户appid下的唯一标识。下单前需要调用【网页授权获取用户信息】接口获取到用户的Openid。 是否存在
  688. * @return true 或 false
  689. **/
  690. public function IsOpenidSet()
  691. {
  692. return array_key_exists('openid', $this->values);
  693. }
  694. }
  695. /**
  696. *
  697. * 订单查询输入对象
  698. * @author widyhu
  699. *
  700. */
  701. class WxPayOrderQuery extends WxPayDataBase
  702. {
  703. /**
  704. * 设置微信分配的公众账号ID
  705. * @param string $value
  706. **/
  707. public function SetAppid($value)
  708. {
  709. $this->values['appid'] = $value;
  710. }
  711. /**
  712. * 获取微信分配的公众账号ID的值
  713. * @return 值
  714. **/
  715. public function GetAppid()
  716. {
  717. return $this->values['appid'];
  718. }
  719. /**
  720. * 判断微信分配的公众账号ID是否存在
  721. * @return true 或 false
  722. **/
  723. public function IsAppidSet()
  724. {
  725. return array_key_exists('appid', $this->values);
  726. }
  727. /**
  728. * 设置微信支付分配的商户号
  729. * @param string $value
  730. **/
  731. public function SetMch_id($value)
  732. {
  733. $this->values['mch_id'] = $value;
  734. }
  735. /**
  736. * 获取微信支付分配的商户号的值
  737. * @return 值
  738. **/
  739. public function GetMch_id()
  740. {
  741. return $this->values['mch_id'];
  742. }
  743. /**
  744. * 判断微信支付分配的商户号是否存在
  745. * @return true 或 false
  746. **/
  747. public function IsMch_idSet()
  748. {
  749. return array_key_exists('mch_id', $this->values);
  750. }
  751. /**
  752. * 设置微信的订单号,优先使用
  753. * @param string $value
  754. **/
  755. public function SetTransaction_id($value)
  756. {
  757. $this->values['transaction_id'] = $value;
  758. }
  759. /**
  760. * 获取微信的订单号,优先使用的值
  761. * @return 值
  762. **/
  763. public function GetTransaction_id()
  764. {
  765. return $this->values['transaction_id'];
  766. }
  767. /**
  768. * 判断微信的订单号,优先使用是否存在
  769. * @return true 或 false
  770. **/
  771. public function IsTransaction_idSet()
  772. {
  773. return array_key_exists('transaction_id', $this->values);
  774. }
  775. /**
  776. * 设置商户系统内部的订单号,当没提供transaction_id时需要传这个。
  777. * @param string $value
  778. **/
  779. public function SetOut_trade_no($value)
  780. {
  781. $this->values['out_trade_no'] = $value;
  782. }
  783. /**
  784. * 获取商户系统内部的订单号,当没提供transaction_id时需要传这个。的值
  785. * @return 值
  786. **/
  787. public function GetOut_trade_no()
  788. {
  789. return $this->values['out_trade_no'];
  790. }
  791. /**
  792. * 判断商户系统内部的订单号,当没提供transaction_id时需要传这个。是否存在
  793. * @return true 或 false
  794. **/
  795. public function IsOut_trade_noSet()
  796. {
  797. return array_key_exists('out_trade_no', $this->values);
  798. }
  799. /**
  800. * 设置随机字符串,不长于32位。推荐随机数生成算法
  801. * @param string $value
  802. **/
  803. public function SetNonce_str($value)
  804. {
  805. $this->values['nonce_str'] = $value;
  806. }
  807. /**
  808. * 获取随机字符串,不长于32位。推荐随机数生成算法的值
  809. * @return 值
  810. **/
  811. public function GetNonce_str()
  812. {
  813. return $this->values['nonce_str'];
  814. }
  815. /**
  816. * 判断随机字符串,不长于32位。推荐随机数生成算法是否存在
  817. * @return true 或 false
  818. **/
  819. public function IsNonce_strSet()
  820. {
  821. return array_key_exists('nonce_str', $this->values);
  822. }
  823. }
  824. /**
  825. *
  826. * 关闭订单输入对象
  827. * @author widyhu
  828. *
  829. */
  830. class WxPayCloseOrder extends WxPayDataBase
  831. {
  832. /**
  833. * 设置微信分配的公众账号ID
  834. * @param string $value
  835. **/
  836. public function SetAppid($value)
  837. {
  838. $this->values['appid'] = $value;
  839. }
  840. /**
  841. * 获取微信分配的公众账号ID的值
  842. * @return 值
  843. **/
  844. public function GetAppid()
  845. {
  846. return $this->values['appid'];
  847. }
  848. /**
  849. * 判断微信分配的公众账号ID是否存在
  850. * @return true 或 false
  851. **/
  852. public function IsAppidSet()
  853. {
  854. return array_key_exists('appid', $this->values);
  855. }
  856. /**
  857. * 设置微信支付分配的商户号
  858. * @param string $value
  859. **/
  860. public function SetMch_id($value)
  861. {
  862. $this->values['mch_id'] = $value;
  863. }
  864. /**
  865. * 获取微信支付分配的商户号的值
  866. * @return 值
  867. **/
  868. public function GetMch_id()
  869. {
  870. return $this->values['mch_id'];
  871. }
  872. /**
  873. * 判断微信支付分配的商户号是否存在
  874. * @return true 或 false
  875. **/
  876. public function IsMch_idSet()
  877. {
  878. return array_key_exists('mch_id', $this->values);
  879. }
  880. /**
  881. * 设置商户系统内部的订单号
  882. * @param string $value
  883. **/
  884. public function SetOut_trade_no($value)
  885. {
  886. $this->values['out_trade_no'] = $value;
  887. }
  888. /**
  889. * 获取商户系统内部的订单号的值
  890. * @return 值
  891. **/
  892. public function GetOut_trade_no()
  893. {
  894. return $this->values['out_trade_no'];
  895. }
  896. /**
  897. * 判断商户系统内部的订单号是否存在
  898. * @return true 或 false
  899. **/
  900. public function IsOut_trade_noSet()
  901. {
  902. return array_key_exists('out_trade_no', $this->values);
  903. }
  904. /**
  905. * 设置商户系统内部的订单号,32个字符内、可包含字母, 其他说明见商户订单号
  906. * @param string $value
  907. **/
  908. public function SetNonce_str($value)
  909. {
  910. $this->values['nonce_str'] = $value;
  911. }
  912. /**
  913. * 获取商户系统内部的订单号,32个字符内、可包含字母, 其他说明见商户订单号的值
  914. * @return 值
  915. **/
  916. public function GetNonce_str()
  917. {
  918. return $this->values['nonce_str'];
  919. }
  920. /**
  921. * 判断商户系统内部的订单号,32个字符内、可包含字母, 其他说明见商户订单号是否存在
  922. * @return true 或 false
  923. **/
  924. public function IsNonce_strSet()
  925. {
  926. return array_key_exists('nonce_str', $this->values);
  927. }
  928. }
  929. /**
  930. *
  931. * 提交退款输入对象
  932. * @author widyhu
  933. *
  934. */
  935. class WxPayRefund extends WxPayDataBase
  936. {
  937. /**
  938. * 设置微信分配的公众账号ID
  939. * @param string $value
  940. **/
  941. public function SetAppid($value)
  942. {
  943. $this->values['appid'] = $value;
  944. }
  945. /**
  946. * 获取微信分配的公众账号ID的值
  947. * @return 值
  948. **/
  949. public function GetAppid()
  950. {
  951. return $this->values['appid'];
  952. }
  953. /**
  954. * 判断微信分配的公众账号ID是否存在
  955. * @return true 或 false
  956. **/
  957. public function IsAppidSet()
  958. {
  959. return array_key_exists('appid', $this->values);
  960. }
  961. /**
  962. * 设置微信支付分配的商户号
  963. * @param string $value
  964. **/
  965. public function SetMch_id($value)
  966. {
  967. $this->values['mch_id'] = $value;
  968. }
  969. /**
  970. * 获取微信支付分配的商户号的值
  971. * @return 值
  972. **/
  973. public function GetMch_id()
  974. {
  975. return $this->values['mch_id'];
  976. }
  977. /**
  978. * 判断微信支付分配的商户号是否存在
  979. * @return true 或 false
  980. **/
  981. public function IsMch_idSet()
  982. {
  983. return array_key_exists('mch_id', $this->values);
  984. }
  985. /**
  986. * 设置微信支付分配的终端设备号,与下单一致
  987. * @param string $value
  988. **/
  989. public function SetDevice_info($value)
  990. {
  991. $this->values['device_info'] = $value;
  992. }
  993. /**
  994. * 获取微信支付分配的终端设备号,与下单一致的值
  995. * @return 值
  996. **/
  997. public function GetDevice_info()
  998. {
  999. return $this->values['device_info'];
  1000. }
  1001. /**
  1002. * 判断微信支付分配的终端设备号,与下单一致是否存在
  1003. * @return true 或 false
  1004. **/
  1005. public function IsDevice_infoSet()
  1006. {
  1007. return array_key_exists('device_info', $this->values);
  1008. }
  1009. /**
  1010. * 设置随机字符串,不长于32位。推荐随机数生成算法
  1011. * @param string $value
  1012. **/
  1013. public function SetNonce_str($value)
  1014. {
  1015. $this->values['nonce_str'] = $value;
  1016. }
  1017. /**
  1018. * 获取随机字符串,不长于32位。推荐随机数生成算法的值
  1019. * @return 值
  1020. **/
  1021. public function GetNonce_str()
  1022. {
  1023. return $this->values['nonce_str'];
  1024. }
  1025. /**
  1026. * 判断随机字符串,不长于32位。推荐随机数生成算法是否存在
  1027. * @return true 或 false
  1028. **/
  1029. public function IsNonce_strSet()
  1030. {
  1031. return array_key_exists('nonce_str', $this->values);
  1032. }
  1033. /**
  1034. * 设置微信订单号
  1035. * @param string $value
  1036. **/
  1037. public function SetTransaction_id($value)
  1038. {
  1039. $this->values['transaction_id'] = $value;
  1040. }
  1041. /**
  1042. * 获取微信订单号的值
  1043. * @return 值
  1044. **/
  1045. public function GetTransaction_id()
  1046. {
  1047. return $this->values['transaction_id'];
  1048. }
  1049. /**
  1050. * 判断微信订单号是否存在
  1051. * @return true 或 false
  1052. **/
  1053. public function IsTransaction_idSet()
  1054. {
  1055. return array_key_exists('transaction_id', $this->values);
  1056. }
  1057. /**
  1058. * 设置商户系统内部的订单号,transaction_id、out_trade_no二选一,如果同时存在优先级:transaction_id> out_trade_no
  1059. * @param string $value
  1060. **/
  1061. public function SetOut_trade_no($value)
  1062. {
  1063. $this->values['out_trade_no'] = $value;
  1064. }
  1065. /**
  1066. * 获取商户系统内部的订单号,transaction_id、out_trade_no二选一,如果同时存在优先级:transaction_id> out_trade_no的值
  1067. * @return 值
  1068. **/
  1069. public function GetOut_trade_no()
  1070. {
  1071. return $this->values['out_trade_no'];
  1072. }
  1073. /**
  1074. * 判断商户系统内部的订单号,transaction_id、out_trade_no二选一,如果同时存在优先级:transaction_id> out_trade_no是否存在
  1075. * @return true 或 false
  1076. **/
  1077. public function IsOut_trade_noSet()
  1078. {
  1079. return array_key_exists('out_trade_no', $this->values);
  1080. }
  1081. /**
  1082. * 设置商户系统内部的退款单号,商户系统内部唯一,同一退款单号多次请求只退一笔
  1083. * @param string $value
  1084. **/
  1085. public function SetOut_refund_no($value)
  1086. {
  1087. $this->values['out_refund_no'] = $value;
  1088. }
  1089. /**
  1090. * 获取商户系统内部的退款单号,商户系统内部唯一,同一退款单号多次请求只退一笔的值
  1091. * @return 值
  1092. **/
  1093. public function GetOut_refund_no()
  1094. {
  1095. return $this->values['out_refund_no'];
  1096. }
  1097. /**
  1098. * 判断商户系统内部的退款单号,商户系统内部唯一,同一退款单号多次请求只退一笔是否存在
  1099. * @return true 或 false
  1100. **/
  1101. public function IsOut_refund_noSet()
  1102. {
  1103. return array_key_exists('out_refund_no', $this->values);
  1104. }
  1105. /**
  1106. * 设置订单总金额,单位为分,只能为整数,详见支付金额
  1107. * @param string $value
  1108. **/
  1109. public function SetTotal_fee($value)
  1110. {
  1111. $this->values['total_fee'] = $value;
  1112. }
  1113. /**
  1114. * 获取订单总金额,单位为分,只能为整数,详见支付金额的值
  1115. * @return 值
  1116. **/
  1117. public function GetTotal_fee()
  1118. {
  1119. return $this->values['total_fee'];
  1120. }
  1121. /**
  1122. * 判断订单总金额,单位为分,只能为整数,详见支付金额是否存在
  1123. * @return true 或 false
  1124. **/
  1125. public function IsTotal_feeSet()
  1126. {
  1127. return array_key_exists('total_fee', $this->values);
  1128. }
  1129. /**
  1130. * 设置退款总金额,订单总金额,单位为分,只能为整数,详见支付金额
  1131. * @param string $value
  1132. **/
  1133. public function SetRefund_fee($value)
  1134. {
  1135. $this->values['refund_fee'] = $value;
  1136. }
  1137. /**
  1138. * 获取退款总金额,订单总金额,单位为分,只能为整数,详见支付金额的值
  1139. * @return 值
  1140. **/
  1141. public function GetRefund_fee()
  1142. {
  1143. return $this->values['refund_fee'];
  1144. }
  1145. /**
  1146. * 判断退款总金额,订单总金额,单位为分,只能为整数,详见支付金额是否存在
  1147. * @return true 或 false
  1148. **/
  1149. public function IsRefund_feeSet()
  1150. {
  1151. return array_key_exists('refund_fee', $this->values);
  1152. }
  1153. /**
  1154. * 设置货币类型,符合ISO 4217标准的三位字母代码,默认人民币:CNY,其他值列表详见货币类型
  1155. * @param string $value
  1156. **/
  1157. public function SetRefund_fee_type($value)
  1158. {
  1159. $this->values['refund_fee_type'] = $value;
  1160. }
  1161. /**
  1162. * 获取货币类型,符合ISO 4217标准的三位字母代码,默认人民币:CNY,其他值列表详见货币类型的值
  1163. * @return 值
  1164. **/
  1165. public function GetRefund_fee_type()
  1166. {
  1167. return $this->values['refund_fee_type'];
  1168. }
  1169. /**
  1170. * 判断货币类型,符合ISO 4217标准的三位字母代码,默认人民币:CNY,其他值列表详见货币类型是否存在
  1171. * @return true 或 false
  1172. **/
  1173. public function IsRefund_fee_typeSet()
  1174. {
  1175. return array_key_exists('refund_fee_type', $this->values);
  1176. }
  1177. /**
  1178. * 设置操作员帐号, 默认为商户号
  1179. * @param string $value
  1180. **/
  1181. public function SetOp_user_id($value)
  1182. {
  1183. $this->values['op_user_id'] = $value;
  1184. }
  1185. /**
  1186. * 获取操作员帐号, 默认为商户号的值
  1187. * @return 值
  1188. **/
  1189. public function GetOp_user_id()
  1190. {
  1191. return $this->values['op_user_id'];
  1192. }
  1193. /**
  1194. * 判断操作员帐号, 默认为商户号是否存在
  1195. * @return true 或 false
  1196. **/
  1197. public function IsOp_user_idSet()
  1198. {
  1199. return array_key_exists('op_user_id', $this->values);
  1200. }
  1201. }
  1202. /**
  1203. *
  1204. * 退款查询输入对象
  1205. * @author widyhu
  1206. *
  1207. */
  1208. class WxPayRefundQuery extends WxPayDataBase
  1209. {
  1210. /**
  1211. * 设置微信分配的公众账号ID
  1212. * @param string $value
  1213. **/
  1214. public function SetAppid($value)
  1215. {
  1216. $this->values['appid'] = $value;
  1217. }
  1218. /**
  1219. * 获取微信分配的公众账号ID的值
  1220. * @return 值
  1221. **/
  1222. public function GetAppid()
  1223. {
  1224. return $this->values['appid'];
  1225. }
  1226. /**
  1227. * 判断微信分配的公众账号ID是否存在
  1228. * @return true 或 false
  1229. **/
  1230. public function IsAppidSet()
  1231. {
  1232. return array_key_exists('appid', $this->values);
  1233. }
  1234. /**
  1235. * 设置微信支付分配的商户号
  1236. * @param string $value
  1237. **/
  1238. public function SetMch_id($value)
  1239. {
  1240. $this->values['mch_id'] = $value;
  1241. }
  1242. /**
  1243. * 获取微信支付分配的商户号的值
  1244. * @return 值
  1245. **/
  1246. public function GetMch_id()
  1247. {
  1248. return $this->values['mch_id'];
  1249. }
  1250. /**
  1251. * 判断微信支付分配的商户号是否存在
  1252. * @return true 或 false
  1253. **/
  1254. public function IsMch_idSet()
  1255. {
  1256. return array_key_exists('mch_id', $this->values);
  1257. }
  1258. /**
  1259. * 设置微信支付分配的终端设备号
  1260. * @param string $value
  1261. **/
  1262. public function SetDevice_info($value)
  1263. {
  1264. $this->values['device_info'] = $value;
  1265. }
  1266. /**
  1267. * 获取微信支付分配的终端设备号的值
  1268. * @return 值
  1269. **/
  1270. public function GetDevice_info()
  1271. {
  1272. return $this->values['device_info'];
  1273. }
  1274. /**
  1275. * 判断微信支付分配的终端设备号是否存在
  1276. * @return true 或 false
  1277. **/
  1278. public function IsDevice_infoSet()
  1279. {
  1280. return array_key_exists('device_info', $this->values);
  1281. }
  1282. /**
  1283. * 设置随机字符串,不长于32位。推荐随机数生成算法
  1284. * @param string $value
  1285. **/
  1286. public function SetNonce_str($value)
  1287. {
  1288. $this->values['nonce_str'] = $value;
  1289. }
  1290. /**
  1291. * 获取随机字符串,不长于32位。推荐随机数生成算法的值
  1292. * @return 值
  1293. **/
  1294. public function GetNonce_str()
  1295. {
  1296. return $this->values['nonce_str'];
  1297. }
  1298. /**
  1299. * 判断随机字符串,不长于32位。推荐随机数生成算法是否存在
  1300. * @return true 或 false
  1301. **/
  1302. public function IsNonce_strSet()
  1303. {
  1304. return array_key_exists('nonce_str', $this->values);
  1305. }
  1306. /**
  1307. * 设置微信订单号
  1308. * @param string $value
  1309. **/
  1310. public function SetTransaction_id($value)
  1311. {
  1312. $this->values['transaction_id'] = $value;
  1313. }
  1314. /**
  1315. * 获取微信订单号的值
  1316. * @return 值
  1317. **/
  1318. public function GetTransaction_id()
  1319. {
  1320. return $this->values['transaction_id'];
  1321. }
  1322. /**
  1323. * 判断微信订单号是否存在
  1324. * @return true 或 false
  1325. **/
  1326. public function IsTransaction_idSet()
  1327. {
  1328. return array_key_exists('transaction_id', $this->values);
  1329. }
  1330. /**
  1331. * 设置商户系统内部的订单号
  1332. * @param string $value
  1333. **/
  1334. public function SetOut_trade_no($value)
  1335. {
  1336. $this->values['out_trade_no'] = $value;
  1337. }
  1338. /**
  1339. * 获取商户系统内部的订单号的值
  1340. * @return 值
  1341. **/
  1342. public function GetOut_trade_no()
  1343. {
  1344. return $this->values['out_trade_no'];
  1345. }
  1346. /**
  1347. * 判断商户系统内部的订单号是否存在
  1348. * @return true 或 false
  1349. **/
  1350. public function IsOut_trade_noSet()
  1351. {
  1352. return array_key_exists('out_trade_no', $this->values);
  1353. }
  1354. /**
  1355. * 设置商户退款单号
  1356. * @param string $value
  1357. **/
  1358. public function SetOut_refund_no($value)
  1359. {
  1360. $this->values['out_refund_no'] = $value;
  1361. }
  1362. /**
  1363. * 获取商户退款单号的值
  1364. * @return 值
  1365. **/
  1366. public function GetOut_refund_no()
  1367. {
  1368. return $this->values['out_refund_no'];
  1369. }
  1370. /**
  1371. * 判断商户退款单号是否存在
  1372. * @return true 或 false
  1373. **/
  1374. public function IsOut_refund_noSet()
  1375. {
  1376. return array_key_exists('out_refund_no', $this->values);
  1377. }
  1378. /**
  1379. * 设置微信退款单号refund_id、out_refund_no、out_trade_no、transaction_id四个参数必填一个,如果同时存在优先级为:refund_id>out_refund_no>transaction_id>out_trade_no
  1380. * @param string $value
  1381. **/
  1382. public function SetRefund_id($value)
  1383. {
  1384. $this->values['refund_id'] = $value;
  1385. }
  1386. /**
  1387. * 获取微信退款单号refund_id、out_refund_no、out_trade_no、transaction_id四个参数必填一个,如果同时存在优先级为:refund_id>out_refund_no>transaction_id>out_trade_no的值
  1388. * @return 值
  1389. **/
  1390. public function GetRefund_id()
  1391. {
  1392. return $this->values['refund_id'];
  1393. }
  1394. /**
  1395. * 判断微信退款单号refund_id、out_refund_no、out_trade_no、transaction_id四个参数必填一个,如果同时存在优先级为:refund_id>out_refund_no>transaction_id>out_trade_no是否存在
  1396. * @return true 或 false
  1397. **/
  1398. public function IsRefund_idSet()
  1399. {
  1400. return array_key_exists('refund_id', $this->values);
  1401. }
  1402. }
  1403. /**
  1404. *
  1405. * 下载对账单输入对象
  1406. * @author widyhu
  1407. *
  1408. */
  1409. class WxPayDownloadBill extends WxPayDataBase
  1410. {
  1411. /**
  1412. * 设置微信分配的公众账号ID
  1413. * @param string $value
  1414. **/
  1415. public function SetAppid($value)
  1416. {
  1417. $this->values['appid'] = $value;
  1418. }
  1419. /**
  1420. * 获取微信分配的公众账号ID的值
  1421. * @return 值
  1422. **/
  1423. public function GetAppid()
  1424. {
  1425. return $this->values['appid'];
  1426. }
  1427. /**
  1428. * 判断微信分配的公众账号ID是否存在
  1429. * @return true 或 false
  1430. **/
  1431. public function IsAppidSet()
  1432. {
  1433. return array_key_exists('appid', $this->values);
  1434. }
  1435. /**
  1436. * 设置微信支付分配的商户号
  1437. * @param string $value
  1438. **/
  1439. public function SetMch_id($value)
  1440. {
  1441. $this->values['mch_id'] = $value;
  1442. }
  1443. /**
  1444. * 获取微信支付分配的商户号的值
  1445. * @return 值
  1446. **/
  1447. public function GetMch_id()
  1448. {
  1449. return $this->values['mch_id'];
  1450. }
  1451. /**
  1452. * 判断微信支付分配的商户号是否存在
  1453. * @return true 或 false
  1454. **/
  1455. public function IsMch_idSet()
  1456. {
  1457. return array_key_exists('mch_id', $this->values);
  1458. }
  1459. /**
  1460. * 设置微信支付分配的终端设备号,填写此字段,只下载该设备号的对账单
  1461. * @param string $value
  1462. **/
  1463. public function SetDevice_info($value)
  1464. {
  1465. $this->values['device_info'] = $value;
  1466. }
  1467. /**
  1468. * 获取微信支付分配的终端设备号,填写此字段,只下载该设备号的对账单的值
  1469. * @return 值
  1470. **/
  1471. public function GetDevice_info()
  1472. {
  1473. return $this->values['device_info'];
  1474. }
  1475. /**
  1476. * 判断微信支付分配的终端设备号,填写此字段,只下载该设备号的对账单是否存在
  1477. * @return true 或 false
  1478. **/
  1479. public function IsDevice_infoSet()
  1480. {
  1481. return array_key_exists('device_info', $this->values);
  1482. }
  1483. /**
  1484. * 设置随机字符串,不长于32位。推荐随机数生成算法
  1485. * @param string $value
  1486. **/
  1487. public function SetNonce_str($value)
  1488. {
  1489. $this->values['nonce_str'] = $value;
  1490. }
  1491. /**
  1492. * 获取随机字符串,不长于32位。推荐随机数生成算法的值
  1493. * @return 值
  1494. **/
  1495. public function GetNonce_str()
  1496. {
  1497. return $this->values['nonce_str'];
  1498. }
  1499. /**
  1500. * 判断随机字符串,不长于32位。推荐随机数生成算法是否存在
  1501. * @return true 或 false
  1502. **/
  1503. public function IsNonce_strSet()
  1504. {
  1505. return array_key_exists('nonce_str', $this->values);
  1506. }
  1507. /**
  1508. * 设置下载对账单的日期,格式:20140603
  1509. * @param string $value
  1510. **/
  1511. public function SetBill_date($value)
  1512. {
  1513. $this->values['bill_date'] = $value;
  1514. }
  1515. /**
  1516. * 获取下载对账单的日期,格式:20140603的值
  1517. * @return 值
  1518. **/
  1519. public function GetBill_date()
  1520. {
  1521. return $this->values['bill_date'];
  1522. }
  1523. /**
  1524. * 判断下载对账单的日期,格式:20140603是否存在
  1525. * @return true 或 false
  1526. **/
  1527. public function IsBill_dateSet()
  1528. {
  1529. return array_key_exists('bill_date', $this->values);
  1530. }
  1531. /**
  1532. * 设置ALL,返回当日所有订单信息,默认值SUCCESS,返回当日成功支付的订单REFUND,返回当日退款订单REVOKED,已撤销的订单
  1533. * @param string $value
  1534. **/
  1535. public function SetBill_type($value)
  1536. {
  1537. $this->values['bill_type'] = $value;
  1538. }
  1539. /**
  1540. * 获取ALL,返回当日所有订单信息,默认值SUCCESS,返回当日成功支付的订单REFUND,返回当日退款订单REVOKED,已撤销的订单的值
  1541. * @return 值
  1542. **/
  1543. public function GetBill_type()
  1544. {
  1545. return $this->values['bill_type'];
  1546. }
  1547. /**
  1548. * 判断ALL,返回当日所有订单信息,默认值SUCCESS,返回当日成功支付的订单REFUND,返回当日退款订单REVOKED,已撤销的订单是否存在
  1549. * @return true 或 false
  1550. **/
  1551. public function IsBill_typeSet()
  1552. {
  1553. return array_key_exists('bill_type', $this->values);
  1554. }
  1555. }
  1556. /**
  1557. *
  1558. * 测速上报输入对象
  1559. * @author widyhu
  1560. *
  1561. */
  1562. class WxPayReport extends WxPayDataBase
  1563. {
  1564. /**
  1565. * 设置微信分配的公众账号ID
  1566. * @param string $value
  1567. **/
  1568. public function SetAppid($value)
  1569. {
  1570. $this->values['appid'] = $value;
  1571. }
  1572. /**
  1573. * 获取微信分配的公众账号ID的值
  1574. * @return 值
  1575. **/
  1576. public function GetAppid()
  1577. {
  1578. return $this->values['appid'];
  1579. }
  1580. /**
  1581. * 判断微信分配的公众账号ID是否存在
  1582. * @return true 或 false
  1583. **/
  1584. public function IsAppidSet()
  1585. {
  1586. return array_key_exists('appid', $this->values);
  1587. }
  1588. /**
  1589. * 设置微信支付分配的商户号
  1590. * @param string $value
  1591. **/
  1592. public function SetMch_id($value)
  1593. {
  1594. $this->values['mch_id'] = $value;
  1595. }
  1596. /**
  1597. * 获取微信支付分配的商户号的值
  1598. * @return 值
  1599. **/
  1600. public function GetMch_id()
  1601. {
  1602. return $this->values['mch_id'];
  1603. }
  1604. /**
  1605. * 判断微信支付分配的商户号是否存在
  1606. * @return true 或 false
  1607. **/
  1608. public function IsMch_idSet()
  1609. {
  1610. return array_key_exists('mch_id', $this->values);
  1611. }
  1612. /**
  1613. * 设置微信支付分配的终端设备号,商户自定义
  1614. * @param string $value
  1615. **/
  1616. public function SetDevice_info($value)
  1617. {
  1618. $this->values['device_info'] = $value;
  1619. }
  1620. /**
  1621. * 获取微信支付分配的终端设备号,商户自定义的值
  1622. * @return 值
  1623. **/
  1624. public function GetDevice_info()
  1625. {
  1626. return $this->values['device_info'];
  1627. }
  1628. /**
  1629. * 判断微信支付分配的终端设备号,商户自定义是否存在
  1630. * @return true 或 false
  1631. **/
  1632. public function IsDevice_infoSet()
  1633. {
  1634. return array_key_exists('device_info', $this->values);
  1635. }
  1636. /**
  1637. * 设置随机字符串,不长于32位。推荐随机数生成算法
  1638. * @param string $value
  1639. **/
  1640. public function SetNonce_str($value)
  1641. {
  1642. $this->values['nonce_str'] = $value;
  1643. }
  1644. /**
  1645. * 获取随机字符串,不长于32位。推荐随机数生成算法的值
  1646. * @return 值
  1647. **/
  1648. public function GetNonce_str()
  1649. {
  1650. return $this->values['nonce_str'];
  1651. }
  1652. /**
  1653. * 判断随机字符串,不长于32位。推荐随机数生成算法是否存在
  1654. * @return true 或 false
  1655. **/
  1656. public function IsNonce_strSet()
  1657. {
  1658. return array_key_exists('nonce_str', $this->values);
  1659. }
  1660. /**
  1661. * 设置上报对应的接口的完整URL,类似:https://api.mch.weixin.qq.com/pay/unifiedorder对于被扫支付,为更好的和商户共同分析一次业务行为的整体耗时情况,对于两种接入模式,请都在门店侧对一次被扫行为进行一次单独的整体上报,上报URL指定为:https://api.mch.weixin.qq.com/pay/micropay/total关于两种接入模式具体可参考本文档章节:被扫支付商户接入模式其它接口调用仍然按照调用一次,上报一次来进行。
  1662. * @param string $value
  1663. **/
  1664. public function SetInterface_url($value)
  1665. {
  1666. $this->values['interface_url'] = $value;
  1667. }
  1668. /**
  1669. * 获取上报对应的接口的完整URL,类似:https://api.mch.weixin.qq.com/pay/unifiedorder对于被扫支付,为更好的和商户共同分析一次业务行为的整体耗时情况,对于两种接入模式,请都在门店侧对一次被扫行为进行一次单独的整体上报,上报URL指定为:https://api.mch.weixin.qq.com/pay/micropay/total关于两种接入模式具体可参考本文档章节:被扫支付商户接入模式其它接口调用仍然按照调用一次,上报一次来进行。的值
  1670. * @return 值
  1671. **/
  1672. public function GetInterface_url()
  1673. {
  1674. return $this->values['interface_url'];
  1675. }
  1676. /**
  1677. * 判断上报对应的接口的完整URL,类似:https://api.mch.weixin.qq.com/pay/unifiedorder对于被扫支付,为更好的和商户共同分析一次业务行为的整体耗时情况,对于两种接入模式,请都在门店侧对一次被扫行为进行一次单独的整体上报,上报URL指定为:https://api.mch.weixin.qq.com/pay/micropay/total关于两种接入模式具体可参考本文档章节:被扫支付商户接入模式其它接口调用仍然按照调用一次,上报一次来进行。是否存在
  1678. * @return true 或 false
  1679. **/
  1680. public function IsInterface_urlSet()
  1681. {
  1682. return array_key_exists('interface_url', $this->values);
  1683. }
  1684. /**
  1685. * 设置接口耗时情况,单位为毫秒
  1686. * @param string $value
  1687. **/
  1688. public function SetExecute_time_($value)
  1689. {
  1690. $this->values['execute_time_'] = $value;
  1691. }
  1692. /**
  1693. * 获取接口耗时情况,单位为毫秒的值
  1694. * @return 值
  1695. **/
  1696. public function GetExecute_time_()
  1697. {
  1698. return $this->values['execute_time_'];
  1699. }
  1700. /**
  1701. * 判断接口耗时情况,单位为毫秒是否存在
  1702. * @return true 或 false
  1703. **/
  1704. public function IsExecute_time_Set()
  1705. {
  1706. return array_key_exists('execute_time_', $this->values);
  1707. }
  1708. /**
  1709. * 设置SUCCESS/FAIL此字段是通信标识,非交易标识,交易是否成功需要查看trade_state来判断
  1710. * @param string $value
  1711. **/
  1712. public function SetReturn_code($value)
  1713. {
  1714. $this->values['return_code'] = $value;
  1715. }
  1716. /**
  1717. * 获取SUCCESS/FAIL此字段是通信标识,非交易标识,交易是否成功需要查看trade_state来判断的值
  1718. * @return 值
  1719. **/
  1720. public function GetReturn_code()
  1721. {
  1722. return $this->values['return_code'];
  1723. }
  1724. /**
  1725. * 判断SUCCESS/FAIL此字段是通信标识,非交易标识,交易是否成功需要查看trade_state来判断是否存在
  1726. * @return true 或 false
  1727. **/
  1728. public function IsReturn_codeSet()
  1729. {
  1730. return array_key_exists('return_code', $this->values);
  1731. }
  1732. /**
  1733. * 设置返回信息,如非空,为错误原因签名失败参数格式校验错误
  1734. * @param string $value
  1735. **/
  1736. public function SetReturn_msg($value)
  1737. {
  1738. $this->values['return_msg'] = $value;
  1739. }
  1740. /**
  1741. * 获取返回信息,如非空,为错误原因签名失败参数格式校验错误的值
  1742. * @return 值
  1743. **/
  1744. public function GetReturn_msg()
  1745. {
  1746. return $this->values['return_msg'];
  1747. }
  1748. /**
  1749. * 判断返回信息,如非空,为错误原因签名失败参数格式校验错误是否存在
  1750. * @return true 或 false
  1751. **/
  1752. public function IsReturn_msgSet()
  1753. {
  1754. return array_key_exists('return_msg', $this->values);
  1755. }
  1756. /**
  1757. * 设置SUCCESS/FAIL
  1758. * @param string $value
  1759. **/
  1760. public function SetResult_code($value)
  1761. {
  1762. $this->values['result_code'] = $value;
  1763. }
  1764. /**
  1765. * 获取SUCCESS/FAIL的值
  1766. * @return 值
  1767. **/
  1768. public function GetResult_code()
  1769. {
  1770. return $this->values['result_code'];
  1771. }
  1772. /**
  1773. * 判断SUCCESS/FAIL是否存在
  1774. * @return true 或 false
  1775. **/
  1776. public function IsResult_codeSet()
  1777. {
  1778. return array_key_exists('result_code', $this->values);
  1779. }
  1780. /**
  1781. * 设置ORDERNOTEXIST—订单不存在SYSTEMERROR—系统错误
  1782. * @param string $value
  1783. **/
  1784. public function SetErr_code($value)
  1785. {
  1786. $this->values['err_code'] = $value;
  1787. }
  1788. /**
  1789. * 获取ORDERNOTEXIST—订单不存在SYSTEMERROR—系统错误的值
  1790. * @return 值
  1791. **/
  1792. public function GetErr_code()
  1793. {
  1794. return $this->values['err_code'];
  1795. }
  1796. /**
  1797. * 判断ORDERNOTEXIST—订单不存在SYSTEMERROR—系统错误是否存在
  1798. * @return true 或 false
  1799. **/
  1800. public function IsErr_codeSet()
  1801. {
  1802. return array_key_exists('err_code', $this->values);
  1803. }
  1804. /**
  1805. * 设置结果信息描述
  1806. * @param string $value
  1807. **/
  1808. public function SetErr_code_des($value)
  1809. {
  1810. $this->values['err_code_des'] = $value;
  1811. }
  1812. /**
  1813. * 获取结果信息描述的值
  1814. * @return 值
  1815. **/
  1816. public function GetErr_code_des()
  1817. {
  1818. return $this->values['err_code_des'];
  1819. }
  1820. /**
  1821. * 判断结果信息描述是否存在
  1822. * @return true 或 false
  1823. **/
  1824. public function IsErr_code_desSet()
  1825. {
  1826. return array_key_exists('err_code_des', $this->values);
  1827. }
  1828. /**
  1829. * 设置商户系统内部的订单号,商户可以在上报时提供相关商户订单号方便微信支付更好的提高服务质量。
  1830. * @param string $value
  1831. **/
  1832. public function SetOut_trade_no($value)
  1833. {
  1834. $this->values['out_trade_no'] = $value;
  1835. }
  1836. /**
  1837. * 获取商户系统内部的订单号,商户可以在上报时提供相关商户订单号方便微信支付更好的提高服务质量。 的值
  1838. * @return 值
  1839. **/
  1840. public function GetOut_trade_no()
  1841. {
  1842. return $this->values['out_trade_no'];
  1843. }
  1844. /**
  1845. * 判断商户系统内部的订单号,商户可以在上报时提供相关商户订单号方便微信支付更好的提高服务质量。 是否存在
  1846. * @return true 或 false
  1847. **/
  1848. public function IsOut_trade_noSet()
  1849. {
  1850. return array_key_exists('out_trade_no', $this->values);
  1851. }
  1852. /**
  1853. * 设置发起接口调用时的机器IP
  1854. * @param string $value
  1855. **/
  1856. public function SetUser_ip($value)
  1857. {
  1858. $this->values['user_ip'] = $value;
  1859. }
  1860. /**
  1861. * 获取发起接口调用时的机器IP 的值
  1862. * @return 值
  1863. **/
  1864. public function GetUser_ip()
  1865. {
  1866. return $this->values['user_ip'];
  1867. }
  1868. /**
  1869. * 判断发起接口调用时的机器IP 是否存在
  1870. * @return true 或 false
  1871. **/
  1872. public function IsUser_ipSet()
  1873. {
  1874. return array_key_exists('user_ip', $this->values);
  1875. }
  1876. /**
  1877. * 设置系统时间,格式为yyyyMMddHHmmss,如2009年12月27日9点10分10秒表示为20091227091010。其他详见时间规则
  1878. * @param string $value
  1879. **/
  1880. public function SetTime($value)
  1881. {
  1882. $this->values['time'] = $value;
  1883. }
  1884. /**
  1885. * 获取系统时间,格式为yyyyMMddHHmmss,如2009年12月27日9点10分10秒表示为20091227091010。其他详见时间规则的值
  1886. * @return 值
  1887. **/
  1888. public function GetTime()
  1889. {
  1890. return $this->values['time'];
  1891. }
  1892. /**
  1893. * 判断系统时间,格式为yyyyMMddHHmmss,如2009年12月27日9点10分10秒表示为20091227091010。其他详见时间规则是否存在
  1894. * @return true 或 false
  1895. **/
  1896. public function IsTimeSet()
  1897. {
  1898. return array_key_exists('time', $this->values);
  1899. }
  1900. }
  1901. /**
  1902. *
  1903. * 短链转换输入对象
  1904. * @author widyhu
  1905. *
  1906. */
  1907. class WxPayShortUrl extends WxPayDataBase
  1908. {
  1909. /**
  1910. * 设置微信分配的公众账号ID
  1911. * @param string $value
  1912. **/
  1913. public function SetAppid($value)
  1914. {
  1915. $this->values['appid'] = $value;
  1916. }
  1917. /**
  1918. * 获取微信分配的公众账号ID的值
  1919. * @return 值
  1920. **/
  1921. public function GetAppid()
  1922. {
  1923. return $this->values['appid'];
  1924. }
  1925. /**
  1926. * 判断微信分配的公众账号ID是否存在
  1927. * @return true 或 false
  1928. **/
  1929. public function IsAppidSet()
  1930. {
  1931. return array_key_exists('appid', $this->values);
  1932. }
  1933. /**
  1934. * 设置微信支付分配的商户号
  1935. * @param string $value
  1936. **/
  1937. public function SetMch_id($value)
  1938. {
  1939. $this->values['mch_id'] = $value;
  1940. }
  1941. /**
  1942. * 获取微信支付分配的商户号的值
  1943. * @return 值
  1944. **/
  1945. public function GetMch_id()
  1946. {
  1947. return $this->values['mch_id'];
  1948. }
  1949. /**
  1950. * 判断微信支付分配的商户号是否存在
  1951. * @return true 或 false
  1952. **/
  1953. public function IsMch_idSet()
  1954. {
  1955. return array_key_exists('mch_id', $this->values);
  1956. }
  1957. /**
  1958. * 设置需要转换的URL,签名用原串,传输需URL encode
  1959. * @param string $value
  1960. **/
  1961. public function SetLong_url($value)
  1962. {
  1963. $this->values['long_url'] = $value;
  1964. }
  1965. /**
  1966. * 获取需要转换的URL,签名用原串,传输需URL encode的值
  1967. * @return 值
  1968. **/
  1969. public function GetLong_url()
  1970. {
  1971. return $this->values['long_url'];
  1972. }
  1973. /**
  1974. * 判断需要转换的URL,签名用原串,传输需URL encode是否存在
  1975. * @return true 或 false
  1976. **/
  1977. public function IsLong_urlSet()
  1978. {
  1979. return array_key_exists('long_url', $this->values);
  1980. }
  1981. /**
  1982. * 设置随机字符串,不长于32位。推荐随机数生成算法
  1983. * @param string $value
  1984. **/
  1985. public function SetNonce_str($value)
  1986. {
  1987. $this->values['nonce_str'] = $value;
  1988. }
  1989. /**
  1990. * 获取随机字符串,不长于32位。推荐随机数生成算法的值
  1991. * @return 值
  1992. **/
  1993. public function GetNonce_str()
  1994. {
  1995. return $this->values['nonce_str'];
  1996. }
  1997. /**
  1998. * 判断随机字符串,不长于32位。推荐随机数生成算法是否存在
  1999. * @return true 或 false
  2000. **/
  2001. public function IsNonce_strSet()
  2002. {
  2003. return array_key_exists('nonce_str', $this->values);
  2004. }
  2005. }
  2006. /**
  2007. *
  2008. * 提交被扫输入对象
  2009. * @author widyhu
  2010. *
  2011. */
  2012. class WxPayMicroPay extends WxPayDataBase
  2013. {
  2014. /**
  2015. * 设置微信分配的公众账号ID
  2016. * @param string $value
  2017. **/
  2018. public function SetAppid($value)
  2019. {
  2020. $this->values['appid'] = $value;
  2021. }
  2022. /**
  2023. * 获取微信分配的公众账号ID的值
  2024. * @return 值
  2025. **/
  2026. public function GetAppid()
  2027. {
  2028. return $this->values['appid'];
  2029. }
  2030. /**
  2031. * 判断微信分配的公众账号ID是否存在
  2032. * @return true 或 false
  2033. **/
  2034. public function IsAppidSet()
  2035. {
  2036. return array_key_exists('appid', $this->values);
  2037. }
  2038. /**
  2039. * 设置微信支付分配的商户号
  2040. * @param string $value
  2041. **/
  2042. public function SetMch_id($value)
  2043. {
  2044. $this->values['mch_id'] = $value;
  2045. }
  2046. /**
  2047. * 获取微信支付分配的商户号的值
  2048. * @return 值
  2049. **/
  2050. public function GetMch_id()
  2051. {
  2052. return $this->values['mch_id'];
  2053. }
  2054. /**
  2055. * 判断微信支付分配的商户号是否存在
  2056. * @return true 或 false
  2057. **/
  2058. public function IsMch_idSet()
  2059. {
  2060. return array_key_exists('mch_id', $this->values);
  2061. }
  2062. /**
  2063. * 设置终端设备号(商户自定义,如门店编号)
  2064. * @param string $value
  2065. **/
  2066. public function SetDevice_info($value)
  2067. {
  2068. $this->values['device_info'] = $value;
  2069. }
  2070. /**
  2071. * 获取终端设备号(商户自定义,如门店编号)的值
  2072. * @return 值
  2073. **/
  2074. public function GetDevice_info()
  2075. {
  2076. return $this->values['device_info'];
  2077. }
  2078. /**
  2079. * 判断终端设备号(商户自定义,如门店编号)是否存在
  2080. * @return true 或 false
  2081. **/
  2082. public function IsDevice_infoSet()
  2083. {
  2084. return array_key_exists('device_info', $this->values);
  2085. }
  2086. /**
  2087. * 设置随机字符串,不长于32位。推荐随机数生成算法
  2088. * @param string $value
  2089. **/
  2090. public function SetNonce_str($value)
  2091. {
  2092. $this->values['nonce_str'] = $value;
  2093. }
  2094. /**
  2095. * 获取随机字符串,不长于32位。推荐随机数生成算法的值
  2096. * @return 值
  2097. **/
  2098. public function GetNonce_str()
  2099. {
  2100. return $this->values['nonce_str'];
  2101. }
  2102. /**
  2103. * 判断随机字符串,不长于32位。推荐随机数生成算法是否存在
  2104. * @return true 或 false
  2105. **/
  2106. public function IsNonce_strSet()
  2107. {
  2108. return array_key_exists('nonce_str', $this->values);
  2109. }
  2110. /**
  2111. * 设置商品或支付单简要描述
  2112. * @param string $value
  2113. **/
  2114. public function SetBody($value)
  2115. {
  2116. $this->values['body'] = $value;
  2117. }
  2118. /**
  2119. * 获取商品或支付单简要描述的值
  2120. * @return 值
  2121. **/
  2122. public function GetBody()
  2123. {
  2124. return $this->values['body'];
  2125. }
  2126. /**
  2127. * 判断商品或支付单简要描述是否存在
  2128. * @return true 或 false
  2129. **/
  2130. public function IsBodySet()
  2131. {
  2132. return array_key_exists('body', $this->values);
  2133. }
  2134. /**
  2135. * 设置商品名称明细列表
  2136. * @param string $value
  2137. **/
  2138. public function SetDetail($value)
  2139. {
  2140. $this->values['detail'] = $value;
  2141. }
  2142. /**
  2143. * 获取商品名称明细列表的值
  2144. * @return 值
  2145. **/
  2146. public function GetDetail()
  2147. {
  2148. return $this->values['detail'];
  2149. }
  2150. /**
  2151. * 判断商品名称明细列表是否存在
  2152. * @return true 或 false
  2153. **/
  2154. public function IsDetailSet()
  2155. {
  2156. return array_key_exists('detail', $this->values);
  2157. }
  2158. /**
  2159. * 设置附加数据,在查询API和支付通知中原样返回,该字段主要用于商户携带订单的自定义数据
  2160. * @param string $value
  2161. **/
  2162. public function SetAttach($value)
  2163. {
  2164. $this->values['attach'] = $value;
  2165. }
  2166. /**
  2167. * 获取附加数据,在查询API和支付通知中原样返回,该字段主要用于商户携带订单的自定义数据的值
  2168. * @return 值
  2169. **/
  2170. public function GetAttach()
  2171. {
  2172. return $this->values['attach'];
  2173. }
  2174. /**
  2175. * 判断附加数据,在查询API和支付通知中原样返回,该字段主要用于商户携带订单的自定义数据是否存在
  2176. * @return true 或 false
  2177. **/
  2178. public function IsAttachSet()
  2179. {
  2180. return array_key_exists('attach', $this->values);
  2181. }
  2182. /**
  2183. * 设置商户系统内部的订单号,32个字符内、可包含字母, 其他说明见商户订单号
  2184. * @param string $value
  2185. **/
  2186. public function SetOut_trade_no($value)
  2187. {
  2188. $this->values['out_trade_no'] = $value;
  2189. }
  2190. /**
  2191. * 获取商户系统内部的订单号,32个字符内、可包含字母, 其他说明见商户订单号的值
  2192. * @return 值
  2193. **/
  2194. public function GetOut_trade_no()
  2195. {
  2196. return $this->values['out_trade_no'];
  2197. }
  2198. /**
  2199. * 判断商户系统内部的订单号,32个字符内、可包含字母, 其他说明见商户订单号是否存在
  2200. * @return true 或 false
  2201. **/
  2202. public function IsOut_trade_noSet()
  2203. {
  2204. return array_key_exists('out_trade_no', $this->values);
  2205. }
  2206. /**
  2207. * 设置订单总金额,单位为分,只能为整数,详见支付金额
  2208. * @param string $value
  2209. **/
  2210. public function SetTotal_fee($value)
  2211. {
  2212. $this->values['total_fee'] = $value;
  2213. }
  2214. /**
  2215. * 获取订单总金额,单位为分,只能为整数,详见支付金额的值
  2216. * @return 值
  2217. **/
  2218. public function GetTotal_fee()
  2219. {
  2220. return $this->values['total_fee'];
  2221. }
  2222. /**
  2223. * 判断订单总金额,单位为分,只能为整数,详见支付金额是否存在
  2224. * @return true 或 false
  2225. **/
  2226. public function IsTotal_feeSet()
  2227. {
  2228. return array_key_exists('total_fee', $this->values);
  2229. }
  2230. /**
  2231. * 设置符合ISO 4217标准的三位字母代码,默认人民币:CNY,其他值列表详见货币类型
  2232. * @param string $value
  2233. **/
  2234. public function SetFee_type($value)
  2235. {
  2236. $this->values['fee_type'] = $value;
  2237. }
  2238. /**
  2239. * 获取符合ISO 4217标准的三位字母代码,默认人民币:CNY,其他值列表详见货币类型的值
  2240. * @return 值
  2241. **/
  2242. public function GetFee_type()
  2243. {
  2244. return $this->values['fee_type'];
  2245. }
  2246. /**
  2247. * 判断符合ISO 4217标准的三位字母代码,默认人民币:CNY,其他值列表详见货币类型是否存在
  2248. * @return true 或 false
  2249. **/
  2250. public function IsFee_typeSet()
  2251. {
  2252. return array_key_exists('fee_type', $this->values);
  2253. }
  2254. /**
  2255. * 设置调用微信支付API的机器IP
  2256. * @param string $value
  2257. **/
  2258. public function SetSpbill_create_ip($value)
  2259. {
  2260. $this->values['spbill_create_ip'] = $value;
  2261. }
  2262. /**
  2263. * 获取调用微信支付API的机器IP 的值
  2264. * @return 值
  2265. **/
  2266. public function GetSpbill_create_ip()
  2267. {
  2268. return $this->values['spbill_create_ip'];
  2269. }
  2270. /**
  2271. * 判断调用微信支付API的机器IP 是否存在
  2272. * @return true 或 false
  2273. **/
  2274. public function IsSpbill_create_ipSet()
  2275. {
  2276. return array_key_exists('spbill_create_ip', $this->values);
  2277. }
  2278. /**
  2279. * 设置订单生成时间,格式为yyyyMMddHHmmss,如2009年12月25日9点10分10秒表示为20091225091010。详见时间规则
  2280. * @param string $value
  2281. **/
  2282. public function SetTime_start($value)
  2283. {
  2284. $this->values['time_start'] = $value;
  2285. }
  2286. /**
  2287. * 获取订单生成时间,格式为yyyyMMddHHmmss,如2009年12月25日9点10分10秒表示为20091225091010。详见时间规则的值
  2288. * @return 值
  2289. **/
  2290. public function GetTime_start()
  2291. {
  2292. return $this->values['time_start'];
  2293. }
  2294. /**
  2295. * 判断订单生成时间,格式为yyyyMMddHHmmss,如2009年12月25日9点10分10秒表示为20091225091010。详见时间规则是否存在
  2296. * @return true 或 false
  2297. **/
  2298. public function IsTime_startSet()
  2299. {
  2300. return array_key_exists('time_start', $this->values);
  2301. }
  2302. /**
  2303. * 设置订单失效时间,格式为yyyyMMddHHmmss,如2009年12月27日9点10分10秒表示为20091227091010。详见时间规则
  2304. * @param string $value
  2305. **/
  2306. public function SetTime_expire($value)
  2307. {
  2308. $this->values['time_expire'] = $value;
  2309. }
  2310. /**
  2311. * 获取订单失效时间,格式为yyyyMMddHHmmss,如2009年12月27日9点10分10秒表示为20091227091010。详见时间规则的值
  2312. * @return 值
  2313. **/
  2314. public function GetTime_expire()
  2315. {
  2316. return $this->values['time_expire'];
  2317. }
  2318. /**
  2319. * 判断订单失效时间,格式为yyyyMMddHHmmss,如2009年12月27日9点10分10秒表示为20091227091010。详见时间规则是否存在
  2320. * @return true 或 false
  2321. **/
  2322. public function IsTime_expireSet()
  2323. {
  2324. return array_key_exists('time_expire', $this->values);
  2325. }
  2326. /**
  2327. * 设置商品标记,代金券或立减优惠功能的参数,说明详见代金券或立减优惠
  2328. * @param string $value
  2329. **/
  2330. public function SetGoods_tag($value)
  2331. {
  2332. $this->values['goods_tag'] = $value;
  2333. }
  2334. /**
  2335. * 获取商品标记,代金券或立减优惠功能的参数,说明详见代金券或立减优惠的值
  2336. * @return 值
  2337. **/
  2338. public function GetGoods_tag()
  2339. {
  2340. return $this->values['goods_tag'];
  2341. }
  2342. /**
  2343. * 判断商品标记,代金券或立减优惠功能的参数,说明详见代金券或立减优惠是否存在
  2344. * @return true 或 false
  2345. **/
  2346. public function IsGoods_tagSet()
  2347. {
  2348. return array_key_exists('goods_tag', $this->values);
  2349. }
  2350. /**
  2351. * 设置扫码支付授权码,设备读取用户微信中的条码或者二维码信息
  2352. * @param string $value
  2353. **/
  2354. public function SetAuth_code($value)
  2355. {
  2356. $this->values['auth_code'] = $value;
  2357. }
  2358. /**
  2359. * 获取扫码支付授权码,设备读取用户微信中的条码或者二维码信息的值
  2360. * @return 值
  2361. **/
  2362. public function GetAuth_code()
  2363. {
  2364. return $this->values['auth_code'];
  2365. }
  2366. /**
  2367. * 判断扫码支付授权码,设备读取用户微信中的条码或者二维码信息是否存在
  2368. * @return true 或 false
  2369. **/
  2370. public function IsAuth_codeSet()
  2371. {
  2372. return array_key_exists('auth_code', $this->values);
  2373. }
  2374. }
  2375. /**
  2376. *
  2377. * 撤销输入对象
  2378. * @author widyhu
  2379. *
  2380. */
  2381. class WxPayReverse extends WxPayDataBase
  2382. {
  2383. /**
  2384. * 设置微信分配的公众账号ID
  2385. * @param string $value
  2386. **/
  2387. public function SetAppid($value)
  2388. {
  2389. $this->values['appid'] = $value;
  2390. }
  2391. /**
  2392. * 获取微信分配的公众账号ID的值
  2393. * @return 值
  2394. **/
  2395. public function GetAppid()
  2396. {
  2397. return $this->values['appid'];
  2398. }
  2399. /**
  2400. * 判断微信分配的公众账号ID是否存在
  2401. * @return true 或 false
  2402. **/
  2403. public function IsAppidSet()
  2404. {
  2405. return array_key_exists('appid', $this->values);
  2406. }
  2407. /**
  2408. * 设置微信支付分配的商户号
  2409. * @param string $value
  2410. **/
  2411. public function SetMch_id($value)
  2412. {
  2413. $this->values['mch_id'] = $value;
  2414. }
  2415. /**
  2416. * 获取微信支付分配的商户号的值
  2417. * @return 值
  2418. **/
  2419. public function GetMch_id()
  2420. {
  2421. return $this->values['mch_id'];
  2422. }
  2423. /**
  2424. * 判断微信支付分配的商户号是否存在
  2425. * @return true 或 false
  2426. **/
  2427. public function IsMch_idSet()
  2428. {
  2429. return array_key_exists('mch_id', $this->values);
  2430. }
  2431. /**
  2432. * 设置微信的订单号,优先使用
  2433. * @param string $value
  2434. **/
  2435. public function SetTransaction_id($value)
  2436. {
  2437. $this->values['transaction_id'] = $value;
  2438. }
  2439. /**
  2440. * 获取微信的订单号,优先使用的值
  2441. * @return 值
  2442. **/
  2443. public function GetTransaction_id()
  2444. {
  2445. return $this->values['transaction_id'];
  2446. }
  2447. /**
  2448. * 判断微信的订单号,优先使用是否存在
  2449. * @return true 或 false
  2450. **/
  2451. public function IsTransaction_idSet()
  2452. {
  2453. return array_key_exists('transaction_id', $this->values);
  2454. }
  2455. /**
  2456. * 设置商户系统内部的订单号,transaction_id、out_trade_no二选一,如果同时存在优先级:transaction_id> out_trade_no
  2457. * @param string $value
  2458. **/
  2459. public function SetOut_trade_no($value)
  2460. {
  2461. $this->values['out_trade_no'] = $value;
  2462. }
  2463. /**
  2464. * 获取商户系统内部的订单号,transaction_id、out_trade_no二选一,如果同时存在优先级:transaction_id> out_trade_no的值
  2465. * @return 值
  2466. **/
  2467. public function GetOut_trade_no()
  2468. {
  2469. return $this->values['out_trade_no'];
  2470. }
  2471. /**
  2472. * 判断商户系统内部的订单号,transaction_id、out_trade_no二选一,如果同时存在优先级:transaction_id> out_trade_no是否存在
  2473. * @return true 或 false
  2474. **/
  2475. public function IsOut_trade_noSet()
  2476. {
  2477. return array_key_exists('out_trade_no', $this->values);
  2478. }
  2479. /**
  2480. * 设置随机字符串,不长于32位。推荐随机数生成算法
  2481. * @param string $value
  2482. **/
  2483. public function SetNonce_str($value)
  2484. {
  2485. $this->values['nonce_str'] = $value;
  2486. }
  2487. /**
  2488. * 获取随机字符串,不长于32位。推荐随机数生成算法的值
  2489. * @return 值
  2490. **/
  2491. public function GetNonce_str()
  2492. {
  2493. return $this->values['nonce_str'];
  2494. }
  2495. /**
  2496. * 判断随机字符串,不长于32位。推荐随机数生成算法是否存在
  2497. * @return true 或 false
  2498. **/
  2499. public function IsNonce_strSet()
  2500. {
  2501. return array_key_exists('nonce_str', $this->values);
  2502. }
  2503. }
  2504. /**
  2505. *
  2506. * 提交JSAPI输入对象
  2507. * @author widyhu
  2508. *
  2509. */
  2510. class WxPayJsApiPay extends WxPayDataBase
  2511. {
  2512. /**
  2513. * 设置微信分配的公众账号ID
  2514. * @param string $value
  2515. **/
  2516. public function SetAppid($value)
  2517. {
  2518. $this->values['appId'] = $value;
  2519. }
  2520. /**
  2521. * 获取微信分配的公众账号ID的值
  2522. * @return 值
  2523. **/
  2524. public function GetAppid()
  2525. {
  2526. return $this->values['appId'];
  2527. }
  2528. /**
  2529. * 判断微信分配的公众账号ID是否存在
  2530. * @return true 或 false
  2531. **/
  2532. public function IsAppidSet()
  2533. {
  2534. return array_key_exists('appId', $this->values);
  2535. }
  2536. /**
  2537. * 设置支付时间戳
  2538. * @param string $value
  2539. **/
  2540. public function SetTimeStamp($value)
  2541. {
  2542. $this->values['timeStamp'] = $value;
  2543. }
  2544. /**
  2545. * 获取支付时间戳的值
  2546. * @return 值
  2547. **/
  2548. public function GetTimeStamp()
  2549. {
  2550. return $this->values['timeStamp'];
  2551. }
  2552. /**
  2553. * 判断支付时间戳是否存在
  2554. * @return true 或 false
  2555. **/
  2556. public function IsTimeStampSet()
  2557. {
  2558. return array_key_exists('timeStamp', $this->values);
  2559. }
  2560. /**
  2561. * 随机字符串
  2562. * @param string $value
  2563. **/
  2564. public function SetNonceStr($value)
  2565. {
  2566. $this->values['nonceStr'] = $value;
  2567. }
  2568. /**
  2569. * 获取notify随机字符串值
  2570. * @return 值
  2571. **/
  2572. public function GetReturn_code()
  2573. {
  2574. return $this->values['nonceStr'];
  2575. }
  2576. /**
  2577. * 判断随机字符串是否存在
  2578. * @return true 或 false
  2579. **/
  2580. public function IsReturn_codeSet()
  2581. {
  2582. return array_key_exists('nonceStr', $this->values);
  2583. }
  2584. /**
  2585. * 设置订单详情扩展字符串
  2586. * @param string $value
  2587. **/
  2588. public function SetPackage($value)
  2589. {
  2590. $this->values['package'] = $value;
  2591. }
  2592. /**
  2593. * 获取订单详情扩展字符串的值
  2594. * @return 值
  2595. **/
  2596. public function GetPackage()
  2597. {
  2598. return $this->values['package'];
  2599. }
  2600. /**
  2601. * 判断订单详情扩展字符串是否存在
  2602. * @return true 或 false
  2603. **/
  2604. public function IsPackageSet()
  2605. {
  2606. return array_key_exists('package', $this->values);
  2607. }
  2608. /**
  2609. * 设置签名方式
  2610. * @param string $value
  2611. **/
  2612. public function SetSignType($value)
  2613. {
  2614. $this->values['signType'] = $value;
  2615. }
  2616. /**
  2617. * 获取签名方式
  2618. * @return 值
  2619. **/
  2620. public function GetSignType()
  2621. {
  2622. return $this->values['signType'];
  2623. }
  2624. /**
  2625. * 判断签名方式是否存在
  2626. * @return true 或 false
  2627. **/
  2628. public function IsSignTypeSet()
  2629. {
  2630. return array_key_exists('signType', $this->values);
  2631. }
  2632. /**
  2633. * 设置签名方式
  2634. * @param string $value
  2635. **/
  2636. public function SetPaySign($value)
  2637. {
  2638. $this->values['paySign'] = $value;
  2639. }
  2640. /**
  2641. * 获取签名方式
  2642. * @return 值
  2643. **/
  2644. public function GetPaySign()
  2645. {
  2646. return $this->values['paySign'];
  2647. }
  2648. /**
  2649. * 判断签名方式是否存在
  2650. * @return true 或 false
  2651. **/
  2652. public function IsPaySignSet()
  2653. {
  2654. return array_key_exists('paySign', $this->values);
  2655. }
  2656. }
  2657. /**
  2658. *
  2659. * 扫码支付模式一生成二维码参数
  2660. * @author widyhu
  2661. *
  2662. */
  2663. class WxPayBizPayUrl extends WxPayDataBase
  2664. {
  2665. /**
  2666. * 设置微信分配的公众账号ID
  2667. * @param string $value
  2668. **/
  2669. public function SetAppid($value)
  2670. {
  2671. $this->values['appid'] = $value;
  2672. }
  2673. /**
  2674. * 获取微信分配的公众账号ID的值
  2675. * @return 值
  2676. **/
  2677. public function GetAppid()
  2678. {
  2679. return $this->values['appid'];
  2680. }
  2681. /**
  2682. * 判断微信分配的公众账号ID是否存在
  2683. * @return true 或 false
  2684. **/
  2685. public function IsAppidSet()
  2686. {
  2687. return array_key_exists('appid', $this->values);
  2688. }
  2689. /**
  2690. * 设置微信支付分配的商户号
  2691. * @param string $value
  2692. **/
  2693. public function SetMch_id($value)
  2694. {
  2695. $this->values['mch_id'] = $value;
  2696. }
  2697. /**
  2698. * 获取微信支付分配的商户号的值
  2699. * @return 值
  2700. **/
  2701. public function GetMch_id()
  2702. {
  2703. return $this->values['mch_id'];
  2704. }
  2705. /**
  2706. * 判断微信支付分配的商户号是否存在
  2707. * @return true 或 false
  2708. **/
  2709. public function IsMch_idSet()
  2710. {
  2711. return array_key_exists('mch_id', $this->values);
  2712. }
  2713. /**
  2714. * 设置支付时间戳
  2715. * @param string $value
  2716. **/
  2717. public function SetTime_stamp($value)
  2718. {
  2719. $this->values['time_stamp'] = $value;
  2720. }
  2721. /**
  2722. * 获取支付时间戳的值
  2723. * @return 值
  2724. **/
  2725. public function GetTime_stamp()
  2726. {
  2727. return $this->values['time_stamp'];
  2728. }
  2729. /**
  2730. * 判断支付时间戳是否存在
  2731. * @return true 或 false
  2732. **/
  2733. public function IsTime_stampSet()
  2734. {
  2735. return array_key_exists('time_stamp', $this->values);
  2736. }
  2737. /**
  2738. * 设置随机字符串
  2739. * @param string $value
  2740. **/
  2741. public function SetNonce_str($value)
  2742. {
  2743. $this->values['nonce_str'] = $value;
  2744. }
  2745. /**
  2746. * 获取随机字符串的值
  2747. * @return 值
  2748. **/
  2749. public function GetNonce_str()
  2750. {
  2751. return $this->values['nonce_str'];
  2752. }
  2753. /**
  2754. * 判断随机字符串是否存在
  2755. * @return true 或 false
  2756. **/
  2757. public function IsNonce_strSet()
  2758. {
  2759. return array_key_exists('nonce_str', $this->values);
  2760. }
  2761. /**
  2762. * 设置商品ID
  2763. * @param string $value
  2764. **/
  2765. public function SetProduct_id($value)
  2766. {
  2767. $this->values['product_id'] = $value;
  2768. }
  2769. /**
  2770. * 获取商品ID的值
  2771. * @return 值
  2772. **/
  2773. public function GetProduct_id()
  2774. {
  2775. return $this->values['product_id'];
  2776. }
  2777. /**
  2778. * 判断商品ID是否存在
  2779. * @return true 或 false
  2780. **/
  2781. public function IsProduct_idSet()
  2782. {
  2783. return array_key_exists('product_id', $this->values);
  2784. }
  2785. }