models.go 25 KB

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