WxPay.Data.php 29 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735
  1. <?php
  2. class WxPayDataBase
  3. {
  4. protected $values = array();
  5. public function SetSign()
  6. {
  7. $sign = $this->MakeSign();
  8. $this->values['sign'] = $sign;
  9. return $sign;
  10. }
  11. public function GetSign()
  12. {
  13. return $this->values['sign'];
  14. }
  15. public function IsSignSet()
  16. {
  17. return array_key_exists('sign', $this->values);
  18. }
  19. public function ToXml()
  20. {
  21. if (!is_array($this->values) || count($this->values) <= 0) {
  22. throw new WxPayException('数组数据异常!');
  23. }
  24. $xml = '<xml>';
  25. foreach ($this->values as $key => $val) {
  26. if (is_numeric($val)) {
  27. $xml .= '<' . $key . '>' . $val . '</' . $key . '>';
  28. }
  29. else {
  30. $xml .= '<' . $key . '><![CDATA[' . $val . ']]></' . $key . '>';
  31. }
  32. }
  33. $xml .= '</xml>';
  34. return $xml;
  35. }
  36. public function FromXml($xml)
  37. {
  38. if (!$xml) {
  39. throw new WxPayException('xml数据异常!');
  40. }
  41. $this->values = json_decode(json_encode(simplexml_load_string($xml, 'SimpleXMLElement', LIBXML_NOCDATA)), true);
  42. return $this->values;
  43. }
  44. public function ToUrlParams()
  45. {
  46. $buff = '';
  47. foreach ($this->values as $k => $v) {
  48. if ($k != 'sign' && $v != '' && !is_array($v)) {
  49. $buff .= $k . '=' . $v . '&';
  50. }
  51. }
  52. $buff = trim($buff, '&');
  53. return $buff;
  54. }
  55. public function MakeSign()
  56. {
  57. ksort($this->values);
  58. $string = $this->ToUrlParams();
  59. $string = $string . '&key=' . WxPayConfig::$KEY;
  60. $string = md5($string);
  61. $result = strtoupper($string);
  62. return $result;
  63. }
  64. public function GetValues()
  65. {
  66. return $this->values;
  67. }
  68. }
  69. class WxPayResults extends WxPayDataBase
  70. {
  71. public function CheckSign()
  72. {
  73. if (!$this->IsSignSet()) {
  74. throw new WxPayException('签名错误!');
  75. }
  76. $sign = $this->MakeSign();
  77. if ($this->GetSign() == $sign) {
  78. return true;
  79. }
  80. throw new WxPayException('签名错误!');
  81. }
  82. public function FromArray($array)
  83. {
  84. $this->values = $array;
  85. }
  86. static public function InitFromArray($array, $noCheckSign = false)
  87. {
  88. $obj = new self();
  89. $obj->FromArray($array);
  90. if ($noCheckSign == false) {
  91. $obj->CheckSign();
  92. }
  93. return $obj;
  94. }
  95. public function SetData($key, $value)
  96. {
  97. $this->values[$key] = $value;
  98. }
  99. static public function Init($xml)
  100. {
  101. $obj = new self();
  102. $obj->FromXml($xml);
  103. if ($obj->values['return_code'] != 'SUCCESS') {
  104. return $obj->GetValues();
  105. }
  106. $obj->CheckSign();
  107. return $obj->GetValues();
  108. }
  109. }
  110. class WxPayNotifyReply extends WxPayDataBase
  111. {
  112. public function SetReturn_code($return_code)
  113. {
  114. $this->values['return_code'] = $return_code;
  115. }
  116. public function GetReturn_code()
  117. {
  118. return $this->values['return_code'];
  119. }
  120. public function SetReturn_msg($return_msg)
  121. {
  122. $this->values['return_msg'] = $return_msg;
  123. }
  124. public function GetReturn_msg()
  125. {
  126. return $this->values['return_msg'];
  127. }
  128. public function SetData($key, $value)
  129. {
  130. $this->values[$key] = $value;
  131. }
  132. }
  133. class WxPayUnifiedOrder extends WxPayDataBase
  134. {
  135. public function SetAppid($value)
  136. {
  137. $this->values['appid'] = $value;
  138. }
  139. public function GetAppid()
  140. {
  141. return $this->values['appid'];
  142. }
  143. public function IsAppidSet()
  144. {
  145. return array_key_exists('appid', $this->values);
  146. }
  147. public function SetMch_id($value)
  148. {
  149. $this->values['mch_id'] = $value;
  150. }
  151. public function GetMch_id()
  152. {
  153. return $this->values['mch_id'];
  154. }
  155. public function IsMch_idSet()
  156. {
  157. return array_key_exists('mch_id', $this->values);
  158. }
  159. public function SetDevice_info($value)
  160. {
  161. $this->values['device_info'] = $value;
  162. }
  163. public function GetDevice_info()
  164. {
  165. return $this->values['device_info'];
  166. }
  167. public function IsDevice_infoSet()
  168. {
  169. return array_key_exists('device_info', $this->values);
  170. }
  171. public function SetNonce_str($value)
  172. {
  173. $this->values['nonce_str'] = $value;
  174. }
  175. public function GetNonce_str()
  176. {
  177. return $this->values['nonce_str'];
  178. }
  179. public function IsNonce_strSet()
  180. {
  181. return array_key_exists('nonce_str', $this->values);
  182. }
  183. public function SetBody($value)
  184. {
  185. $this->values['body'] = $value;
  186. }
  187. public function GetBody()
  188. {
  189. return $this->values['body'];
  190. }
  191. public function IsBodySet()
  192. {
  193. return array_key_exists('body', $this->values);
  194. }
  195. public function SetDetail($value)
  196. {
  197. $this->values['detail'] = $value;
  198. }
  199. public function GetDetail()
  200. {
  201. return $this->values['detail'];
  202. }
  203. public function IsDetailSet()
  204. {
  205. return array_key_exists('detail', $this->values);
  206. }
  207. public function SetAttach($value)
  208. {
  209. $this->values['attach'] = $value;
  210. }
  211. public function GetAttach()
  212. {
  213. return $this->values['attach'];
  214. }
  215. public function IsAttachSet()
  216. {
  217. return array_key_exists('attach', $this->values);
  218. }
  219. public function SetOut_trade_no($value)
  220. {
  221. $this->values['out_trade_no'] = $value;
  222. }
  223. public function GetOut_trade_no()
  224. {
  225. return $this->values['out_trade_no'];
  226. }
  227. public function IsOut_trade_noSet()
  228. {
  229. return array_key_exists('out_trade_no', $this->values);
  230. }
  231. public function SetFee_type($value)
  232. {
  233. $this->values['fee_type'] = $value;
  234. }
  235. public function GetFee_type()
  236. {
  237. return $this->values['fee_type'];
  238. }
  239. public function IsFee_typeSet()
  240. {
  241. return array_key_exists('fee_type', $this->values);
  242. }
  243. public function SetTotal_fee($value)
  244. {
  245. $this->values['total_fee'] = $value;
  246. }
  247. public function GetTotal_fee()
  248. {
  249. return $this->values['total_fee'];
  250. }
  251. public function IsTotal_feeSet()
  252. {
  253. return array_key_exists('total_fee', $this->values);
  254. }
  255. public function SetSpbill_create_ip($value)
  256. {
  257. $this->values['spbill_create_ip'] = $value;
  258. }
  259. public function GetSpbill_create_ip()
  260. {
  261. return $this->values['spbill_create_ip'];
  262. }
  263. public function IsSpbill_create_ipSet()
  264. {
  265. return array_key_exists('spbill_create_ip', $this->values);
  266. }
  267. public function SetTime_start($value)
  268. {
  269. $this->values['time_start'] = $value;
  270. }
  271. public function GetTime_start()
  272. {
  273. return $this->values['time_start'];
  274. }
  275. public function IsTime_startSet()
  276. {
  277. return array_key_exists('time_start', $this->values);
  278. }
  279. public function SetTime_expire($value)
  280. {
  281. $this->values['time_expire'] = $value;
  282. }
  283. public function GetTime_expire()
  284. {
  285. return $this->values['time_expire'];
  286. }
  287. public function IsTime_expireSet()
  288. {
  289. return array_key_exists('time_expire', $this->values);
  290. }
  291. public function SetGoods_tag($value)
  292. {
  293. $this->values['goods_tag'] = $value;
  294. }
  295. public function GetGoods_tag()
  296. {
  297. return $this->values['goods_tag'];
  298. }
  299. public function IsGoods_tagSet()
  300. {
  301. return array_key_exists('goods_tag', $this->values);
  302. }
  303. public function SetNotify_url($value)
  304. {
  305. $this->values['notify_url'] = $value;
  306. }
  307. public function GetNotify_url()
  308. {
  309. return $this->values['notify_url'];
  310. }
  311. public function IsNotify_urlSet()
  312. {
  313. return array_key_exists('notify_url', $this->values);
  314. }
  315. public function SetTrade_type($value)
  316. {
  317. $this->values['trade_type'] = $value;
  318. }
  319. public function GetTrade_type()
  320. {
  321. return $this->values['trade_type'];
  322. }
  323. public function IsTrade_typeSet()
  324. {
  325. return array_key_exists('trade_type', $this->values);
  326. }
  327. public function SetProduct_id($value)
  328. {
  329. $this->values['product_id'] = $value;
  330. }
  331. public function GetProduct_id()
  332. {
  333. return $this->values['product_id'];
  334. }
  335. public function IsProduct_idSet()
  336. {
  337. return array_key_exists('product_id', $this->values);
  338. }
  339. public function SetOpenid($value)
  340. {
  341. $this->values['openid'] = $value;
  342. }
  343. public function GetOpenid()
  344. {
  345. return $this->values['openid'];
  346. }
  347. public function IsOpenidSet()
  348. {
  349. return array_key_exists('openid', $this->values);
  350. }
  351. }
  352. class WxPayOrderQuery extends WxPayDataBase
  353. {
  354. public function SetAppid($value)
  355. {
  356. $this->values['appid'] = $value;
  357. }
  358. public function GetAppid()
  359. {
  360. return $this->values['appid'];
  361. }
  362. public function IsAppidSet()
  363. {
  364. return array_key_exists('appid', $this->values);
  365. }
  366. public function SetMch_id($value)
  367. {
  368. $this->values['mch_id'] = $value;
  369. }
  370. public function GetMch_id()
  371. {
  372. return $this->values['mch_id'];
  373. }
  374. public function IsMch_idSet()
  375. {
  376. return array_key_exists('mch_id', $this->values);
  377. }
  378. public function SetTransaction_id($value)
  379. {
  380. $this->values['transaction_id'] = $value;
  381. }
  382. public function GetTransaction_id()
  383. {
  384. return $this->values['transaction_id'];
  385. }
  386. public function IsTransaction_idSet()
  387. {
  388. return array_key_exists('transaction_id', $this->values);
  389. }
  390. public function SetOut_trade_no($value)
  391. {
  392. $this->values['out_trade_no'] = $value;
  393. }
  394. public function GetOut_trade_no()
  395. {
  396. return $this->values['out_trade_no'];
  397. }
  398. public function IsOut_trade_noSet()
  399. {
  400. return array_key_exists('out_trade_no', $this->values);
  401. }
  402. public function SetNonce_str($value)
  403. {
  404. $this->values['nonce_str'] = $value;
  405. }
  406. public function GetNonce_str()
  407. {
  408. return $this->values['nonce_str'];
  409. }
  410. public function IsNonce_strSet()
  411. {
  412. return array_key_exists('nonce_str', $this->values);
  413. }
  414. }
  415. class WxPayCloseOrder extends WxPayDataBase
  416. {
  417. public function SetAppid($value)
  418. {
  419. $this->values['appid'] = $value;
  420. }
  421. public function GetAppid()
  422. {
  423. return $this->values['appid'];
  424. }
  425. public function IsAppidSet()
  426. {
  427. return array_key_exists('appid', $this->values);
  428. }
  429. public function SetMch_id($value)
  430. {
  431. $this->values['mch_id'] = $value;
  432. }
  433. public function GetMch_id()
  434. {
  435. return $this->values['mch_id'];
  436. }
  437. public function IsMch_idSet()
  438. {
  439. return array_key_exists('mch_id', $this->values);
  440. }
  441. public function SetOut_trade_no($value)
  442. {
  443. $this->values['out_trade_no'] = $value;
  444. }
  445. public function GetOut_trade_no()
  446. {
  447. return $this->values['out_trade_no'];
  448. }
  449. public function IsOut_trade_noSet()
  450. {
  451. return array_key_exists('out_trade_no', $this->values);
  452. }
  453. public function SetNonce_str($value)
  454. {
  455. $this->values['nonce_str'] = $value;
  456. }
  457. public function GetNonce_str()
  458. {
  459. return $this->values['nonce_str'];
  460. }
  461. public function IsNonce_strSet()
  462. {
  463. return array_key_exists('nonce_str', $this->values);
  464. }
  465. }
  466. class WxPayRefund extends WxPayDataBase
  467. {
  468. public function SetAppid($value)
  469. {
  470. $this->values['appid'] = $value;
  471. }
  472. public function GetAppid()
  473. {
  474. return $this->values['appid'];
  475. }
  476. public function IsAppidSet()
  477. {
  478. return array_key_exists('appid', $this->values);
  479. }
  480. public function SetMch_id($value)
  481. {
  482. $this->values['mch_id'] = $value;
  483. }
  484. public function GetMch_id()
  485. {
  486. return $this->values['mch_id'];
  487. }
  488. public function IsMch_idSet()
  489. {
  490. return array_key_exists('mch_id', $this->values);
  491. }
  492. public function SetDevice_info($value)
  493. {
  494. $this->values['device_info'] = $value;
  495. }
  496. public function GetDevice_info()
  497. {
  498. return $this->values['device_info'];
  499. }
  500. public function IsDevice_infoSet()
  501. {
  502. return array_key_exists('device_info', $this->values);
  503. }
  504. public function SetNonce_str($value)
  505. {
  506. $this->values['nonce_str'] = $value;
  507. }
  508. public function GetNonce_str()
  509. {
  510. return $this->values['nonce_str'];
  511. }
  512. public function IsNonce_strSet()
  513. {
  514. return array_key_exists('nonce_str', $this->values);
  515. }
  516. public function SetTransaction_id($value)
  517. {
  518. $this->values['transaction_id'] = $value;
  519. }
  520. public function GetTransaction_id()
  521. {
  522. return $this->values['transaction_id'];
  523. }
  524. public function IsTransaction_idSet()
  525. {
  526. return array_key_exists('transaction_id', $this->values);
  527. }
  528. public function SetOut_trade_no($value)
  529. {
  530. $this->values['out_trade_no'] = $value;
  531. }
  532. public function GetOut_trade_no()
  533. {
  534. return $this->values['out_trade_no'];
  535. }
  536. public function IsOut_trade_noSet()
  537. {
  538. return array_key_exists('out_trade_no', $this->values);
  539. }
  540. public function SetOut_refund_no($value)
  541. {
  542. $this->values['out_refund_no'] = $value;
  543. }
  544. public function GetOut_refund_no()
  545. {
  546. return $this->values['out_refund_no'];
  547. }
  548. public function IsOut_refund_noSet()
  549. {
  550. return array_key_exists('out_refund_no', $this->values);
  551. }
  552. public function SetTotal_fee($value)
  553. {
  554. $this->values['total_fee'] = $value;
  555. }
  556. public function GetTotal_fee()
  557. {
  558. return $this->values['total_fee'];
  559. }
  560. public function IsTotal_feeSet()
  561. {
  562. return array_key_exists('total_fee', $this->values);
  563. }
  564. public function SetRefund_fee($value)
  565. {
  566. $this->values['refund_fee'] = $value;
  567. }
  568. public function GetRefund_fee()
  569. {
  570. return $this->values['refund_fee'];
  571. }
  572. public function IsRefund_feeSet()
  573. {
  574. return array_key_exists('refund_fee', $this->values);
  575. }
  576. public function SetRefund_fee_type($value)
  577. {
  578. $this->values['refund_fee_type'] = $value;
  579. }
  580. public function GetRefund_fee_type()
  581. {
  582. return $this->values['refund_fee_type'];
  583. }
  584. public function IsRefund_fee_typeSet()
  585. {
  586. return array_key_exists('refund_fee_type', $this->values);
  587. }
  588. public function SetOp_user_id($value)
  589. {
  590. $this->values['op_user_id'] = $value;
  591. }
  592. public function GetOp_user_id()
  593. {
  594. return $this->values['op_user_id'];
  595. }
  596. public function IsOp_user_idSet()
  597. {
  598. return array_key_exists('op_user_id', $this->values);
  599. }
  600. }
  601. class WxPayRefundQuery extends WxPayDataBase
  602. {
  603. public function SetAppid($value)
  604. {
  605. $this->values['appid'] = $value;
  606. }
  607. public function GetAppid()
  608. {
  609. return $this->values['appid'];
  610. }
  611. public function IsAppidSet()
  612. {
  613. return array_key_exists('appid', $this->values);
  614. }
  615. public function SetMch_id($value)
  616. {
  617. $this->values['mch_id'] = $value;
  618. }
  619. public function GetMch_id()
  620. {
  621. return $this->values['mch_id'];
  622. }
  623. public function IsMch_idSet()
  624. {
  625. return array_key_exists('mch_id', $this->values);
  626. }
  627. public function SetDevice_info($value)
  628. {
  629. $this->values['device_info'] = $value;
  630. }
  631. public function GetDevice_info()
  632. {
  633. return $this->values['device_info'];
  634. }
  635. public function IsDevice_infoSet()
  636. {
  637. return array_key_exists('device_info', $this->values);
  638. }
  639. public function SetNonce_str($value)
  640. {
  641. $this->values['nonce_str'] = $value;
  642. }
  643. public function GetNonce_str()
  644. {
  645. return $this->values['nonce_str'];
  646. }
  647. public function IsNonce_strSet()
  648. {
  649. return array_key_exists('nonce_str', $this->values);
  650. }
  651. public function SetTransaction_id($value)
  652. {
  653. $this->values['transaction_id'] = $value;
  654. }
  655. public function GetTransaction_id()
  656. {
  657. return $this->values['transaction_id'];
  658. }
  659. public function IsTransaction_idSet()
  660. {
  661. return array_key_exists('transaction_id', $this->values);
  662. }
  663. public function SetOut_trade_no($value)
  664. {
  665. $this->values['out_trade_no'] = $value;
  666. }
  667. public function GetOut_trade_no()
  668. {
  669. return $this->values['out_trade_no'];
  670. }
  671. public function IsOut_trade_noSet()
  672. {
  673. return array_key_exists('out_trade_no', $this->values);
  674. }
  675. public function SetOut_refund_no($value)
  676. {
  677. $this->values['out_refund_no'] = $value;
  678. }
  679. public function GetOut_refund_no()
  680. {
  681. return $this->values['out_refund_no'];
  682. }
  683. public function IsOut_refund_noSet()
  684. {
  685. return array_key_exists('out_refund_no', $this->values);
  686. }
  687. public function SetRefund_id($value)
  688. {
  689. $this->values['refund_id'] = $value;
  690. }
  691. public function GetRefund_id()
  692. {
  693. return $this->values['refund_id'];
  694. }
  695. public function IsRefund_idSet()
  696. {
  697. return array_key_exists('refund_id', $this->values);
  698. }
  699. }
  700. class WxPayDownloadBill extends WxPayDataBase
  701. {
  702. public function SetAppid($value)
  703. {
  704. $this->values['appid'] = $value;
  705. }
  706. public function GetAppid()
  707. {
  708. return $this->values['appid'];
  709. }
  710. public function IsAppidSet()
  711. {
  712. return array_key_exists('appid', $this->values);
  713. }
  714. public function SetMch_id($value)
  715. {
  716. $this->values['mch_id'] = $value;
  717. }
  718. public function GetMch_id()
  719. {
  720. return $this->values['mch_id'];
  721. }
  722. public function IsMch_idSet()
  723. {
  724. return array_key_exists('mch_id', $this->values);
  725. }
  726. public function SetDevice_info($value)
  727. {
  728. $this->values['device_info'] = $value;
  729. }
  730. public function GetDevice_info()
  731. {
  732. return $this->values['device_info'];
  733. }
  734. public function IsDevice_infoSet()
  735. {
  736. return array_key_exists('device_info', $this->values);
  737. }
  738. public function SetNonce_str($value)
  739. {
  740. $this->values['nonce_str'] = $value;
  741. }
  742. public function GetNonce_str()
  743. {
  744. return $this->values['nonce_str'];
  745. }
  746. public function IsNonce_strSet()
  747. {
  748. return array_key_exists('nonce_str', $this->values);
  749. }
  750. public function SetBill_date($value)
  751. {
  752. $this->values['bill_date'] = $value;
  753. }
  754. public function GetBill_date()
  755. {
  756. return $this->values['bill_date'];
  757. }
  758. public function IsBill_dateSet()
  759. {
  760. return array_key_exists('bill_date', $this->values);
  761. }
  762. public function SetBill_type($value)
  763. {
  764. $this->values['bill_type'] = $value;
  765. }
  766. public function GetBill_type()
  767. {
  768. return $this->values['bill_type'];
  769. }
  770. public function IsBill_typeSet()
  771. {
  772. return array_key_exists('bill_type', $this->values);
  773. }
  774. }
  775. class WxPayReport extends WxPayDataBase
  776. {
  777. public function SetAppid($value)
  778. {
  779. $this->values['appid'] = $value;
  780. }
  781. public function GetAppid()
  782. {
  783. return $this->values['appid'];
  784. }
  785. public function IsAppidSet()
  786. {
  787. return array_key_exists('appid', $this->values);
  788. }
  789. public function SetMch_id($value)
  790. {
  791. $this->values['mch_id'] = $value;
  792. }
  793. public function GetMch_id()
  794. {
  795. return $this->values['mch_id'];
  796. }
  797. public function IsMch_idSet()
  798. {
  799. return array_key_exists('mch_id', $this->values);
  800. }
  801. public function SetDevice_info($value)
  802. {
  803. $this->values['device_info'] = $value;
  804. }
  805. public function GetDevice_info()
  806. {
  807. return $this->values['device_info'];
  808. }
  809. public function IsDevice_infoSet()
  810. {
  811. return array_key_exists('device_info', $this->values);
  812. }
  813. public function SetNonce_str($value)
  814. {
  815. $this->values['nonce_str'] = $value;
  816. }
  817. public function GetNonce_str()
  818. {
  819. return $this->values['nonce_str'];
  820. }
  821. public function IsNonce_strSet()
  822. {
  823. return array_key_exists('nonce_str', $this->values);
  824. }
  825. public function SetInterface_url($value)
  826. {
  827. $this->values['interface_url'] = $value;
  828. }
  829. public function GetInterface_url()
  830. {
  831. return $this->values['interface_url'];
  832. }
  833. public function IsInterface_urlSet()
  834. {
  835. return array_key_exists('interface_url', $this->values);
  836. }
  837. public function SetExecute_time_($value)
  838. {
  839. $this->values['execute_time_'] = $value;
  840. }
  841. public function GetExecute_time_()
  842. {
  843. return $this->values['execute_time_'];
  844. }
  845. public function IsExecute_time_Set()
  846. {
  847. return array_key_exists('execute_time_', $this->values);
  848. }
  849. public function SetReturn_code($value)
  850. {
  851. $this->values['return_code'] = $value;
  852. }
  853. public function GetReturn_code()
  854. {
  855. return $this->values['return_code'];
  856. }
  857. public function IsReturn_codeSet()
  858. {
  859. return array_key_exists('return_code', $this->values);
  860. }
  861. public function SetReturn_msg($value)
  862. {
  863. $this->values['return_msg'] = $value;
  864. }
  865. public function GetReturn_msg()
  866. {
  867. return $this->values['return_msg'];
  868. }
  869. public function IsReturn_msgSet()
  870. {
  871. return array_key_exists('return_msg', $this->values);
  872. }
  873. public function SetResult_code($value)
  874. {
  875. $this->values['result_code'] = $value;
  876. }
  877. public function GetResult_code()
  878. {
  879. return $this->values['result_code'];
  880. }
  881. public function IsResult_codeSet()
  882. {
  883. return array_key_exists('result_code', $this->values);
  884. }
  885. public function SetErr_code($value)
  886. {
  887. $this->values['err_code'] = $value;
  888. }
  889. public function GetErr_code()
  890. {
  891. return $this->values['err_code'];
  892. }
  893. public function IsErr_codeSet()
  894. {
  895. return array_key_exists('err_code', $this->values);
  896. }
  897. public function SetErr_code_des($value)
  898. {
  899. $this->values['err_code_des'] = $value;
  900. }
  901. public function GetErr_code_des()
  902. {
  903. return $this->values['err_code_des'];
  904. }
  905. public function IsErr_code_desSet()
  906. {
  907. return array_key_exists('err_code_des', $this->values);
  908. }
  909. public function SetOut_trade_no($value)
  910. {
  911. $this->values['out_trade_no'] = $value;
  912. }
  913. public function GetOut_trade_no()
  914. {
  915. return $this->values['out_trade_no'];
  916. }
  917. public function IsOut_trade_noSet()
  918. {
  919. return array_key_exists('out_trade_no', $this->values);
  920. }
  921. public function SetUser_ip($value)
  922. {
  923. $this->values['user_ip'] = $value;
  924. }
  925. public function GetUser_ip()
  926. {
  927. return $this->values['user_ip'];
  928. }
  929. public function IsUser_ipSet()
  930. {
  931. return array_key_exists('user_ip', $this->values);
  932. }
  933. public function SetTime($value)
  934. {
  935. $this->values['time'] = $value;
  936. }
  937. public function GetTime()
  938. {
  939. return $this->values['time'];
  940. }
  941. public function IsTimeSet()
  942. {
  943. return array_key_exists('time', $this->values);
  944. }
  945. }
  946. class WxPayShortUrl extends WxPayDataBase
  947. {
  948. public function SetAppid($value)
  949. {
  950. $this->values['appid'] = $value;
  951. }
  952. public function GetAppid()
  953. {
  954. return $this->values['appid'];
  955. }
  956. public function IsAppidSet()
  957. {
  958. return array_key_exists('appid', $this->values);
  959. }
  960. public function SetMch_id($value)
  961. {
  962. $this->values['mch_id'] = $value;
  963. }
  964. public function GetMch_id()
  965. {
  966. return $this->values['mch_id'];
  967. }
  968. public function IsMch_idSet()
  969. {
  970. return array_key_exists('mch_id', $this->values);
  971. }
  972. public function SetLong_url($value)
  973. {
  974. $this->values['long_url'] = $value;
  975. }
  976. public function GetLong_url()
  977. {
  978. return $this->values['long_url'];
  979. }
  980. public function IsLong_urlSet()
  981. {
  982. return array_key_exists('long_url', $this->values);
  983. }
  984. public function SetNonce_str($value)
  985. {
  986. $this->values['nonce_str'] = $value;
  987. }
  988. public function GetNonce_str()
  989. {
  990. return $this->values['nonce_str'];
  991. }
  992. public function IsNonce_strSet()
  993. {
  994. return array_key_exists('nonce_str', $this->values);
  995. }
  996. }
  997. class WxPayMicroPay extends WxPayDataBase
  998. {
  999. public function SetAppid($value)
  1000. {
  1001. $this->values['appid'] = $value;
  1002. }
  1003. public function GetAppid()
  1004. {
  1005. return $this->values['appid'];
  1006. }
  1007. public function IsAppidSet()
  1008. {
  1009. return array_key_exists('appid', $this->values);
  1010. }
  1011. public function SetMch_id($value)
  1012. {
  1013. $this->values['mch_id'] = $value;
  1014. }
  1015. public function GetMch_id()
  1016. {
  1017. return $this->values['mch_id'];
  1018. }
  1019. public function IsMch_idSet()
  1020. {
  1021. return array_key_exists('mch_id', $this->values);
  1022. }
  1023. public function SetDevice_info($value)
  1024. {
  1025. $this->values['device_info'] = $value;
  1026. }
  1027. public function GetDevice_info()
  1028. {
  1029. return $this->values['device_info'];
  1030. }
  1031. public function IsDevice_infoSet()
  1032. {
  1033. return array_key_exists('device_info', $this->values);
  1034. }
  1035. public function SetNonce_str($value)
  1036. {
  1037. $this->values['nonce_str'] = $value;
  1038. }
  1039. public function GetNonce_str()
  1040. {
  1041. return $this->values['nonce_str'];
  1042. }
  1043. public function IsNonce_strSet()
  1044. {
  1045. return array_key_exists('nonce_str', $this->values);
  1046. }
  1047. public function SetBody($value)
  1048. {
  1049. $this->values['body'] = $value;
  1050. }
  1051. public function GetBody()
  1052. {
  1053. return $this->values['body'];
  1054. }
  1055. public function IsBodySet()
  1056. {
  1057. return array_key_exists('body', $this->values);
  1058. }
  1059. public function SetDetail($value)
  1060. {
  1061. $this->values['detail'] = $value;
  1062. }
  1063. public function GetDetail()
  1064. {
  1065. return $this->values['detail'];
  1066. }
  1067. public function IsDetailSet()
  1068. {
  1069. return array_key_exists('detail', $this->values);
  1070. }
  1071. public function SetAttach($value)
  1072. {
  1073. $this->values['attach'] = $value;
  1074. }
  1075. public function GetAttach()
  1076. {
  1077. return $this->values['attach'];
  1078. }
  1079. public function IsAttachSet()
  1080. {
  1081. return array_key_exists('attach', $this->values);
  1082. }
  1083. public function SetOut_trade_no($value)
  1084. {
  1085. $this->values['out_trade_no'] = $value;
  1086. }
  1087. public function GetOut_trade_no()
  1088. {
  1089. return $this->values['out_trade_no'];
  1090. }
  1091. public function IsOut_trade_noSet()
  1092. {
  1093. return array_key_exists('out_trade_no', $this->values);
  1094. }
  1095. public function SetTotal_fee($value)
  1096. {
  1097. $this->values['total_fee'] = $value;
  1098. }
  1099. public function GetTotal_fee()
  1100. {
  1101. return $this->values['total_fee'];
  1102. }
  1103. public function IsTotal_feeSet()
  1104. {
  1105. return array_key_exists('total_fee', $this->values);
  1106. }
  1107. public function SetFee_type($value)
  1108. {
  1109. $this->values['fee_type'] = $value;
  1110. }
  1111. public function GetFee_type()
  1112. {
  1113. return $this->values['fee_type'];
  1114. }
  1115. public function IsFee_typeSet()
  1116. {
  1117. return array_key_exists('fee_type', $this->values);
  1118. }
  1119. public function SetSpbill_create_ip($value)
  1120. {
  1121. $this->values['spbill_create_ip'] = $value;
  1122. }
  1123. public function GetSpbill_create_ip()
  1124. {
  1125. return $this->values['spbill_create_ip'];
  1126. }
  1127. public function IsSpbill_create_ipSet()
  1128. {
  1129. return array_key_exists('spbill_create_ip', $this->values);
  1130. }
  1131. public function SetTime_start($value)
  1132. {
  1133. $this->values['time_start'] = $value;
  1134. }
  1135. public function GetTime_start()
  1136. {
  1137. return $this->values['time_start'];
  1138. }
  1139. public function IsTime_startSet()
  1140. {
  1141. return array_key_exists('time_start', $this->values);
  1142. }
  1143. public function SetTime_expire($value)
  1144. {
  1145. $this->values['time_expire'] = $value;
  1146. }
  1147. public function GetTime_expire()
  1148. {
  1149. return $this->values['time_expire'];
  1150. }
  1151. public function IsTime_expireSet()
  1152. {
  1153. return array_key_exists('time_expire', $this->values);
  1154. }
  1155. public function SetGoods_tag($value)
  1156. {
  1157. $this->values['goods_tag'] = $value;
  1158. }
  1159. public function GetGoods_tag()
  1160. {
  1161. return $this->values['goods_tag'];
  1162. }
  1163. public function IsGoods_tagSet()
  1164. {
  1165. return array_key_exists('goods_tag', $this->values);
  1166. }
  1167. public function SetAuth_code($value)
  1168. {
  1169. $this->values['auth_code'] = $value;
  1170. }
  1171. public function GetAuth_code()
  1172. {
  1173. return $this->values['auth_code'];
  1174. }
  1175. public function IsAuth_codeSet()
  1176. {
  1177. return array_key_exists('auth_code', $this->values);
  1178. }
  1179. }
  1180. class WxPayReverse extends WxPayDataBase
  1181. {
  1182. public function SetAppid($value)
  1183. {
  1184. $this->values['appid'] = $value;
  1185. }
  1186. public function GetAppid()
  1187. {
  1188. return $this->values['appid'];
  1189. }
  1190. public function IsAppidSet()
  1191. {
  1192. return array_key_exists('appid', $this->values);
  1193. }
  1194. public function SetMch_id($value)
  1195. {
  1196. $this->values['mch_id'] = $value;
  1197. }
  1198. public function GetMch_id()
  1199. {
  1200. return $this->values['mch_id'];
  1201. }
  1202. public function IsMch_idSet()
  1203. {
  1204. return array_key_exists('mch_id', $this->values);
  1205. }
  1206. public function SetTransaction_id($value)
  1207. {
  1208. $this->values['transaction_id'] = $value;
  1209. }
  1210. public function GetTransaction_id()
  1211. {
  1212. return $this->values['transaction_id'];
  1213. }
  1214. public function IsTransaction_idSet()
  1215. {
  1216. return array_key_exists('transaction_id', $this->values);
  1217. }
  1218. public function SetOut_trade_no($value)
  1219. {
  1220. $this->values['out_trade_no'] = $value;
  1221. }
  1222. public function GetOut_trade_no()
  1223. {
  1224. return $this->values['out_trade_no'];
  1225. }
  1226. public function IsOut_trade_noSet()
  1227. {
  1228. return array_key_exists('out_trade_no', $this->values);
  1229. }
  1230. public function SetNonce_str($value)
  1231. {
  1232. $this->values['nonce_str'] = $value;
  1233. }
  1234. public function GetNonce_str()
  1235. {
  1236. return $this->values['nonce_str'];
  1237. }
  1238. public function IsNonce_strSet()
  1239. {
  1240. return array_key_exists('nonce_str', $this->values);
  1241. }
  1242. }
  1243. class WxPayJsApiPay extends WxPayDataBase
  1244. {
  1245. public function SetAppid($value)
  1246. {
  1247. $this->values['appId'] = $value;
  1248. }
  1249. public function GetAppid()
  1250. {
  1251. return $this->values['appId'];
  1252. }
  1253. public function IsAppidSet()
  1254. {
  1255. return array_key_exists('appId', $this->values);
  1256. }
  1257. public function SetTimeStamp($value)
  1258. {
  1259. $this->values['timeStamp'] = $value;
  1260. }
  1261. public function GetTimeStamp()
  1262. {
  1263. return $this->values['timeStamp'];
  1264. }
  1265. public function IsTimeStampSet()
  1266. {
  1267. return array_key_exists('timeStamp', $this->values);
  1268. }
  1269. public function SetNonceStr($value)
  1270. {
  1271. $this->values['nonceStr'] = $value;
  1272. }
  1273. public function GetReturn_code()
  1274. {
  1275. return $this->values['nonceStr'];
  1276. }
  1277. public function IsReturn_codeSet()
  1278. {
  1279. return array_key_exists('nonceStr', $this->values);
  1280. }
  1281. public function SetPackage($value)
  1282. {
  1283. $this->values['package'] = $value;
  1284. }
  1285. public function GetPackage()
  1286. {
  1287. return $this->values['package'];
  1288. }
  1289. public function IsPackageSet()
  1290. {
  1291. return array_key_exists('package', $this->values);
  1292. }
  1293. public function SetSignType($value)
  1294. {
  1295. $this->values['signType'] = $value;
  1296. }
  1297. public function GetSignType()
  1298. {
  1299. return $this->values['signType'];
  1300. }
  1301. public function IsSignTypeSet()
  1302. {
  1303. return array_key_exists('signType', $this->values);
  1304. }
  1305. public function SetPaySign($value)
  1306. {
  1307. $this->values['paySign'] = $value;
  1308. }
  1309. public function GetPaySign()
  1310. {
  1311. return $this->values['paySign'];
  1312. }
  1313. public function IsPaySignSet()
  1314. {
  1315. return array_key_exists('paySign', $this->values);
  1316. }
  1317. }
  1318. class WxPayBizPayUrl extends WxPayDataBase
  1319. {
  1320. public function SetAppid($value)
  1321. {
  1322. $this->values['appid'] = $value;
  1323. }
  1324. public function GetAppid()
  1325. {
  1326. return $this->values['appid'];
  1327. }
  1328. public function IsAppidSet()
  1329. {
  1330. return array_key_exists('appid', $this->values);
  1331. }
  1332. public function SetMch_id($value)
  1333. {
  1334. $this->values['mch_id'] = $value;
  1335. }
  1336. public function GetMch_id()
  1337. {
  1338. return $this->values['mch_id'];
  1339. }
  1340. public function IsMch_idSet()
  1341. {
  1342. return array_key_exists('mch_id', $this->values);
  1343. }
  1344. public function SetTime_stamp($value)
  1345. {
  1346. $this->values['time_stamp'] = $value;
  1347. }
  1348. public function GetTime_stamp()
  1349. {
  1350. return $this->values['time_stamp'];
  1351. }
  1352. public function IsTime_stampSet()
  1353. {
  1354. return array_key_exists('time_stamp', $this->values);
  1355. }
  1356. public function SetNonce_str($value)
  1357. {
  1358. $this->values['nonce_str'] = $value;
  1359. }
  1360. public function GetNonce_str()
  1361. {
  1362. return $this->values['nonce_str'];
  1363. }
  1364. public function IsNonce_strSet()
  1365. {
  1366. return array_key_exists('nonce_str', $this->values);
  1367. }
  1368. public function SetProduct_id($value)
  1369. {
  1370. $this->values['product_id'] = $value;
  1371. }
  1372. public function GetProduct_id()
  1373. {
  1374. return $this->values['product_id'];
  1375. }
  1376. public function IsProduct_idSet()
  1377. {
  1378. return array_key_exists('product_id', $this->values);
  1379. }
  1380. }
  1381. require_once 'WxPay.Config.php';
  1382. require_once 'WxPay.Exception.php';
  1383. ?>