models.go 25 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144
  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. return json.Marshal(toSerialize)
  785. }
  786. func (o SceneInfo) String() string {
  787. var ret string
  788. if o.PayerClientIp == nil {
  789. ret += "PayerClientIp:<nil>, "
  790. } else {
  791. ret += fmt.Sprintf("PayerClientIp:%v, ", *o.PayerClientIp)
  792. }
  793. if o.DeviceId == nil {
  794. ret += "DeviceId:<nil>, "
  795. } else {
  796. ret += fmt.Sprintf("DeviceId:%v, ", *o.DeviceId)
  797. }
  798. ret += fmt.Sprintf("StoreInfo:%v, ", o.StoreInfo)
  799. ret += fmt.Sprintf("H5Info:%v", o.H5Info)
  800. return fmt.Sprintf("SceneInfo{%s}", ret)
  801. }
  802. func (o SceneInfo) Clone() *SceneInfo {
  803. ret := SceneInfo{}
  804. if o.PayerClientIp != nil {
  805. ret.PayerClientIp = new(string)
  806. *ret.PayerClientIp = *o.PayerClientIp
  807. }
  808. if o.DeviceId != nil {
  809. ret.DeviceId = new(string)
  810. *ret.DeviceId = *o.DeviceId
  811. }
  812. if o.StoreInfo != nil {
  813. ret.StoreInfo = o.StoreInfo.Clone()
  814. }
  815. if o.H5Info != nil {
  816. ret.H5Info = o.H5Info.Clone()
  817. }
  818. return &ret
  819. }
  820. // SettleInfo
  821. type SettleInfo struct {
  822. // 是否指定分账
  823. ProfitSharing *bool `json:"profit_sharing,omitempty"`
  824. }
  825. func (o SettleInfo) MarshalJSON() ([]byte, error) {
  826. toSerialize := map[string]interface{}{}
  827. if o.ProfitSharing != nil {
  828. toSerialize["profit_sharing"] = o.ProfitSharing
  829. }
  830. return json.Marshal(toSerialize)
  831. }
  832. func (o SettleInfo) String() string {
  833. var ret string
  834. if o.ProfitSharing == nil {
  835. ret += "ProfitSharing:<nil>"
  836. } else {
  837. ret += fmt.Sprintf("ProfitSharing:%v", *o.ProfitSharing)
  838. }
  839. return fmt.Sprintf("SettleInfo{%s}", ret)
  840. }
  841. func (o SettleInfo) Clone() *SettleInfo {
  842. ret := SettleInfo{}
  843. if o.ProfitSharing != nil {
  844. ret.ProfitSharing = new(bool)
  845. *ret.ProfitSharing = *o.ProfitSharing
  846. }
  847. return &ret
  848. }
  849. // StoreInfo 商户门店信息
  850. type StoreInfo struct {
  851. // 商户侧门店编号
  852. Id *string `json:"id"`
  853. // 商户侧门店名称
  854. Name *string `json:"name,omitempty"`
  855. // 地区编码,详细请见微信支付提供的文档
  856. AreaCode *string `json:"area_code,omitempty"`
  857. // 详细的商户门店地址
  858. Address *string `json:"address,omitempty"`
  859. }
  860. func (o StoreInfo) MarshalJSON() ([]byte, error) {
  861. toSerialize := map[string]interface{}{}
  862. if o.Id != nil {
  863. toSerialize["id"] = o.Id
  864. }
  865. if o.Name != nil {
  866. toSerialize["name"] = o.Name
  867. }
  868. if o.AreaCode != nil {
  869. toSerialize["area_code"] = o.AreaCode
  870. }
  871. if o.Address != nil {
  872. toSerialize["address"] = o.Address
  873. }
  874. return json.Marshal(toSerialize)
  875. }
  876. func (o StoreInfo) String() string {
  877. var ret string
  878. if o.Id == nil {
  879. ret += "Id:<nil>, "
  880. } else {
  881. ret += fmt.Sprintf("Id:%v, ", *o.Id)
  882. }
  883. if o.Name == nil {
  884. ret += "Name:<nil>, "
  885. } else {
  886. ret += fmt.Sprintf("Name:%v, ", *o.Name)
  887. }
  888. if o.AreaCode == nil {
  889. ret += "AreaCode:<nil>, "
  890. } else {
  891. ret += fmt.Sprintf("AreaCode:%v, ", *o.AreaCode)
  892. }
  893. if o.Address == nil {
  894. ret += "Address:<nil>"
  895. } else {
  896. ret += fmt.Sprintf("Address:%v", *o.Address)
  897. }
  898. return fmt.Sprintf("StoreInfo{%s}", ret)
  899. }
  900. func (o StoreInfo) Clone() *StoreInfo {
  901. ret := StoreInfo{}
  902. if o.Id != nil {
  903. ret.Id = new(string)
  904. *ret.Id = *o.Id
  905. }
  906. if o.Name != nil {
  907. ret.Name = new(string)
  908. *ret.Name = *o.Name
  909. }
  910. if o.AreaCode != nil {
  911. ret.AreaCode = new(string)
  912. *ret.AreaCode = *o.AreaCode
  913. }
  914. if o.Address != nil {
  915. ret.Address = new(string)
  916. *ret.Address = *o.Address
  917. }
  918. return &ret
  919. }