models.go 22 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028
  1. // Copyright 2021 Tencent Inc. All rights reserved.
  2. //
  3. // H5支付
  4. //
  5. // H5支付API
  6. //
  7. // API version: 1.2.3
  8. // Code generated by WechatPay APIv3 Generator based on [OpenAPI Generator](https://openapi-generator.tech); DO NOT EDIT.
  9. package h5
  10. import (
  11. "encoding/json"
  12. "fmt"
  13. "time"
  14. )
  15. // Amount
  16. type Amount struct {
  17. // 订单总金额,单位为分
  18. Total *int64 `json:"total"`
  19. // CNY:人民币,境内商户号仅支持人民币。
  20. Currency *string `json:"currency,omitempty"`
  21. }
  22. func (o Amount) MarshalJSON() ([]byte, error) {
  23. toSerialize := map[string]interface{}{}
  24. if o.Total == nil {
  25. return nil, fmt.Errorf("field `Total` is required and must be specified in Amount")
  26. }
  27. toSerialize["total"] = o.Total
  28. if o.Currency != nil {
  29. toSerialize["currency"] = o.Currency
  30. }
  31. return json.Marshal(toSerialize)
  32. }
  33. func (o Amount) String() string {
  34. var ret string
  35. if o.Total == nil {
  36. ret += "Total:<nil>, "
  37. } else {
  38. ret += fmt.Sprintf("Total:%v, ", *o.Total)
  39. }
  40. if o.Currency == nil {
  41. ret += "Currency:<nil>"
  42. } else {
  43. ret += fmt.Sprintf("Currency:%v", *o.Currency)
  44. }
  45. return fmt.Sprintf("Amount{%s}", ret)
  46. }
  47. func (o Amount) Clone() *Amount {
  48. ret := Amount{}
  49. if o.Total != nil {
  50. ret.Total = new(int64)
  51. *ret.Total = *o.Total
  52. }
  53. if o.Currency != nil {
  54. ret.Currency = new(string)
  55. *ret.Currency = *o.Currency
  56. }
  57. return &ret
  58. }
  59. // CloseOrderRequest
  60. type CloseOrderRequest struct {
  61. OutTradeNo *string `json:"out_trade_no"`
  62. // 直连商户号
  63. Mchid *string `json:"mchid"`
  64. }
  65. func (o CloseOrderRequest) MarshalJSON() ([]byte, error) {
  66. toSerialize := map[string]interface{}{}
  67. if o.OutTradeNo == nil {
  68. return nil, fmt.Errorf("field `OutTradeNo` is required and must be specified in CloseOrderRequest")
  69. }
  70. toSerialize["out_trade_no"] = o.OutTradeNo
  71. if o.Mchid == nil {
  72. return nil, fmt.Errorf("field `Mchid` is required and must be specified in CloseOrderRequest")
  73. }
  74. toSerialize["mchid"] = o.Mchid
  75. return json.Marshal(toSerialize)
  76. }
  77. func (o CloseOrderRequest) String() string {
  78. var ret string
  79. if o.OutTradeNo == nil {
  80. ret += "OutTradeNo:<nil>, "
  81. } else {
  82. ret += fmt.Sprintf("OutTradeNo:%v, ", *o.OutTradeNo)
  83. }
  84. if o.Mchid == nil {
  85. ret += "Mchid:<nil>"
  86. } else {
  87. ret += fmt.Sprintf("Mchid:%v", *o.Mchid)
  88. }
  89. return fmt.Sprintf("CloseOrderRequest{%s}", ret)
  90. }
  91. func (o CloseOrderRequest) Clone() *CloseOrderRequest {
  92. ret := CloseOrderRequest{}
  93. if o.OutTradeNo != nil {
  94. ret.OutTradeNo = new(string)
  95. *ret.OutTradeNo = *o.OutTradeNo
  96. }
  97. if o.Mchid != nil {
  98. ret.Mchid = new(string)
  99. *ret.Mchid = *o.Mchid
  100. }
  101. return &ret
  102. }
  103. // CloseRequest
  104. type CloseRequest struct {
  105. // 直连商户号
  106. Mchid *string `json:"mchid"`
  107. }
  108. func (o CloseRequest) MarshalJSON() ([]byte, error) {
  109. toSerialize := map[string]interface{}{}
  110. if o.Mchid == nil {
  111. return nil, fmt.Errorf("field `Mchid` is required and must be specified in CloseRequest")
  112. }
  113. toSerialize["mchid"] = o.Mchid
  114. return json.Marshal(toSerialize)
  115. }
  116. func (o CloseRequest) String() string {
  117. var ret string
  118. if o.Mchid == nil {
  119. ret += "Mchid:<nil>"
  120. } else {
  121. ret += fmt.Sprintf("Mchid:%v", *o.Mchid)
  122. }
  123. return fmt.Sprintf("CloseRequest{%s}", ret)
  124. }
  125. func (o CloseRequest) Clone() *CloseRequest {
  126. ret := CloseRequest{}
  127. if o.Mchid != nil {
  128. ret.Mchid = new(string)
  129. *ret.Mchid = *o.Mchid
  130. }
  131. return &ret
  132. }
  133. // Detail 优惠功能
  134. type Detail struct {
  135. // 1.商户侧一张小票订单可能被分多次支付,订单原价用于记录整张小票的交易金额。 2.当订单原价与支付金额不相等,则不享受优惠。 3.该字段主要用于防止同一张小票分多次支付,以享受多次优惠的情况,正常支付订单不必上传此参数。
  136. CostPrice *int64 `json:"cost_price,omitempty"`
  137. // 商家小票ID。
  138. InvoiceId *string `json:"invoice_id,omitempty"`
  139. GoodsDetail []GoodsDetail `json:"goods_detail,omitempty"`
  140. }
  141. func (o Detail) MarshalJSON() ([]byte, error) {
  142. toSerialize := map[string]interface{}{}
  143. if o.CostPrice != nil {
  144. toSerialize["cost_price"] = o.CostPrice
  145. }
  146. if o.InvoiceId != nil {
  147. toSerialize["invoice_id"] = o.InvoiceId
  148. }
  149. if o.GoodsDetail != nil {
  150. toSerialize["goods_detail"] = o.GoodsDetail
  151. }
  152. return json.Marshal(toSerialize)
  153. }
  154. func (o Detail) String() string {
  155. var ret string
  156. if o.CostPrice == nil {
  157. ret += "CostPrice:<nil>, "
  158. } else {
  159. ret += fmt.Sprintf("CostPrice:%v, ", *o.CostPrice)
  160. }
  161. if o.InvoiceId == nil {
  162. ret += "InvoiceId:<nil>, "
  163. } else {
  164. ret += fmt.Sprintf("InvoiceId:%v, ", *o.InvoiceId)
  165. }
  166. ret += fmt.Sprintf("GoodsDetail:%v", o.GoodsDetail)
  167. return fmt.Sprintf("Detail{%s}", ret)
  168. }
  169. func (o Detail) Clone() *Detail {
  170. ret := Detail{}
  171. if o.CostPrice != nil {
  172. ret.CostPrice = new(int64)
  173. *ret.CostPrice = *o.CostPrice
  174. }
  175. if o.InvoiceId != nil {
  176. ret.InvoiceId = new(string)
  177. *ret.InvoiceId = *o.InvoiceId
  178. }
  179. if o.GoodsDetail != nil {
  180. ret.GoodsDetail = make([]GoodsDetail, len(o.GoodsDetail))
  181. for i, item := range o.GoodsDetail {
  182. ret.GoodsDetail[i] = *item.Clone()
  183. }
  184. }
  185. return &ret
  186. }
  187. // GoodsDetail
  188. type GoodsDetail struct {
  189. // 由半角的大小写字母、数字、中划线、下划线中的一种或几种组成。
  190. MerchantGoodsId *string `json:"merchant_goods_id"`
  191. // 微信支付定义的统一商品编号(没有可不传)。
  192. WechatpayGoodsId *string `json:"wechatpay_goods_id,omitempty"`
  193. // 商品的实际名称。
  194. GoodsName *string `json:"goods_name,omitempty"`
  195. // 用户购买的数量。
  196. Quantity *int64 `json:"quantity"`
  197. // 商品单价,单位为分。
  198. UnitPrice *int64 `json:"unit_price"`
  199. }
  200. func (o GoodsDetail) MarshalJSON() ([]byte, error) {
  201. toSerialize := map[string]interface{}{}
  202. if o.MerchantGoodsId == nil {
  203. return nil, fmt.Errorf("field `MerchantGoodsId` is required and must be specified in GoodsDetail")
  204. }
  205. toSerialize["merchant_goods_id"] = o.MerchantGoodsId
  206. if o.WechatpayGoodsId != nil {
  207. toSerialize["wechatpay_goods_id"] = o.WechatpayGoodsId
  208. }
  209. if o.GoodsName != nil {
  210. toSerialize["goods_name"] = o.GoodsName
  211. }
  212. if o.Quantity == nil {
  213. return nil, fmt.Errorf("field `Quantity` is required and must be specified in GoodsDetail")
  214. }
  215. toSerialize["quantity"] = o.Quantity
  216. if o.UnitPrice == nil {
  217. return nil, fmt.Errorf("field `UnitPrice` is required and must be specified in GoodsDetail")
  218. }
  219. toSerialize["unit_price"] = o.UnitPrice
  220. return json.Marshal(toSerialize)
  221. }
  222. func (o GoodsDetail) String() string {
  223. var ret string
  224. if o.MerchantGoodsId == nil {
  225. ret += "MerchantGoodsId:<nil>, "
  226. } else {
  227. ret += fmt.Sprintf("MerchantGoodsId:%v, ", *o.MerchantGoodsId)
  228. }
  229. if o.WechatpayGoodsId == nil {
  230. ret += "WechatpayGoodsId:<nil>, "
  231. } else {
  232. ret += fmt.Sprintf("WechatpayGoodsId:%v, ", *o.WechatpayGoodsId)
  233. }
  234. if o.GoodsName == nil {
  235. ret += "GoodsName:<nil>, "
  236. } else {
  237. ret += fmt.Sprintf("GoodsName:%v, ", *o.GoodsName)
  238. }
  239. if o.Quantity == nil {
  240. ret += "Quantity:<nil>, "
  241. } else {
  242. ret += fmt.Sprintf("Quantity:%v, ", *o.Quantity)
  243. }
  244. if o.UnitPrice == nil {
  245. ret += "UnitPrice:<nil>"
  246. } else {
  247. ret += fmt.Sprintf("UnitPrice:%v", *o.UnitPrice)
  248. }
  249. return fmt.Sprintf("GoodsDetail{%s}", ret)
  250. }
  251. func (o GoodsDetail) Clone() *GoodsDetail {
  252. ret := GoodsDetail{}
  253. if o.MerchantGoodsId != nil {
  254. ret.MerchantGoodsId = new(string)
  255. *ret.MerchantGoodsId = *o.MerchantGoodsId
  256. }
  257. if o.WechatpayGoodsId != nil {
  258. ret.WechatpayGoodsId = new(string)
  259. *ret.WechatpayGoodsId = *o.WechatpayGoodsId
  260. }
  261. if o.GoodsName != nil {
  262. ret.GoodsName = new(string)
  263. *ret.GoodsName = *o.GoodsName
  264. }
  265. if o.Quantity != nil {
  266. ret.Quantity = new(int64)
  267. *ret.Quantity = *o.Quantity
  268. }
  269. if o.UnitPrice != nil {
  270. ret.UnitPrice = new(int64)
  271. *ret.UnitPrice = *o.UnitPrice
  272. }
  273. return &ret
  274. }
  275. // H5Info
  276. type H5Info struct {
  277. // 场景类型
  278. Type *string `json:"type"`
  279. // 应用名称
  280. AppName *string `json:"app_name,omitempty"`
  281. // 网站URL
  282. AppUrl *string `json:"app_url,omitempty"`
  283. // iOS平台BundleID
  284. BundleId *string `json:"bundle_id,omitempty"`
  285. // Android平台PackageName
  286. PackageName *string `json:"package_name,omitempty"`
  287. }
  288. func (o H5Info) MarshalJSON() ([]byte, error) {
  289. toSerialize := map[string]interface{}{}
  290. if o.Type == nil {
  291. return nil, fmt.Errorf("field `Type` is required and must be specified in H5Info")
  292. }
  293. toSerialize["type"] = o.Type
  294. if o.AppName != nil {
  295. toSerialize["app_name"] = o.AppName
  296. }
  297. if o.AppUrl != nil {
  298. toSerialize["app_url"] = o.AppUrl
  299. }
  300. if o.BundleId != nil {
  301. toSerialize["bundle_id"] = o.BundleId
  302. }
  303. if o.PackageName != nil {
  304. toSerialize["package_name"] = o.PackageName
  305. }
  306. return json.Marshal(toSerialize)
  307. }
  308. func (o H5Info) String() string {
  309. var ret string
  310. if o.Type == nil {
  311. ret += "Type:<nil>, "
  312. } else {
  313. ret += fmt.Sprintf("Type:%v, ", *o.Type)
  314. }
  315. if o.AppName == nil {
  316. ret += "AppName:<nil>, "
  317. } else {
  318. ret += fmt.Sprintf("AppName:%v, ", *o.AppName)
  319. }
  320. if o.AppUrl == nil {
  321. ret += "AppUrl:<nil>, "
  322. } else {
  323. ret += fmt.Sprintf("AppUrl:%v, ", *o.AppUrl)
  324. }
  325. if o.BundleId == nil {
  326. ret += "BundleId:<nil>, "
  327. } else {
  328. ret += fmt.Sprintf("BundleId:%v, ", *o.BundleId)
  329. }
  330. if o.PackageName == nil {
  331. ret += "PackageName:<nil>"
  332. } else {
  333. ret += fmt.Sprintf("PackageName:%v", *o.PackageName)
  334. }
  335. return fmt.Sprintf("H5Info{%s}", ret)
  336. }
  337. func (o H5Info) Clone() *H5Info {
  338. ret := H5Info{}
  339. if o.Type != nil {
  340. ret.Type = new(string)
  341. *ret.Type = *o.Type
  342. }
  343. if o.AppName != nil {
  344. ret.AppName = new(string)
  345. *ret.AppName = *o.AppName
  346. }
  347. if o.AppUrl != nil {
  348. ret.AppUrl = new(string)
  349. *ret.AppUrl = *o.AppUrl
  350. }
  351. if o.BundleId != nil {
  352. ret.BundleId = new(string)
  353. *ret.BundleId = *o.BundleId
  354. }
  355. if o.PackageName != nil {
  356. ret.PackageName = new(string)
  357. *ret.PackageName = *o.PackageName
  358. }
  359. return &ret
  360. }
  361. // PrepayRequest
  362. type PrepayRequest struct {
  363. // 公众号ID
  364. Appid *string `json:"appid"`
  365. // 直连商户号
  366. Mchid *string `json:"mchid"`
  367. // 商品描述
  368. Description *string `json:"description"`
  369. // 商户订单号
  370. OutTradeNo *string `json:"out_trade_no"`
  371. // 订单失效时间,格式为rfc3339格式
  372. TimeExpire *time.Time `json:"time_expire,omitempty"`
  373. // 附加数据
  374. Attach *string `json:"attach,omitempty"`
  375. // 有效性:1. HTTPS;2. 不允许携带查询串。
  376. NotifyUrl *string `json:"notify_url"`
  377. // 商品标记,代金券或立减优惠功能的参数。
  378. GoodsTag *string `json:"goods_tag,omitempty"`
  379. // 指定支付方式
  380. LimitPay []string `json:"limit_pay,omitempty"`
  381. // 传入true时,支付成功消息和支付详情页将出现开票入口。需要在微信支付商户平台或微信公众平台开通电子发票功能,传此字段才可生效。
  382. SupportFapiao *bool `json:"support_fapiao,omitempty"`
  383. Amount *Amount `json:"amount"`
  384. Detail *Detail `json:"detail,omitempty"`
  385. SceneInfo *SceneInfo `json:"scene_info"`
  386. SettleInfo *SettleInfo `json:"settle_info,omitempty"`
  387. }
  388. func (o PrepayRequest) MarshalJSON() ([]byte, error) {
  389. toSerialize := map[string]interface{}{}
  390. if o.Appid == nil {
  391. return nil, fmt.Errorf("field `Appid` is required and must be specified in PrepayRequest")
  392. }
  393. toSerialize["appid"] = o.Appid
  394. if o.Mchid == nil {
  395. return nil, fmt.Errorf("field `Mchid` is required and must be specified in PrepayRequest")
  396. }
  397. toSerialize["mchid"] = o.Mchid
  398. if o.Description == nil {
  399. return nil, fmt.Errorf("field `Description` is required and must be specified in PrepayRequest")
  400. }
  401. toSerialize["description"] = o.Description
  402. if o.OutTradeNo == nil {
  403. return nil, fmt.Errorf("field `OutTradeNo` is required and must be specified in PrepayRequest")
  404. }
  405. toSerialize["out_trade_no"] = o.OutTradeNo
  406. if o.TimeExpire != nil {
  407. toSerialize["time_expire"] = o.TimeExpire.Format(time.RFC3339)
  408. }
  409. if o.Attach != nil {
  410. toSerialize["attach"] = o.Attach
  411. }
  412. if o.NotifyUrl == nil {
  413. return nil, fmt.Errorf("field `NotifyUrl` is required and must be specified in PrepayRequest")
  414. }
  415. toSerialize["notify_url"] = o.NotifyUrl
  416. if o.GoodsTag != nil {
  417. toSerialize["goods_tag"] = o.GoodsTag
  418. }
  419. if o.LimitPay != nil {
  420. toSerialize["limit_pay"] = o.LimitPay
  421. }
  422. if o.SupportFapiao != nil {
  423. toSerialize["support_fapiao"] = o.SupportFapiao
  424. }
  425. if o.Amount == nil {
  426. return nil, fmt.Errorf("field `Amount` is required and must be specified in PrepayRequest")
  427. }
  428. toSerialize["amount"] = o.Amount
  429. if o.Detail != nil {
  430. toSerialize["detail"] = o.Detail
  431. }
  432. if o.SceneInfo == nil {
  433. return nil, fmt.Errorf("field `SceneInfo` is required and must be specified in PrepayRequest")
  434. }
  435. toSerialize["scene_info"] = o.SceneInfo
  436. if o.SettleInfo != nil {
  437. toSerialize["settle_info"] = o.SettleInfo
  438. }
  439. return json.Marshal(toSerialize)
  440. }
  441. func (o PrepayRequest) String() string {
  442. var ret string
  443. if o.Appid == nil {
  444. ret += "Appid:<nil>, "
  445. } else {
  446. ret += fmt.Sprintf("Appid:%v, ", *o.Appid)
  447. }
  448. if o.Mchid == nil {
  449. ret += "Mchid:<nil>, "
  450. } else {
  451. ret += fmt.Sprintf("Mchid:%v, ", *o.Mchid)
  452. }
  453. if o.Description == nil {
  454. ret += "Description:<nil>, "
  455. } else {
  456. ret += fmt.Sprintf("Description:%v, ", *o.Description)
  457. }
  458. if o.OutTradeNo == nil {
  459. ret += "OutTradeNo:<nil>, "
  460. } else {
  461. ret += fmt.Sprintf("OutTradeNo:%v, ", *o.OutTradeNo)
  462. }
  463. if o.TimeExpire == nil {
  464. ret += "TimeExpire:<nil>, "
  465. } else {
  466. ret += fmt.Sprintf("TimeExpire:%v, ", *o.TimeExpire)
  467. }
  468. if o.Attach == nil {
  469. ret += "Attach:<nil>, "
  470. } else {
  471. ret += fmt.Sprintf("Attach:%v, ", *o.Attach)
  472. }
  473. if o.NotifyUrl == nil {
  474. ret += "NotifyUrl:<nil>, "
  475. } else {
  476. ret += fmt.Sprintf("NotifyUrl:%v, ", *o.NotifyUrl)
  477. }
  478. if o.GoodsTag == nil {
  479. ret += "GoodsTag:<nil>, "
  480. } else {
  481. ret += fmt.Sprintf("GoodsTag:%v, ", *o.GoodsTag)
  482. }
  483. ret += fmt.Sprintf("LimitPay:%v, ", o.LimitPay)
  484. if o.SupportFapiao == nil {
  485. ret += "SupportFapiao:<nil>, "
  486. } else {
  487. ret += fmt.Sprintf("SupportFapiao:%v, ", *o.SupportFapiao)
  488. }
  489. ret += fmt.Sprintf("Amount:%v, ", o.Amount)
  490. ret += fmt.Sprintf("Detail:%v, ", o.Detail)
  491. ret += fmt.Sprintf("SceneInfo:%v, ", o.SceneInfo)
  492. ret += fmt.Sprintf("SettleInfo:%v", o.SettleInfo)
  493. return fmt.Sprintf("PrepayRequest{%s}", ret)
  494. }
  495. func (o PrepayRequest) Clone() *PrepayRequest {
  496. ret := PrepayRequest{}
  497. if o.Appid != nil {
  498. ret.Appid = new(string)
  499. *ret.Appid = *o.Appid
  500. }
  501. if o.Mchid != nil {
  502. ret.Mchid = new(string)
  503. *ret.Mchid = *o.Mchid
  504. }
  505. if o.Description != nil {
  506. ret.Description = new(string)
  507. *ret.Description = *o.Description
  508. }
  509. if o.OutTradeNo != nil {
  510. ret.OutTradeNo = new(string)
  511. *ret.OutTradeNo = *o.OutTradeNo
  512. }
  513. if o.TimeExpire != nil {
  514. ret.TimeExpire = new(time.Time)
  515. *ret.TimeExpire = *o.TimeExpire
  516. }
  517. if o.Attach != nil {
  518. ret.Attach = new(string)
  519. *ret.Attach = *o.Attach
  520. }
  521. if o.NotifyUrl != nil {
  522. ret.NotifyUrl = new(string)
  523. *ret.NotifyUrl = *o.NotifyUrl
  524. }
  525. if o.GoodsTag != nil {
  526. ret.GoodsTag = new(string)
  527. *ret.GoodsTag = *o.GoodsTag
  528. }
  529. if o.LimitPay != nil {
  530. ret.LimitPay = make([]string, len(o.LimitPay))
  531. for i, item := range o.LimitPay {
  532. ret.LimitPay[i] = item
  533. }
  534. }
  535. if o.SupportFapiao != nil {
  536. ret.SupportFapiao = new(bool)
  537. *ret.SupportFapiao = *o.SupportFapiao
  538. }
  539. if o.Amount != nil {
  540. ret.Amount = o.Amount.Clone()
  541. }
  542. if o.Detail != nil {
  543. ret.Detail = o.Detail.Clone()
  544. }
  545. if o.SceneInfo != nil {
  546. ret.SceneInfo = o.SceneInfo.Clone()
  547. }
  548. if o.SettleInfo != nil {
  549. ret.SettleInfo = o.SettleInfo.Clone()
  550. }
  551. return &ret
  552. }
  553. // PrepayResponse
  554. type PrepayResponse struct {
  555. // 支付跳转链接
  556. H5Url *string `json:"h5_url"`
  557. }
  558. func (o PrepayResponse) MarshalJSON() ([]byte, error) {
  559. toSerialize := map[string]interface{}{}
  560. if o.H5Url == nil {
  561. return nil, fmt.Errorf("field `H5Url` is required and must be specified in PrepayResponse")
  562. }
  563. toSerialize["h5_url"] = o.H5Url
  564. return json.Marshal(toSerialize)
  565. }
  566. func (o PrepayResponse) String() string {
  567. var ret string
  568. if o.H5Url == nil {
  569. ret += "H5Url:<nil>"
  570. } else {
  571. ret += fmt.Sprintf("H5Url:%v", *o.H5Url)
  572. }
  573. return fmt.Sprintf("PrepayResponse{%s}", ret)
  574. }
  575. func (o PrepayResponse) Clone() *PrepayResponse {
  576. ret := PrepayResponse{}
  577. if o.H5Url != nil {
  578. ret.H5Url = new(string)
  579. *ret.H5Url = *o.H5Url
  580. }
  581. return &ret
  582. }
  583. // QueryOrderByIdRequest
  584. type QueryOrderByIdRequest struct {
  585. TransactionId *string `json:"transaction_id"`
  586. // 直连商户号
  587. Mchid *string `json:"mchid"`
  588. }
  589. func (o QueryOrderByIdRequest) MarshalJSON() ([]byte, error) {
  590. toSerialize := map[string]interface{}{}
  591. if o.TransactionId == nil {
  592. return nil, fmt.Errorf("field `TransactionId` is required and must be specified in QueryOrderByIdRequest")
  593. }
  594. toSerialize["transaction_id"] = o.TransactionId
  595. if o.Mchid == nil {
  596. return nil, fmt.Errorf("field `Mchid` is required and must be specified in QueryOrderByIdRequest")
  597. }
  598. toSerialize["mchid"] = o.Mchid
  599. return json.Marshal(toSerialize)
  600. }
  601. func (o QueryOrderByIdRequest) String() string {
  602. var ret string
  603. if o.TransactionId == nil {
  604. ret += "TransactionId:<nil>, "
  605. } else {
  606. ret += fmt.Sprintf("TransactionId:%v, ", *o.TransactionId)
  607. }
  608. if o.Mchid == nil {
  609. ret += "Mchid:<nil>"
  610. } else {
  611. ret += fmt.Sprintf("Mchid:%v", *o.Mchid)
  612. }
  613. return fmt.Sprintf("QueryOrderByIdRequest{%s}", ret)
  614. }
  615. func (o QueryOrderByIdRequest) Clone() *QueryOrderByIdRequest {
  616. ret := QueryOrderByIdRequest{}
  617. if o.TransactionId != nil {
  618. ret.TransactionId = new(string)
  619. *ret.TransactionId = *o.TransactionId
  620. }
  621. if o.Mchid != nil {
  622. ret.Mchid = new(string)
  623. *ret.Mchid = *o.Mchid
  624. }
  625. return &ret
  626. }
  627. // QueryOrderByOutTradeNoRequest
  628. type QueryOrderByOutTradeNoRequest struct {
  629. OutTradeNo *string `json:"out_trade_no"`
  630. // 直连商户号
  631. Mchid *string `json:"mchid"`
  632. }
  633. func (o QueryOrderByOutTradeNoRequest) MarshalJSON() ([]byte, error) {
  634. toSerialize := map[string]interface{}{}
  635. if o.OutTradeNo == nil {
  636. return nil, fmt.Errorf("field `OutTradeNo` is required and must be specified in QueryOrderByOutTradeNoRequest")
  637. }
  638. toSerialize["out_trade_no"] = o.OutTradeNo
  639. if o.Mchid == nil {
  640. return nil, fmt.Errorf("field `Mchid` is required and must be specified in QueryOrderByOutTradeNoRequest")
  641. }
  642. toSerialize["mchid"] = o.Mchid
  643. return json.Marshal(toSerialize)
  644. }
  645. func (o QueryOrderByOutTradeNoRequest) String() string {
  646. var ret string
  647. if o.OutTradeNo == nil {
  648. ret += "OutTradeNo:<nil>, "
  649. } else {
  650. ret += fmt.Sprintf("OutTradeNo:%v, ", *o.OutTradeNo)
  651. }
  652. if o.Mchid == nil {
  653. ret += "Mchid:<nil>"
  654. } else {
  655. ret += fmt.Sprintf("Mchid:%v", *o.Mchid)
  656. }
  657. return fmt.Sprintf("QueryOrderByOutTradeNoRequest{%s}", ret)
  658. }
  659. func (o QueryOrderByOutTradeNoRequest) Clone() *QueryOrderByOutTradeNoRequest {
  660. ret := QueryOrderByOutTradeNoRequest{}
  661. if o.OutTradeNo != nil {
  662. ret.OutTradeNo = new(string)
  663. *ret.OutTradeNo = *o.OutTradeNo
  664. }
  665. if o.Mchid != nil {
  666. ret.Mchid = new(string)
  667. *ret.Mchid = *o.Mchid
  668. }
  669. return &ret
  670. }
  671. // SceneInfo 支付场景描述
  672. type SceneInfo struct {
  673. // 用户终端IP
  674. PayerClientIp *string `json:"payer_client_ip"`
  675. // 商户端设备号
  676. DeviceId *string `json:"device_id,omitempty"`
  677. StoreInfo *StoreInfo `json:"store_info,omitempty"`
  678. }
  679. func (o SceneInfo) MarshalJSON() ([]byte, error) {
  680. toSerialize := map[string]interface{}{}
  681. if o.PayerClientIp == nil {
  682. return nil, fmt.Errorf("field `PayerClientIp` is required and must be specified in SceneInfo")
  683. }
  684. toSerialize["payer_client_ip"] = o.PayerClientIp
  685. if o.DeviceId != nil {
  686. toSerialize["device_id"] = o.DeviceId
  687. }
  688. if o.StoreInfo != nil {
  689. toSerialize["store_info"] = o.StoreInfo
  690. }
  691. return json.Marshal(toSerialize)
  692. }
  693. func (o SceneInfo) String() string {
  694. var ret string
  695. if o.PayerClientIp == nil {
  696. ret += "PayerClientIp:<nil>, "
  697. } else {
  698. ret += fmt.Sprintf("PayerClientIp:%v, ", *o.PayerClientIp)
  699. }
  700. if o.DeviceId == nil {
  701. ret += "DeviceId:<nil>, "
  702. } else {
  703. ret += fmt.Sprintf("DeviceId:%v, ", *o.DeviceId)
  704. }
  705. ret += fmt.Sprintf("StoreInfo:%v, ", o.StoreInfo)
  706. return fmt.Sprintf("SceneInfo{%s}", ret)
  707. }
  708. func (o SceneInfo) Clone() *SceneInfo {
  709. ret := SceneInfo{}
  710. if o.PayerClientIp != nil {
  711. ret.PayerClientIp = new(string)
  712. *ret.PayerClientIp = *o.PayerClientIp
  713. }
  714. if o.DeviceId != nil {
  715. ret.DeviceId = new(string)
  716. *ret.DeviceId = *o.DeviceId
  717. }
  718. if o.StoreInfo != nil {
  719. ret.StoreInfo = o.StoreInfo.Clone()
  720. }
  721. return &ret
  722. }
  723. // SettleInfo
  724. type SettleInfo struct {
  725. // 是否指定分账
  726. ProfitSharing *bool `json:"profit_sharing,omitempty"`
  727. }
  728. func (o SettleInfo) MarshalJSON() ([]byte, error) {
  729. toSerialize := map[string]interface{}{}
  730. if o.ProfitSharing != nil {
  731. toSerialize["profit_sharing"] = o.ProfitSharing
  732. }
  733. return json.Marshal(toSerialize)
  734. }
  735. func (o SettleInfo) String() string {
  736. var ret string
  737. if o.ProfitSharing == nil {
  738. ret += "ProfitSharing:<nil>"
  739. } else {
  740. ret += fmt.Sprintf("ProfitSharing:%v", *o.ProfitSharing)
  741. }
  742. return fmt.Sprintf("SettleInfo{%s}", ret)
  743. }
  744. func (o SettleInfo) Clone() *SettleInfo {
  745. ret := SettleInfo{}
  746. if o.ProfitSharing != nil {
  747. ret.ProfitSharing = new(bool)
  748. *ret.ProfitSharing = *o.ProfitSharing
  749. }
  750. return &ret
  751. }
  752. // StoreInfo 商户门店信息
  753. type StoreInfo struct {
  754. // 商户侧门店编号
  755. Id *string `json:"id"`
  756. // 商户侧门店名称
  757. Name *string `json:"name,omitempty"`
  758. // 地区编码,详细请见微信支付提供的文档
  759. AreaCode *string `json:"area_code,omitempty"`
  760. // 详细的商户门店地址
  761. Address *string `json:"address,omitempty"`
  762. }
  763. func (o StoreInfo) MarshalJSON() ([]byte, error) {
  764. toSerialize := map[string]interface{}{}
  765. if o.Id == nil {
  766. return nil, fmt.Errorf("field `Id` is required and must be specified in StoreInfo")
  767. }
  768. toSerialize["id"] = o.Id
  769. if o.Name != nil {
  770. toSerialize["name"] = o.Name
  771. }
  772. if o.AreaCode != nil {
  773. toSerialize["area_code"] = o.AreaCode
  774. }
  775. if o.Address != nil {
  776. toSerialize["address"] = o.Address
  777. }
  778. return json.Marshal(toSerialize)
  779. }
  780. func (o StoreInfo) String() string {
  781. var ret string
  782. if o.Id == nil {
  783. ret += "Id:<nil>, "
  784. } else {
  785. ret += fmt.Sprintf("Id:%v, ", *o.Id)
  786. }
  787. if o.Name == nil {
  788. ret += "Name:<nil>, "
  789. } else {
  790. ret += fmt.Sprintf("Name:%v, ", *o.Name)
  791. }
  792. if o.AreaCode == nil {
  793. ret += "AreaCode:<nil>, "
  794. } else {
  795. ret += fmt.Sprintf("AreaCode:%v, ", *o.AreaCode)
  796. }
  797. if o.Address == nil {
  798. ret += "Address:<nil>"
  799. } else {
  800. ret += fmt.Sprintf("Address:%v", *o.Address)
  801. }
  802. return fmt.Sprintf("StoreInfo{%s}", ret)
  803. }
  804. func (o StoreInfo) Clone() *StoreInfo {
  805. ret := StoreInfo{}
  806. if o.Id != nil {
  807. ret.Id = new(string)
  808. *ret.Id = *o.Id
  809. }
  810. if o.Name != nil {
  811. ret.Name = new(string)
  812. *ret.Name = *o.Name
  813. }
  814. if o.AreaCode != nil {
  815. ret.AreaCode = new(string)
  816. *ret.AreaCode = *o.AreaCode
  817. }
  818. if o.Address != nil {
  819. ret.Address = new(string)
  820. *ret.Address = *o.Address
  821. }
  822. return &ret
  823. }