WxPay.Data.php 64 KB

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