WxPayUnifiedOrder.php 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: yunzhong
  5. * Date: 2019/11/29
  6. * Time: 19:24
  7. */
  8. namespace app\common\services\wechat\lib;
  9. /**
  10. *
  11. * 统一下单输入对象
  12. * @author widyhu
  13. *
  14. */
  15. class WxPayUnifiedOrder extends WxPayDataBase
  16. {
  17. /**
  18. * 设置微信分配的公众账号ID
  19. * @param string $value
  20. **/
  21. public function SetAppid($value)
  22. {
  23. $this->values['appid'] = $value;
  24. }
  25. /**
  26. * 获取微信分配的公众账号ID的值
  27. * @return 值
  28. **/
  29. public function GetAppid()
  30. {
  31. return $this->values['appid'];
  32. }
  33. /**
  34. * 判断微信分配的公众账号ID是否存在
  35. * @return true 或 false
  36. **/
  37. public function IsAppidSet()
  38. {
  39. return array_key_exists('appid', $this->values);
  40. }
  41. /**
  42. * 设置微信支付分配的商户号
  43. * @param string $value
  44. **/
  45. public function SetMch_id($value)
  46. {
  47. $this->values['mch_id'] = $value;
  48. }
  49. /**
  50. * 获取微信支付分配的商户号的值
  51. * @return 值
  52. **/
  53. public function GetMch_id()
  54. {
  55. return $this->values['mch_id'];
  56. }
  57. /**
  58. * 判断微信支付分配的商户号是否存在
  59. * @return true 或 false
  60. **/
  61. public function IsMch_idSet()
  62. {
  63. return array_key_exists('mch_id', $this->values);
  64. }
  65. /**
  66. * 设置微信分配的公众账号ID
  67. * @param string $value
  68. **/
  69. public function SetSub_appid($value)
  70. {
  71. $this->values['sub_appid'] = $value;
  72. }
  73. /**
  74. * 获取微信分配的公众账号ID的值
  75. * @return 值
  76. **/
  77. public function GetSub_appid()
  78. {
  79. return $this->values['sub_appid'];
  80. }
  81. /**
  82. * 判断微信分配的公众账号ID是否存在
  83. * @return true 或 false
  84. **/
  85. public function IsSub_appidSet()
  86. {
  87. return array_key_exists('sub_appid', $this->values);
  88. }
  89. /**
  90. * 设置微信支付分配的商户号
  91. * @param string $value
  92. **/
  93. public function SetSub_Mch_id($value)
  94. {
  95. $this->values['sub_mch_id'] = $value;
  96. }
  97. /**
  98. * 获取微信支付分配的商户号的值
  99. * @return 值
  100. **/
  101. public function GetSub_Mch_id()
  102. {
  103. return $this->values['sub_mch_id'];
  104. }
  105. /**
  106. * 判断微信支付分配的商户号是否存在
  107. * @return true 或 false
  108. **/
  109. public function IsSub_Mch_idSet()
  110. {
  111. return array_key_exists('sub_mch_id', $this->values);
  112. }
  113. /**
  114. * 设置微信支付分配的终端设备号,商户自定义
  115. * @param string $value
  116. **/
  117. public function SetDevice_info($value)
  118. {
  119. $this->values['device_info'] = $value;
  120. }
  121. /**
  122. * 获取微信支付分配的终端设备号,商户自定义的值
  123. * @return 值
  124. **/
  125. public function GetDevice_info()
  126. {
  127. return $this->values['device_info'];
  128. }
  129. /**
  130. * 判断微信支付分配的终端设备号,商户自定义是否存在
  131. * @return true 或 false
  132. **/
  133. public function IsDevice_infoSet()
  134. {
  135. return array_key_exists('device_info', $this->values);
  136. }
  137. /**
  138. * 设置随机字符串,不长于32位。推荐随机数生成算法
  139. * @param string $value
  140. **/
  141. public function SetNonce_str($value)
  142. {
  143. $this->values['nonce_str'] = $value;
  144. }
  145. /**
  146. * 获取随机字符串,不长于32位。推荐随机数生成算法的值
  147. * @return 值
  148. **/
  149. public function GetNonce_str()
  150. {
  151. return $this->values['nonce_str'];
  152. }
  153. /**
  154. * 判断随机字符串,不长于32位。推荐随机数生成算法是否存在
  155. * @return true 或 false
  156. **/
  157. public function IsNonce_strSet()
  158. {
  159. return array_key_exists('nonce_str', $this->values);
  160. }
  161. /**
  162. * 设置商品或支付单简要描述
  163. * @param string $value
  164. **/
  165. public function SetBody($value)
  166. {
  167. $this->values['body'] = $value;
  168. }
  169. /**
  170. * 获取商品或支付单简要描述的值
  171. * @return 值
  172. **/
  173. public function GetBody()
  174. {
  175. return $this->values['body'];
  176. }
  177. /**
  178. * 判断商品或支付单简要描述是否存在
  179. * @return true 或 false
  180. **/
  181. public function IsBodySet()
  182. {
  183. return array_key_exists('body', $this->values);
  184. }
  185. /**
  186. * 设置商品名称明细列表
  187. * @param string $value
  188. **/
  189. public function SetDetail($value)
  190. {
  191. $this->values['detail'] = $value;
  192. }
  193. /**
  194. * 获取商品名称明细列表的值
  195. * @return 值
  196. **/
  197. public function GetDetail()
  198. {
  199. return $this->values['detail'];
  200. }
  201. /**
  202. * 判断商品名称明细列表是否存在
  203. * @return true 或 false
  204. **/
  205. public function IsDetailSet()
  206. {
  207. return array_key_exists('detail', $this->values);
  208. }
  209. /**
  210. * 设置附加数据,在查询API和支付通知中原样返回,该字段主要用于商户携带订单的自定义数据
  211. * @param string $value
  212. **/
  213. public function SetAttach($value)
  214. {
  215. $this->values['attach'] = $value;
  216. }
  217. /**
  218. * 获取附加数据,在查询API和支付通知中原样返回,该字段主要用于商户携带订单的自定义数据的值
  219. * @return 值
  220. **/
  221. public function GetAttach()
  222. {
  223. return $this->values['attach'];
  224. }
  225. /**
  226. * 判断附加数据,在查询API和支付通知中原样返回,该字段主要用于商户携带订单的自定义数据是否存在
  227. * @return true 或 false
  228. **/
  229. public function IsAttachSet()
  230. {
  231. return array_key_exists('attach', $this->values);
  232. }
  233. /**
  234. * 设置商户系统内部的订单号,32个字符内、可包含字母, 其他说明见商户订单号
  235. * @param string $value
  236. **/
  237. public function SetOut_trade_no($value)
  238. {
  239. $this->values['out_trade_no'] = $value;
  240. }
  241. /**
  242. * 获取商户系统内部的订单号,32个字符内、可包含字母, 其他说明见商户订单号的值
  243. * @return 值
  244. **/
  245. public function GetOut_trade_no()
  246. {
  247. return $this->values['out_trade_no'];
  248. }
  249. /**
  250. * 判断商户系统内部的订单号,32个字符内、可包含字母, 其他说明见商户订单号是否存在
  251. * @return true 或 false
  252. **/
  253. public function IsOut_trade_noSet()
  254. {
  255. return array_key_exists('out_trade_no', $this->values);
  256. }
  257. /**
  258. * 设置符合ISO 4217标准的三位字母代码,默认人民币:CNY,其他值列表详见货币类型
  259. * @param string $value
  260. **/
  261. public function SetFee_type($value)
  262. {
  263. $this->values['fee_type'] = $value;
  264. }
  265. /**
  266. * 获取符合ISO 4217标准的三位字母代码,默认人民币:CNY,其他值列表详见货币类型的值
  267. * @return 值
  268. **/
  269. public function GetFee_type()
  270. {
  271. return $this->values['fee_type'];
  272. }
  273. /**
  274. * 判断符合ISO 4217标准的三位字母代码,默认人民币:CNY,其他值列表详见货币类型是否存在
  275. * @return true 或 false
  276. **/
  277. public function IsFee_typeSet()
  278. {
  279. return array_key_exists('fee_type', $this->values);
  280. }
  281. /**
  282. * 设置订单总金额,只能为整数,详见支付金额
  283. * @param string $value
  284. **/
  285. public function SetTotal_fee($value)
  286. {
  287. $this->values['total_fee'] = $value;
  288. }
  289. /**
  290. * 获取订单总金额,只能为整数,详见支付金额的值
  291. * @return 值
  292. **/
  293. public function GetTotal_fee()
  294. {
  295. return $this->values['total_fee'];
  296. }
  297. /**
  298. * 判断订单总金额,只能为整数,详见支付金额是否存在
  299. * @return true 或 false
  300. **/
  301. public function IsTotal_feeSet()
  302. {
  303. return array_key_exists('total_fee', $this->values);
  304. }
  305. /**
  306. * 设置APP和网页支付提交用户端ip,Native支付填调用微信支付API的机器IP。
  307. * @param string $value
  308. **/
  309. public function SetSpbill_create_ip($value)
  310. {
  311. $this->values['spbill_create_ip'] = $value;
  312. }
  313. /**
  314. * 获取APP和网页支付提交用户端ip,Native支付填调用微信支付API的机器IP。的值
  315. * @return 值
  316. **/
  317. public function GetSpbill_create_ip()
  318. {
  319. return $this->values['spbill_create_ip'];
  320. }
  321. /**
  322. * 判断APP和网页支付提交用户端ip,Native支付填调用微信支付API的机器IP。是否存在
  323. * @return true 或 false
  324. **/
  325. public function IsSpbill_create_ipSet()
  326. {
  327. return array_key_exists('spbill_create_ip', $this->values);
  328. }
  329. /**
  330. * 设置订单生成时间,格式为yyyyMMddHHmmss,如2009年12月25日9点10分10秒表示为20091225091010。其他详见时间规则
  331. * @param string $value
  332. **/
  333. public function SetTime_start($value)
  334. {
  335. $this->values['time_start'] = $value;
  336. }
  337. /**
  338. * 获取订单生成时间,格式为yyyyMMddHHmmss,如2009年12月25日9点10分10秒表示为20091225091010。其他详见时间规则的值
  339. * @return 值
  340. **/
  341. public function GetTime_start()
  342. {
  343. return $this->values['time_start'];
  344. }
  345. /**
  346. * 判断订单生成时间,格式为yyyyMMddHHmmss,如2009年12月25日9点10分10秒表示为20091225091010。其他详见时间规则是否存在
  347. * @return true 或 false
  348. **/
  349. public function IsTime_startSet()
  350. {
  351. return array_key_exists('time_start', $this->values);
  352. }
  353. /**
  354. * 设置订单失效时间,格式为yyyyMMddHHmmss,如2009年12月27日9点10分10秒表示为20091227091010。其他详见时间规则
  355. * @param string $value
  356. **/
  357. public function SetTime_expire($value)
  358. {
  359. $this->values['time_expire'] = $value;
  360. }
  361. /**
  362. * 获取订单失效时间,格式为yyyyMMddHHmmss,如2009年12月27日9点10分10秒表示为20091227091010。其他详见时间规则的值
  363. * @return 值
  364. **/
  365. public function GetTime_expire()
  366. {
  367. return $this->values['time_expire'];
  368. }
  369. /**
  370. * 判断订单失效时间,格式为yyyyMMddHHmmss,如2009年12月27日9点10分10秒表示为20091227091010。其他详见时间规则是否存在
  371. * @return true 或 false
  372. **/
  373. public function IsTime_expireSet()
  374. {
  375. return array_key_exists('time_expire', $this->values);
  376. }
  377. /**
  378. * 设置商品标记,代金券或立减优惠功能的参数,说明详见代金券或立减优惠
  379. * @param string $value
  380. **/
  381. public function SetGoods_tag($value)
  382. {
  383. $this->values['goods_tag'] = $value;
  384. }
  385. /**
  386. * 获取商品标记,代金券或立减优惠功能的参数,说明详见代金券或立减优惠的值
  387. * @return 值
  388. **/
  389. public function GetGoods_tag()
  390. {
  391. return $this->values['goods_tag'];
  392. }
  393. /**
  394. * 判断商品标记,代金券或立减优惠功能的参数,说明详见代金券或立减优惠是否存在
  395. * @return true 或 false
  396. **/
  397. public function IsGoods_tagSet()
  398. {
  399. return array_key_exists('goods_tag', $this->values);
  400. }
  401. /**
  402. * 设置接收微信支付异步通知回调地址
  403. * @param string $value
  404. **/
  405. public function SetNotify_url($value)
  406. {
  407. $this->values['notify_url'] = $value;
  408. }
  409. /**
  410. * 获取接收微信支付异步通知回调地址的值
  411. * @return 值
  412. **/
  413. public function GetNotify_url()
  414. {
  415. return $this->values['notify_url'];
  416. }
  417. /**
  418. * 判断接收微信支付异步通知回调地址是否存在
  419. * @return true 或 false
  420. **/
  421. public function IsNotify_urlSet()
  422. {
  423. return array_key_exists('notify_url', $this->values);
  424. }
  425. /**
  426. * 设置取值如下:JSAPI,NATIVE,APP,详细说明见参数规定
  427. * @param string $value
  428. **/
  429. public function SetTrade_type($value)
  430. {
  431. $this->values['trade_type'] = $value;
  432. }
  433. /**
  434. * 获取取值如下:JSAPI,NATIVE,APP,详细说明见参数规定的值
  435. * @return 值
  436. **/
  437. public function GetTrade_type()
  438. {
  439. return $this->values['trade_type'];
  440. }
  441. /**
  442. * 判断取值如下:JSAPI,NATIVE,APP,详细说明见参数规定是否存在
  443. * @return true 或 false
  444. **/
  445. public function IsTrade_typeSet()
  446. {
  447. return array_key_exists('trade_type', $this->values);
  448. }
  449. /**
  450. * 设置trade_type=NATIVE,此参数必传。此id为二维码中包含的商品ID,商户自行定义。
  451. * @param string $value
  452. **/
  453. public function SetProduct_id($value)
  454. {
  455. $this->values['product_id'] = $value;
  456. }
  457. /**
  458. * 获取trade_type=NATIVE,此参数必传。此id为二维码中包含的商品ID,商户自行定义。的值
  459. * @return 值
  460. **/
  461. public function GetProduct_id()
  462. {
  463. return $this->values['product_id'];
  464. }
  465. /**
  466. * 判断trade_type=NATIVE,此参数必传。此id为二维码中包含的商品ID,商户自行定义。是否存在
  467. * @return true 或 false
  468. **/
  469. public function IsProduct_idSet()
  470. {
  471. return array_key_exists('product_id', $this->values);
  472. }
  473. /**
  474. * 设置trade_type=JSAPI,此参数必传,用户在商户appid下的唯一标识。下单前需要调用【网页授权获取用户信息】接口获取到用户的Openid。
  475. * @param string $value
  476. **/
  477. public function SetOpenid($value)
  478. {
  479. $this->values['openid'] = $value;
  480. }
  481. /**
  482. * 获取trade_type=JSAPI,此参数必传,用户在商户appid下的唯一标识。下单前需要调用【网页授权获取用户信息】接口获取到用户的Openid。 的值
  483. * @return 值
  484. **/
  485. public function GetOpenid()
  486. {
  487. return $this->values['openid'];
  488. }
  489. /**
  490. * 判断trade_type=JSAPI,此参数必传,用户在商户appid下的唯一标识。下单前需要调用【网页授权获取用户信息】接口获取到用户的Openid。 是否存在
  491. * @return true 或 false
  492. **/
  493. public function IsOpenidSet()
  494. {
  495. return array_key_exists('openid', $this->values);
  496. }
  497. /**
  498. * 设置trade_type=JSAPI,此参数必传,用户在商户appid下的唯一标识。下单前需要调用【网页授权获取用户信息】接口获取到用户的Openid。
  499. * @param string $value
  500. **/
  501. public function SetSubOpenid($value)
  502. {
  503. $this->values['sub_openid'] = $value;
  504. }
  505. /**
  506. * 获取trade_type=JSAPI,此参数必传,用户在商户appid下的唯一标识。下单前需要调用【网页授权获取用户信息】接口获取到用户的Openid。 的值
  507. * @return 值
  508. **/
  509. public function GetSubOpenid()
  510. {
  511. return $this->values['sub_openid'];
  512. }
  513. /**
  514. * 判断trade_type=JSAPI,此参数必传,用户在商户appid下的唯一标识。下单前需要调用【网页授权获取用户信息】接口获取到用户的Openid。 是否存在
  515. * @return true 或 false
  516. **/
  517. public function IsSubOpenidSet()
  518. {
  519. return array_key_exists('sub_openid', $this->values);
  520. }
  521. /**
  522. * 设置trade_type=JSAPI,此参数必传,用户在商户appid下的唯一标识。下单前需要调用【网页授权获取用户信息】接口获取到用户的Openid。
  523. * @param string $value
  524. **/
  525. public function SetProfit_sharing($value)
  526. {
  527. $this->values['profit_sharing'] = $value;
  528. }
  529. /**
  530. * 获取trade_type=JSAPI,此参数必传,用户在商户appid下的唯一标识。下单前需要调用【网页授权获取用户信息】接口获取到用户的Openid。 的值
  531. * @return 值
  532. **/
  533. public function GetProfit_sharing()
  534. {
  535. return $this->values['profit_sharing'];
  536. }
  537. /**
  538. * 判断trade_type=JSAPI,此参数必传,用户在商户appid下的唯一标识。下单前需要调用【网页授权获取用户信息】接口获取到用户的Openid。 是否存在
  539. * @return true 或 false
  540. **/
  541. public function IsProfit_sharingSet()
  542. {
  543. return array_key_exists('profit_sharing', $this->values);
  544. }
  545. }