WxPay.Data.php 73 KB

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