WxPayData.php 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368
  1. <?php
  2. namespace app\common\services\wechat\lib;
  3. /**
  4. *
  5. * 只使用md5算法进行签名, 不管配置的是什么签名方式,都只支持md5签名方式
  6. *
  7. **/
  8. class WxPayDataBaseSignMd5 extends WxPayDataBase
  9. {
  10. /**
  11. * 生成签名 - 重写该方法
  12. * @param WxPayConfigInterface $config 配置对象
  13. * @param bool $needSignType 是否需要补signtype
  14. * @return 签名,本函数不覆盖sign成员变量,如要设置签名需要调用SetSign方法赋值
  15. */
  16. public function MakeSign($config, $needSignType = false)
  17. {
  18. if($needSignType) {
  19. $this->SetSignType($config->GetSignType());
  20. }
  21. //签名步骤一:按字典序排序参数
  22. ksort($this->values);
  23. $string = $this->ToUrlParams();
  24. //签名步骤二:在string后加入KEY
  25. $string = $string . "&key=".$config->GetKey();
  26. //签名步骤三:MD5加密
  27. $string = md5($string);
  28. //签名步骤四:所有字符转为大写
  29. $result = strtoupper($string);
  30. return $result;
  31. }
  32. }
  33. /**
  34. *
  35. * 回调回包数据基类
  36. *
  37. **/
  38. class WxPayNotifyResults extends WxPayResults
  39. {
  40. /**
  41. * 将xml转为array
  42. * @param WxPayConfigInterface $config
  43. * @param string $xml
  44. * @return WxPayNotifyResults
  45. * @throws WxPayException
  46. */
  47. public static function Init($config, $xml)
  48. {
  49. $obj = new self();
  50. $obj->FromXml($xml);
  51. //失败则直接返回失败
  52. $obj->CheckSign($config);
  53. return $obj;
  54. }
  55. }
  56. /**
  57. *
  58. * 回调基础类
  59. * @author widyhu
  60. *
  61. */
  62. class WxPayNotifyReply extends WxPayDataBaseSignMd5
  63. {
  64. /**
  65. *
  66. * 设置错误码 FAIL 或者 SUCCESS
  67. * @param string
  68. */
  69. public function SetReturn_code($return_code)
  70. {
  71. $this->values['return_code'] = $return_code;
  72. }
  73. /**
  74. *
  75. * 获取错误码 FAIL 或者 SUCCESS
  76. * @return string $return_code
  77. */
  78. public function GetReturn_code()
  79. {
  80. return $this->values['return_code'];
  81. }
  82. /**
  83. *
  84. * 设置错误信息
  85. * @param string $return_code
  86. */
  87. public function SetReturn_msg($return_msg)
  88. {
  89. $this->values['return_msg'] = $return_msg;
  90. }
  91. /**
  92. *
  93. * 获取错误信息
  94. * @return string
  95. */
  96. public function GetReturn_msg()
  97. {
  98. return $this->values['return_msg'];
  99. }
  100. /**
  101. *
  102. * 设置返回参数
  103. * @param string $key
  104. * @param string $value
  105. */
  106. public function SetData($key, $value)
  107. {
  108. $this->values[$key] = $value;
  109. }
  110. }
  111. /**
  112. *
  113. * 关闭订单输入对象
  114. * @author widyhu
  115. *
  116. */
  117. class WxPayCloseOrder extends WxPayDataBase
  118. {
  119. /**
  120. * 设置微信分配的公众账号ID
  121. * @param string $value
  122. **/
  123. public function SetAppid($value)
  124. {
  125. $this->values['appid'] = $value;
  126. }
  127. /**
  128. * 获取微信分配的公众账号ID的值
  129. * @return 值
  130. **/
  131. public function GetAppid()
  132. {
  133. return $this->values['appid'];
  134. }
  135. /**
  136. * 判断微信分配的公众账号ID是否存在
  137. * @return true 或 false
  138. **/
  139. public function IsAppidSet()
  140. {
  141. return array_key_exists('appid', $this->values);
  142. }
  143. /**
  144. * 设置微信支付分配的商户号
  145. * @param string $value
  146. **/
  147. public function SetMch_id($value)
  148. {
  149. $this->values['mch_id'] = $value;
  150. }
  151. /**
  152. * 获取微信支付分配的商户号的值
  153. * @return 值
  154. **/
  155. public function GetMch_id()
  156. {
  157. return $this->values['mch_id'];
  158. }
  159. /**
  160. * 判断微信支付分配的商户号是否存在
  161. * @return true 或 false
  162. **/
  163. public function IsMch_idSet()
  164. {
  165. return array_key_exists('mch_id', $this->values);
  166. }
  167. /**
  168. * 设置商户系统内部的订单号
  169. * @param string $value
  170. **/
  171. public function SetOut_trade_no($value)
  172. {
  173. $this->values['out_trade_no'] = $value;
  174. }
  175. /**
  176. * 获取商户系统内部的订单号的值
  177. * @return 值
  178. **/
  179. public function GetOut_trade_no()
  180. {
  181. return $this->values['out_trade_no'];
  182. }
  183. /**
  184. * 判断商户系统内部的订单号是否存在
  185. * @return true 或 false
  186. **/
  187. public function IsOut_trade_noSet()
  188. {
  189. return array_key_exists('out_trade_no', $this->values);
  190. }
  191. /**
  192. * 设置商户系统内部的订单号,32个字符内、可包含字母, 其他说明见商户订单号
  193. * @param string $value
  194. **/
  195. public function SetNonce_str($value)
  196. {
  197. $this->values['nonce_str'] = $value;
  198. }
  199. /**
  200. * 获取商户系统内部的订单号,32个字符内、可包含字母, 其他说明见商户订单号的值
  201. * @return 值
  202. **/
  203. public function GetNonce_str()
  204. {
  205. return $this->values['nonce_str'];
  206. }
  207. /**
  208. * 判断商户系统内部的订单号,32个字符内、可包含字母, 其他说明见商户订单号是否存在
  209. * @return true 或 false
  210. **/
  211. public function IsNonce_strSet()
  212. {
  213. return array_key_exists('nonce_str', $this->values);
  214. }
  215. }
  216. /**
  217. *
  218. * 退款查询输入对象
  219. * @author widyhu
  220. *
  221. */
  222. class WxPayRefundQuery extends WxPayDataBase
  223. {
  224. /**
  225. * 设置微信分配的公众账号ID
  226. * @param string $value
  227. **/
  228. public function SetAppid($value)
  229. {
  230. $this->values['appid'] = $value;
  231. }
  232. /**
  233. * 获取微信分配的公众账号ID的值
  234. * @return 值
  235. **/
  236. public function GetAppid()
  237. {
  238. return $this->values['appid'];
  239. }
  240. /**
  241. * 判断微信分配的公众账号ID是否存在
  242. * @return true 或 false
  243. **/
  244. public function IsAppidSet()
  245. {
  246. return array_key_exists('appid', $this->values);
  247. }
  248. /**
  249. * 设置微信支付分配的商户号
  250. * @param string $value
  251. **/
  252. public function SetMch_id($value)
  253. {
  254. $this->values['mch_id'] = $value;
  255. }
  256. /**
  257. * 获取微信支付分配的商户号的值
  258. * @return 值
  259. **/
  260. public function GetMch_id()
  261. {
  262. return $this->values['mch_id'];
  263. }
  264. /**
  265. * 判断微信支付分配的商户号是否存在
  266. * @return true 或 false
  267. **/
  268. public function IsMch_idSet()
  269. {
  270. return array_key_exists('mch_id', $this->values);
  271. }
  272. /**
  273. * 设置微信支付分配的终端设备号
  274. * @param string $value
  275. **/
  276. public function SetDevice_info($value)
  277. {
  278. $this->values['device_info'] = $value;
  279. }
  280. /**
  281. * 获取微信支付分配的终端设备号的值
  282. * @return 值
  283. **/
  284. public function GetDevice_info()
  285. {
  286. return $this->values['device_info'];
  287. }
  288. /**
  289. * 判断微信支付分配的终端设备号是否存在
  290. * @return true 或 false
  291. **/
  292. public function IsDevice_infoSet()
  293. {
  294. return array_key_exists('device_info', $this->values);
  295. }
  296. /**
  297. * 设置随机字符串,不长于32位。推荐随机数生成算法
  298. * @param string $value
  299. **/
  300. public function SetNonce_str($value)
  301. {
  302. $this->values['nonce_str'] = $value;
  303. }
  304. /**
  305. * 获取随机字符串,不长于32位。推荐随机数生成算法的值
  306. * @return 值
  307. **/
  308. public function GetNonce_str()
  309. {
  310. return $this->values['nonce_str'];
  311. }
  312. /**
  313. * 判断随机字符串,不长于32位。推荐随机数生成算法是否存在
  314. * @return true 或 false
  315. **/
  316. public function IsNonce_strSet()
  317. {
  318. return array_key_exists('nonce_str', $this->values);
  319. }
  320. /**
  321. * 设置微信订单号
  322. * @param string $value
  323. **/
  324. public function SetTransaction_id($value)
  325. {
  326. $this->values['transaction_id'] = $value;
  327. }
  328. /**
  329. * 获取微信订单号的值
  330. * @return 值
  331. **/
  332. public function GetTransaction_id()
  333. {
  334. return $this->values['transaction_id'];
  335. }
  336. /**
  337. * 判断微信订单号是否存在
  338. * @return true 或 false
  339. **/
  340. public function IsTransaction_idSet()
  341. {
  342. return array_key_exists('transaction_id', $this->values);
  343. }
  344. /**
  345. * 设置商户系统内部的订单号
  346. * @param string $value
  347. **/
  348. public function SetOut_trade_no($value)
  349. {
  350. $this->values['out_trade_no'] = $value;
  351. }
  352. /**
  353. * 获取商户系统内部的订单号的值
  354. * @return 值
  355. **/
  356. public function GetOut_trade_no()
  357. {
  358. return $this->values['out_trade_no'];
  359. }
  360. /**
  361. * 判断商户系统内部的订单号是否存在
  362. * @return true 或 false
  363. **/
  364. public function IsOut_trade_noSet()
  365. {
  366. return array_key_exists('out_trade_no', $this->values);
  367. }
  368. /**
  369. * 设置商户退款单号
  370. * @param string $value
  371. **/
  372. public function SetOut_refund_no($value)
  373. {
  374. $this->values['out_refund_no'] = $value;
  375. }
  376. /**
  377. * 获取商户退款单号的值
  378. * @return 值
  379. **/
  380. public function GetOut_refund_no()
  381. {
  382. return $this->values['out_refund_no'];
  383. }
  384. /**
  385. * 判断商户退款单号是否存在
  386. * @return true 或 false
  387. **/
  388. public function IsOut_refund_noSet()
  389. {
  390. return array_key_exists('out_refund_no', $this->values);
  391. }
  392. /**
  393. * 设置微信退款单号refund_id、out_refund_no、out_trade_no、transaction_id四个参数必填一个,如果同时存在优先级为:refund_id>out_refund_no>transaction_id>out_trade_no
  394. * @param string $value
  395. **/
  396. public function SetRefund_id($value)
  397. {
  398. $this->values['refund_id'] = $value;
  399. }
  400. /**
  401. * 获取微信退款单号refund_id、out_refund_no、out_trade_no、transaction_id四个参数必填一个,如果同时存在优先级为:refund_id>out_refund_no>transaction_id>out_trade_no的值
  402. * @return 值
  403. **/
  404. public function GetRefund_id()
  405. {
  406. return $this->values['refund_id'];
  407. }
  408. /**
  409. * 判断微信退款单号refund_id、out_refund_no、out_trade_no、transaction_id四个参数必填一个,如果同时存在优先级为:refund_id>out_refund_no>transaction_id>out_trade_no是否存在
  410. * @return true 或 false
  411. **/
  412. public function IsRefund_idSet()
  413. {
  414. return array_key_exists('refund_id', $this->values);
  415. }
  416. }
  417. /**
  418. *
  419. * 下载对账单输入对象
  420. * @author widyhu
  421. *
  422. */
  423. class WxPayDownloadBill extends WxPayDataBase
  424. {
  425. /**
  426. * 设置微信分配的公众账号ID
  427. * @param string $value
  428. **/
  429. public function SetAppid($value)
  430. {
  431. $this->values['appid'] = $value;
  432. }
  433. /**
  434. * 获取微信分配的公众账号ID的值
  435. * @return 值
  436. **/
  437. public function GetAppid()
  438. {
  439. return $this->values['appid'];
  440. }
  441. /**
  442. * 判断微信分配的公众账号ID是否存在
  443. * @return true 或 false
  444. **/
  445. public function IsAppidSet()
  446. {
  447. return array_key_exists('appid', $this->values);
  448. }
  449. /**
  450. * 设置微信支付分配的商户号
  451. * @param string $value
  452. **/
  453. public function SetMch_id($value)
  454. {
  455. $this->values['mch_id'] = $value;
  456. }
  457. /**
  458. * 获取微信支付分配的商户号的值
  459. * @return 值
  460. **/
  461. public function GetMch_id()
  462. {
  463. return $this->values['mch_id'];
  464. }
  465. /**
  466. * 判断微信支付分配的商户号是否存在
  467. * @return true 或 false
  468. **/
  469. public function IsMch_idSet()
  470. {
  471. return array_key_exists('mch_id', $this->values);
  472. }
  473. /**
  474. * 设置微信支付分配的终端设备号,填写此字段,只下载该设备号的对账单
  475. * @param string $value
  476. **/
  477. public function SetDevice_info($value)
  478. {
  479. $this->values['device_info'] = $value;
  480. }
  481. /**
  482. * 获取微信支付分配的终端设备号,填写此字段,只下载该设备号的对账单的值
  483. * @return 值
  484. **/
  485. public function GetDevice_info()
  486. {
  487. return $this->values['device_info'];
  488. }
  489. /**
  490. * 判断微信支付分配的终端设备号,填写此字段,只下载该设备号的对账单是否存在
  491. * @return true 或 false
  492. **/
  493. public function IsDevice_infoSet()
  494. {
  495. return array_key_exists('device_info', $this->values);
  496. }
  497. /**
  498. * 设置随机字符串,不长于32位。推荐随机数生成算法
  499. * @param string $value
  500. **/
  501. public function SetNonce_str($value)
  502. {
  503. $this->values['nonce_str'] = $value;
  504. }
  505. /**
  506. * 获取随机字符串,不长于32位。推荐随机数生成算法的值
  507. * @return 值
  508. **/
  509. public function GetNonce_str()
  510. {
  511. return $this->values['nonce_str'];
  512. }
  513. /**
  514. * 判断随机字符串,不长于32位。推荐随机数生成算法是否存在
  515. * @return true 或 false
  516. **/
  517. public function IsNonce_strSet()
  518. {
  519. return array_key_exists('nonce_str', $this->values);
  520. }
  521. /**
  522. * 设置下载对账单的日期,格式:20140603
  523. * @param string $value
  524. **/
  525. public function SetBill_date($value)
  526. {
  527. $this->values['bill_date'] = $value;
  528. }
  529. /**
  530. * 获取下载对账单的日期,格式:20140603的值
  531. * @return 值
  532. **/
  533. public function GetBill_date()
  534. {
  535. return $this->values['bill_date'];
  536. }
  537. /**
  538. * 判断下载对账单的日期,格式:20140603是否存在
  539. * @return true 或 false
  540. **/
  541. public function IsBill_dateSet()
  542. {
  543. return array_key_exists('bill_date', $this->values);
  544. }
  545. /**
  546. * 设置ALL,返回当日所有订单信息,默认值SUCCESS,返回当日成功支付的订单REFUND,返回当日退款订单REVOKED,已撤销的订单
  547. * @param string $value
  548. **/
  549. public function SetBill_type($value)
  550. {
  551. $this->values['bill_type'] = $value;
  552. }
  553. /**
  554. * 获取ALL,返回当日所有订单信息,默认值SUCCESS,返回当日成功支付的订单REFUND,返回当日退款订单REVOKED,已撤销的订单的值
  555. * @return 值
  556. **/
  557. public function GetBill_type()
  558. {
  559. return $this->values['bill_type'];
  560. }
  561. /**
  562. * 判断ALL,返回当日所有订单信息,默认值SUCCESS,返回当日成功支付的订单REFUND,返回当日退款订单REVOKED,已撤销的订单是否存在
  563. * @return true 或 false
  564. **/
  565. public function IsBill_typeSet()
  566. {
  567. return array_key_exists('bill_type', $this->values);
  568. }
  569. }
  570. /**
  571. *
  572. * 测速上报输入对象
  573. * @author widyhu
  574. *
  575. */
  576. class WxPayReport extends WxPayDataBase
  577. {
  578. /**
  579. * 设置微信分配的公众账号ID
  580. * @param string $value
  581. **/
  582. public function SetAppid($value)
  583. {
  584. $this->values['appid'] = $value;
  585. }
  586. /**
  587. * 获取微信分配的公众账号ID的值
  588. * @return 值
  589. **/
  590. public function GetAppid()
  591. {
  592. return $this->values['appid'];
  593. }
  594. /**
  595. * 判断微信分配的公众账号ID是否存在
  596. * @return true 或 false
  597. **/
  598. public function IsAppidSet()
  599. {
  600. return array_key_exists('appid', $this->values);
  601. }
  602. /**
  603. * 设置微信支付分配的商户号
  604. * @param string $value
  605. **/
  606. public function SetMch_id($value)
  607. {
  608. $this->values['mch_id'] = $value;
  609. }
  610. /**
  611. * 获取微信支付分配的商户号的值
  612. * @return 值
  613. **/
  614. public function GetMch_id()
  615. {
  616. return $this->values['mch_id'];
  617. }
  618. /**
  619. * 判断微信支付分配的商户号是否存在
  620. * @return true 或 false
  621. **/
  622. public function IsMch_idSet()
  623. {
  624. return array_key_exists('mch_id', $this->values);
  625. }
  626. /**
  627. * 设置微信支付分配的终端设备号,商户自定义
  628. * @param string $value
  629. **/
  630. public function SetDevice_info($value)
  631. {
  632. $this->values['device_info'] = $value;
  633. }
  634. /**
  635. * 获取微信支付分配的终端设备号,商户自定义的值
  636. * @return 值
  637. **/
  638. public function GetDevice_info()
  639. {
  640. return $this->values['device_info'];
  641. }
  642. /**
  643. * 判断微信支付分配的终端设备号,商户自定义是否存在
  644. * @return true 或 false
  645. **/
  646. public function IsDevice_infoSet()
  647. {
  648. return array_key_exists('device_info', $this->values);
  649. }
  650. /**
  651. * 设置随机字符串,不长于32位。推荐随机数生成算法
  652. * @param string $value
  653. **/
  654. public function SetNonce_str($value)
  655. {
  656. $this->values['nonce_str'] = $value;
  657. }
  658. /**
  659. * 获取随机字符串,不长于32位。推荐随机数生成算法的值
  660. * @return 值
  661. **/
  662. public function GetNonce_str()
  663. {
  664. return $this->values['nonce_str'];
  665. }
  666. /**
  667. * 判断随机字符串,不长于32位。推荐随机数生成算法是否存在
  668. * @return true 或 false
  669. **/
  670. public function IsNonce_strSet()
  671. {
  672. return array_key_exists('nonce_str', $this->values);
  673. }
  674. /**
  675. * 设置上报对应的接口的完整URL,类似:https://api.mch.weixin.qq.com/pay/unifiedorder对于被扫支付,为更好的和商户共同分析一次业务行为的整体耗时情况,对于两种接入模式,请都在门店侧对一次被扫行为进行一次单独的整体上报,上报URL指定为:https://api.mch.weixin.qq.com/pay/micropay/total关于两种接入模式具体可参考本文档章节:被扫支付商户接入模式其它接口调用仍然按照调用一次,上报一次来进行。
  676. * @param string $value
  677. **/
  678. public function SetInterface_url($value)
  679. {
  680. $this->values['interface_url'] = $value;
  681. }
  682. /**
  683. * 获取上报对应的接口的完整URL,类似:https://api.mch.weixin.qq.com/pay/unifiedorder对于被扫支付,为更好的和商户共同分析一次业务行为的整体耗时情况,对于两种接入模式,请都在门店侧对一次被扫行为进行一次单独的整体上报,上报URL指定为:https://api.mch.weixin.qq.com/pay/micropay/total关于两种接入模式具体可参考本文档章节:被扫支付商户接入模式其它接口调用仍然按照调用一次,上报一次来进行。的值
  684. * @return 值
  685. **/
  686. public function GetInterface_url()
  687. {
  688. return $this->values['interface_url'];
  689. }
  690. /**
  691. * 判断上报对应的接口的完整URL,类似:https://api.mch.weixin.qq.com/pay/unifiedorder对于被扫支付,为更好的和商户共同分析一次业务行为的整体耗时情况,对于两种接入模式,请都在门店侧对一次被扫行为进行一次单独的整体上报,上报URL指定为:https://api.mch.weixin.qq.com/pay/micropay/total关于两种接入模式具体可参考本文档章节:被扫支付商户接入模式其它接口调用仍然按照调用一次,上报一次来进行。是否存在
  692. * @return true 或 false
  693. **/
  694. public function IsInterface_urlSet()
  695. {
  696. return array_key_exists('interface_url', $this->values);
  697. }
  698. /**
  699. * 设置接口耗时情况,单位为毫秒
  700. * @param string $value
  701. **/
  702. public function SetExecute_time_($value)
  703. {
  704. $this->values['execute_time_'] = $value;
  705. }
  706. /**
  707. * 获取接口耗时情况,单位为毫秒的值
  708. * @return 值
  709. **/
  710. public function GetExecute_time_()
  711. {
  712. return $this->values['execute_time_'];
  713. }
  714. /**
  715. * 判断接口耗时情况,单位为毫秒是否存在
  716. * @return true 或 false
  717. **/
  718. public function IsExecute_time_Set()
  719. {
  720. return array_key_exists('execute_time_', $this->values);
  721. }
  722. /**
  723. * 设置SUCCESS/FAIL此字段是通信标识,非交易标识,交易是否成功需要查看trade_state来判断
  724. * @param string $value
  725. **/
  726. public function SetReturn_code($value)
  727. {
  728. $this->values['return_code'] = $value;
  729. }
  730. /**
  731. * 获取SUCCESS/FAIL此字段是通信标识,非交易标识,交易是否成功需要查看trade_state来判断的值
  732. * @return 值
  733. **/
  734. public function GetReturn_code()
  735. {
  736. return $this->values['return_code'];
  737. }
  738. /**
  739. * 判断SUCCESS/FAIL此字段是通信标识,非交易标识,交易是否成功需要查看trade_state来判断是否存在
  740. * @return true 或 false
  741. **/
  742. public function IsReturn_codeSet()
  743. {
  744. return array_key_exists('return_code', $this->values);
  745. }
  746. /**
  747. * 设置返回信息,如非空,为错误原因签名失败参数格式校验错误
  748. * @param string $value
  749. **/
  750. public function SetReturn_msg($value)
  751. {
  752. $this->values['return_msg'] = $value;
  753. }
  754. /**
  755. * 获取返回信息,如非空,为错误原因签名失败参数格式校验错误的值
  756. * @return 值
  757. **/
  758. public function GetReturn_msg()
  759. {
  760. return $this->values['return_msg'];
  761. }
  762. /**
  763. * 判断返回信息,如非空,为错误原因签名失败参数格式校验错误是否存在
  764. * @return true 或 false
  765. **/
  766. public function IsReturn_msgSet()
  767. {
  768. return array_key_exists('return_msg', $this->values);
  769. }
  770. /**
  771. * 设置SUCCESS/FAIL
  772. * @param string $value
  773. **/
  774. public function SetResult_code($value)
  775. {
  776. $this->values['result_code'] = $value;
  777. }
  778. /**
  779. * 获取SUCCESS/FAIL的值
  780. * @return 值
  781. **/
  782. public function GetResult_code()
  783. {
  784. return $this->values['result_code'];
  785. }
  786. /**
  787. * 判断SUCCESS/FAIL是否存在
  788. * @return true 或 false
  789. **/
  790. public function IsResult_codeSet()
  791. {
  792. return array_key_exists('result_code', $this->values);
  793. }
  794. /**
  795. * 设置ORDERNOTEXIST—订单不存在SYSTEMERROR—系统错误
  796. * @param string $value
  797. **/
  798. public function SetErr_code($value)
  799. {
  800. $this->values['err_code'] = $value;
  801. }
  802. /**
  803. * 获取ORDERNOTEXIST—订单不存在SYSTEMERROR—系统错误的值
  804. * @return 值
  805. **/
  806. public function GetErr_code()
  807. {
  808. return $this->values['err_code'];
  809. }
  810. /**
  811. * 判断ORDERNOTEXIST—订单不存在SYSTEMERROR—系统错误是否存在
  812. * @return true 或 false
  813. **/
  814. public function IsErr_codeSet()
  815. {
  816. return array_key_exists('err_code', $this->values);
  817. }
  818. /**
  819. * 设置结果信息描述
  820. * @param string $value
  821. **/
  822. public function SetErr_code_des($value)
  823. {
  824. $this->values['err_code_des'] = $value;
  825. }
  826. /**
  827. * 获取结果信息描述的值
  828. * @return 值
  829. **/
  830. public function GetErr_code_des()
  831. {
  832. return $this->values['err_code_des'];
  833. }
  834. /**
  835. * 判断结果信息描述是否存在
  836. * @return true 或 false
  837. **/
  838. public function IsErr_code_desSet()
  839. {
  840. return array_key_exists('err_code_des', $this->values);
  841. }
  842. /**
  843. * 设置商户系统内部的订单号,商户可以在上报时提供相关商户订单号方便微信支付更好的提高服务质量。
  844. * @param string $value
  845. **/
  846. public function SetOut_trade_no($value)
  847. {
  848. $this->values['out_trade_no'] = $value;
  849. }
  850. /**
  851. * 获取商户系统内部的订单号,商户可以在上报时提供相关商户订单号方便微信支付更好的提高服务质量。 的值
  852. * @return 值
  853. **/
  854. public function GetOut_trade_no()
  855. {
  856. return $this->values['out_trade_no'];
  857. }
  858. /**
  859. * 判断商户系统内部的订单号,商户可以在上报时提供相关商户订单号方便微信支付更好的提高服务质量。 是否存在
  860. * @return true 或 false
  861. **/
  862. public function IsOut_trade_noSet()
  863. {
  864. return array_key_exists('out_trade_no', $this->values);
  865. }
  866. /**
  867. * 设置发起接口调用时的机器IP
  868. * @param string $value
  869. **/
  870. public function SetUser_ip($value)
  871. {
  872. $this->values['user_ip'] = $value;
  873. }
  874. /**
  875. * 获取发起接口调用时的机器IP 的值
  876. * @return 值
  877. **/
  878. public function GetUser_ip()
  879. {
  880. return $this->values['user_ip'];
  881. }
  882. /**
  883. * 判断发起接口调用时的机器IP 是否存在
  884. * @return true 或 false
  885. **/
  886. public function IsUser_ipSet()
  887. {
  888. return array_key_exists('user_ip', $this->values);
  889. }
  890. /**
  891. * 设置系统时间,格式为yyyyMMddHHmmss,如2009年12月27日9点10分10秒表示为20091227091010。其他详见时间规则
  892. * @param string $value
  893. **/
  894. public function SetTime($value)
  895. {
  896. $this->values['time'] = $value;
  897. }
  898. /**
  899. * 获取系统时间,格式为yyyyMMddHHmmss,如2009年12月27日9点10分10秒表示为20091227091010。其他详见时间规则的值
  900. * @return 值
  901. **/
  902. public function GetTime()
  903. {
  904. return $this->values['time'];
  905. }
  906. /**
  907. * 判断系统时间,格式为yyyyMMddHHmmss,如2009年12月27日9点10分10秒表示为20091227091010。其他详见时间规则是否存在
  908. * @return true 或 false
  909. **/
  910. public function IsTimeSet()
  911. {
  912. return array_key_exists('time', $this->values);
  913. }
  914. }
  915. /**
  916. *
  917. * 短链转换输入对象
  918. * @author widyhu
  919. *
  920. */
  921. class WxPayShortUrl extends WxPayDataBase
  922. {
  923. /**
  924. * 设置微信分配的公众账号ID
  925. * @param string $value
  926. **/
  927. public function SetAppid($value)
  928. {
  929. $this->values['appid'] = $value;
  930. }
  931. /**
  932. * 获取微信分配的公众账号ID的值
  933. * @return 值
  934. **/
  935. public function GetAppid()
  936. {
  937. return $this->values['appid'];
  938. }
  939. /**
  940. * 判断微信分配的公众账号ID是否存在
  941. * @return true 或 false
  942. **/
  943. public function IsAppidSet()
  944. {
  945. return array_key_exists('appid', $this->values);
  946. }
  947. /**
  948. * 设置微信支付分配的商户号
  949. * @param string $value
  950. **/
  951. public function SetMch_id($value)
  952. {
  953. $this->values['mch_id'] = $value;
  954. }
  955. /**
  956. * 获取微信支付分配的商户号的值
  957. * @return 值
  958. **/
  959. public function GetMch_id()
  960. {
  961. return $this->values['mch_id'];
  962. }
  963. /**
  964. * 判断微信支付分配的商户号是否存在
  965. * @return true 或 false
  966. **/
  967. public function IsMch_idSet()
  968. {
  969. return array_key_exists('mch_id', $this->values);
  970. }
  971. /**
  972. * 设置需要转换的URL,签名用原串,传输需URL encode
  973. * @param string $value
  974. **/
  975. public function SetLong_url($value)
  976. {
  977. $this->values['long_url'] = $value;
  978. }
  979. /**
  980. * 获取需要转换的URL,签名用原串,传输需URL encode的值
  981. * @return 值
  982. **/
  983. public function GetLong_url()
  984. {
  985. return $this->values['long_url'];
  986. }
  987. /**
  988. * 判断需要转换的URL,签名用原串,传输需URL encode是否存在
  989. * @return true 或 false
  990. **/
  991. public function IsLong_urlSet()
  992. {
  993. return array_key_exists('long_url', $this->values);
  994. }
  995. /**
  996. * 设置随机字符串,不长于32位。推荐随机数生成算法
  997. * @param string $value
  998. **/
  999. public function SetNonce_str($value)
  1000. {
  1001. $this->values['nonce_str'] = $value;
  1002. }
  1003. /**
  1004. * 获取随机字符串,不长于32位。推荐随机数生成算法的值
  1005. * @return 值
  1006. **/
  1007. public function GetNonce_str()
  1008. {
  1009. return $this->values['nonce_str'];
  1010. }
  1011. /**
  1012. * 判断随机字符串,不长于32位。推荐随机数生成算法是否存在
  1013. * @return true 或 false
  1014. **/
  1015. public function IsNonce_strSet()
  1016. {
  1017. return array_key_exists('nonce_str', $this->values);
  1018. }
  1019. }
  1020. /**
  1021. *
  1022. * 撤销输入对象
  1023. * @author widyhu
  1024. *
  1025. */
  1026. class WxPayReverse extends WxPayDataBase
  1027. {
  1028. /**
  1029. * 设置微信分配的公众账号ID
  1030. * @param string $value
  1031. **/
  1032. public function SetAppid($value)
  1033. {
  1034. $this->values['appid'] = $value;
  1035. }
  1036. /**
  1037. * 获取微信分配的公众账号ID的值
  1038. * @return 值
  1039. **/
  1040. public function GetAppid()
  1041. {
  1042. return $this->values['appid'];
  1043. }
  1044. /**
  1045. * 判断微信分配的公众账号ID是否存在
  1046. * @return true 或 false
  1047. **/
  1048. public function IsAppidSet()
  1049. {
  1050. return array_key_exists('appid', $this->values);
  1051. }
  1052. /**
  1053. * 设置微信支付分配的商户号
  1054. * @param string $value
  1055. **/
  1056. public function SetMch_id($value)
  1057. {
  1058. $this->values['mch_id'] = $value;
  1059. }
  1060. /**
  1061. * 获取微信支付分配的商户号的值
  1062. * @return 值
  1063. **/
  1064. public function GetMch_id()
  1065. {
  1066. return $this->values['mch_id'];
  1067. }
  1068. /**
  1069. * 判断微信支付分配的商户号是否存在
  1070. * @return true 或 false
  1071. **/
  1072. public function IsMch_idSet()
  1073. {
  1074. return array_key_exists('mch_id', $this->values);
  1075. }
  1076. /**
  1077. * 设置微信的订单号,优先使用
  1078. * @param string $value
  1079. **/
  1080. public function SetTransaction_id($value)
  1081. {
  1082. $this->values['transaction_id'] = $value;
  1083. }
  1084. /**
  1085. * 获取微信的订单号,优先使用的值
  1086. * @return 值
  1087. **/
  1088. public function GetTransaction_id()
  1089. {
  1090. return $this->values['transaction_id'];
  1091. }
  1092. /**
  1093. * 判断微信的订单号,优先使用是否存在
  1094. * @return true 或 false
  1095. **/
  1096. public function IsTransaction_idSet()
  1097. {
  1098. return array_key_exists('transaction_id', $this->values);
  1099. }
  1100. /**
  1101. * 设置商户系统内部的订单号,transaction_id、out_trade_no二选一,如果同时存在优先级:transaction_id> out_trade_no
  1102. * @param string $value
  1103. **/
  1104. public function SetOut_trade_no($value)
  1105. {
  1106. $this->values['out_trade_no'] = $value;
  1107. }
  1108. /**
  1109. * 获取商户系统内部的订单号,transaction_id、out_trade_no二选一,如果同时存在优先级:transaction_id> out_trade_no的值
  1110. * @return 值
  1111. **/
  1112. public function GetOut_trade_no()
  1113. {
  1114. return $this->values['out_trade_no'];
  1115. }
  1116. /**
  1117. * 判断商户系统内部的订单号,transaction_id、out_trade_no二选一,如果同时存在优先级:transaction_id> out_trade_no是否存在
  1118. * @return true 或 false
  1119. **/
  1120. public function IsOut_trade_noSet()
  1121. {
  1122. return array_key_exists('out_trade_no', $this->values);
  1123. }
  1124. /**
  1125. * 设置随机字符串,不长于32位。推荐随机数生成算法
  1126. * @param string $value
  1127. **/
  1128. public function SetNonce_str($value)
  1129. {
  1130. $this->values['nonce_str'] = $value;
  1131. }
  1132. /**
  1133. * 获取随机字符串,不长于32位。推荐随机数生成算法的值
  1134. * @return 值
  1135. **/
  1136. public function GetNonce_str()
  1137. {
  1138. return $this->values['nonce_str'];
  1139. }
  1140. /**
  1141. * 判断随机字符串,不长于32位。推荐随机数生成算法是否存在
  1142. * @return true 或 false
  1143. **/
  1144. public function IsNonce_strSet()
  1145. {
  1146. return array_key_exists('nonce_str', $this->values);
  1147. }
  1148. }
  1149. /**
  1150. *
  1151. * 扫码支付模式一生成二维码参数
  1152. * @author widyhu
  1153. *
  1154. */
  1155. class WxPayBizPayUrl extends WxPayDataBaseSignMd5
  1156. {
  1157. /**
  1158. * 设置微信分配的公众账号ID
  1159. * @param string $value
  1160. **/
  1161. public function SetAppid($value)
  1162. {
  1163. $this->values['appid'] = $value;
  1164. }
  1165. /**
  1166. * 获取微信分配的公众账号ID的值
  1167. * @return 值
  1168. **/
  1169. public function GetAppid()
  1170. {
  1171. return $this->values['appid'];
  1172. }
  1173. /**
  1174. * 判断微信分配的公众账号ID是否存在
  1175. * @return true 或 false
  1176. **/
  1177. public function IsAppidSet()
  1178. {
  1179. return array_key_exists('appid', $this->values);
  1180. }
  1181. /**
  1182. * 设置微信支付分配的商户号
  1183. * @param string $value
  1184. **/
  1185. public function SetMch_id($value)
  1186. {
  1187. $this->values['mch_id'] = $value;
  1188. }
  1189. /**
  1190. * 获取微信支付分配的商户号的值
  1191. * @return 值
  1192. **/
  1193. public function GetMch_id()
  1194. {
  1195. return $this->values['mch_id'];
  1196. }
  1197. /**
  1198. * 判断微信支付分配的商户号是否存在
  1199. * @return true 或 false
  1200. **/
  1201. public function IsMch_idSet()
  1202. {
  1203. return array_key_exists('mch_id', $this->values);
  1204. }
  1205. /**
  1206. * 设置支付时间戳
  1207. * @param string $value
  1208. **/
  1209. public function SetTime_stamp($value)
  1210. {
  1211. $this->values['time_stamp'] = $value;
  1212. }
  1213. /**
  1214. * 获取支付时间戳的值
  1215. * @return 值
  1216. **/
  1217. public function GetTime_stamp()
  1218. {
  1219. return $this->values['time_stamp'];
  1220. }
  1221. /**
  1222. * 判断支付时间戳是否存在
  1223. * @return true 或 false
  1224. **/
  1225. public function IsTime_stampSet()
  1226. {
  1227. return array_key_exists('time_stamp', $this->values);
  1228. }
  1229. /**
  1230. * 设置随机字符串
  1231. * @param string $value
  1232. **/
  1233. public function SetNonce_str($value)
  1234. {
  1235. $this->values['nonce_str'] = $value;
  1236. }
  1237. /**
  1238. * 获取随机字符串的值
  1239. * @return 值
  1240. **/
  1241. public function GetNonce_str()
  1242. {
  1243. return $this->values['nonce_str'];
  1244. }
  1245. /**
  1246. * 判断随机字符串是否存在
  1247. * @return true 或 false
  1248. **/
  1249. public function IsNonce_strSet()
  1250. {
  1251. return array_key_exists('nonce_str', $this->values);
  1252. }
  1253. /**
  1254. * 设置商品ID
  1255. * @param string $value
  1256. **/
  1257. public function SetProduct_id($value)
  1258. {
  1259. $this->values['product_id'] = $value;
  1260. }
  1261. /**
  1262. * 获取商品ID的值
  1263. * @return 值
  1264. **/
  1265. public function GetProduct_id()
  1266. {
  1267. return $this->values['product_id'];
  1268. }
  1269. /**
  1270. * 判断商品ID是否存在
  1271. * @return true 或 false
  1272. **/
  1273. public function IsProduct_idSet()
  1274. {
  1275. return array_key_exists('product_id', $this->values);
  1276. }
  1277. }