models.go 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032
  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. TradeType *string `json:"trade_type,omitempty"`
  389. }
  390. func (o PrepayRequest) MarshalJSON() ([]byte, error) {
  391. toSerialize := map[string]interface{}{}
  392. if o.Appid == nil {
  393. return nil, fmt.Errorf("field `Appid` is required and must be specified in PrepayRequest")
  394. }
  395. toSerialize["appid"] = o.Appid
  396. if o.Mchid == nil {
  397. return nil, fmt.Errorf("field `Mchid` is required and must be specified in PrepayRequest")
  398. }
  399. toSerialize["mchid"] = o.Mchid
  400. if o.Description == nil {
  401. return nil, fmt.Errorf("field `Description` is required and must be specified in PrepayRequest")
  402. }
  403. toSerialize["description"] = o.Description
  404. if o.OutTradeNo == nil {
  405. return nil, fmt.Errorf("field `OutTradeNo` is required and must be specified in PrepayRequest")
  406. }
  407. toSerialize["out_trade_no"] = o.OutTradeNo
  408. if o.TimeExpire != nil {
  409. toSerialize["time_expire"] = o.TimeExpire.Format(time.RFC3339)
  410. }
  411. if o.Attach != nil {
  412. toSerialize["attach"] = o.Attach
  413. }
  414. if o.NotifyUrl == nil {
  415. return nil, fmt.Errorf("field `NotifyUrl` is required and must be specified in PrepayRequest")
  416. }
  417. toSerialize["notify_url"] = o.NotifyUrl
  418. if o.GoodsTag != nil {
  419. toSerialize["goods_tag"] = o.GoodsTag
  420. }
  421. if o.LimitPay != nil {
  422. toSerialize["limit_pay"] = o.LimitPay
  423. }
  424. if o.SupportFapiao != nil {
  425. toSerialize["support_fapiao"] = o.SupportFapiao
  426. }
  427. if o.Amount == nil {
  428. return nil, fmt.Errorf("field `Amount` is required and must be specified in PrepayRequest")
  429. }
  430. toSerialize["amount"] = o.Amount
  431. if o.Detail != nil {
  432. toSerialize["detail"] = o.Detail
  433. }
  434. if o.SceneInfo == nil {
  435. return nil, fmt.Errorf("field `SceneInfo` is required and must be specified in PrepayRequest")
  436. }
  437. toSerialize["scene_info"] = o.SceneInfo
  438. if o.SettleInfo != nil {
  439. toSerialize["settle_info"] = o.SettleInfo
  440. }
  441. return json.Marshal(toSerialize)
  442. }
  443. func (o PrepayRequest) String() string {
  444. var ret string
  445. if o.Appid == nil {
  446. ret += "Appid:<nil>, "
  447. } else {
  448. ret += fmt.Sprintf("Appid:%v, ", *o.Appid)
  449. }
  450. if o.Mchid == nil {
  451. ret += "Mchid:<nil>, "
  452. } else {
  453. ret += fmt.Sprintf("Mchid:%v, ", *o.Mchid)
  454. }
  455. if o.Description == nil {
  456. ret += "Description:<nil>, "
  457. } else {
  458. ret += fmt.Sprintf("Description:%v, ", *o.Description)
  459. }
  460. if o.OutTradeNo == nil {
  461. ret += "OutTradeNo:<nil>, "
  462. } else {
  463. ret += fmt.Sprintf("OutTradeNo:%v, ", *o.OutTradeNo)
  464. }
  465. if o.TimeExpire == nil {
  466. ret += "TimeExpire:<nil>, "
  467. } else {
  468. ret += fmt.Sprintf("TimeExpire:%v, ", *o.TimeExpire)
  469. }
  470. if o.Attach == nil {
  471. ret += "Attach:<nil>, "
  472. } else {
  473. ret += fmt.Sprintf("Attach:%v, ", *o.Attach)
  474. }
  475. if o.NotifyUrl == nil {
  476. ret += "NotifyUrl:<nil>, "
  477. } else {
  478. ret += fmt.Sprintf("NotifyUrl:%v, ", *o.NotifyUrl)
  479. }
  480. if o.GoodsTag == nil {
  481. ret += "GoodsTag:<nil>, "
  482. } else {
  483. ret += fmt.Sprintf("GoodsTag:%v, ", *o.GoodsTag)
  484. }
  485. ret += fmt.Sprintf("LimitPay:%v, ", o.LimitPay)
  486. if o.SupportFapiao == nil {
  487. ret += "SupportFapiao:<nil>, "
  488. } else {
  489. ret += fmt.Sprintf("SupportFapiao:%v, ", *o.SupportFapiao)
  490. }
  491. ret += fmt.Sprintf("Amount:%v, ", o.Amount)
  492. ret += fmt.Sprintf("Detail:%v, ", o.Detail)
  493. ret += fmt.Sprintf("SceneInfo:%v, ", o.SceneInfo)
  494. ret += fmt.Sprintf("SettleInfo:%v", o.SettleInfo)
  495. return fmt.Sprintf("PrepayRequest{%s}", ret)
  496. }
  497. func (o PrepayRequest) Clone() *PrepayRequest {
  498. ret := PrepayRequest{}
  499. if o.Appid != nil {
  500. ret.Appid = new(string)
  501. *ret.Appid = *o.Appid
  502. }
  503. if o.Mchid != nil {
  504. ret.Mchid = new(string)
  505. *ret.Mchid = *o.Mchid
  506. }
  507. if o.Description != nil {
  508. ret.Description = new(string)
  509. *ret.Description = *o.Description
  510. }
  511. if o.OutTradeNo != nil {
  512. ret.OutTradeNo = new(string)
  513. *ret.OutTradeNo = *o.OutTradeNo
  514. }
  515. if o.TimeExpire != nil {
  516. ret.TimeExpire = new(time.Time)
  517. *ret.TimeExpire = *o.TimeExpire
  518. }
  519. if o.Attach != nil {
  520. ret.Attach = new(string)
  521. *ret.Attach = *o.Attach
  522. }
  523. if o.NotifyUrl != nil {
  524. ret.NotifyUrl = new(string)
  525. *ret.NotifyUrl = *o.NotifyUrl
  526. }
  527. if o.GoodsTag != nil {
  528. ret.GoodsTag = new(string)
  529. *ret.GoodsTag = *o.GoodsTag
  530. }
  531. if o.LimitPay != nil {
  532. ret.LimitPay = make([]string, len(o.LimitPay))
  533. for i, item := range o.LimitPay {
  534. ret.LimitPay[i] = item
  535. }
  536. }
  537. if o.SupportFapiao != nil {
  538. ret.SupportFapiao = new(bool)
  539. *ret.SupportFapiao = *o.SupportFapiao
  540. }
  541. if o.Amount != nil {
  542. ret.Amount = o.Amount.Clone()
  543. }
  544. if o.Detail != nil {
  545. ret.Detail = o.Detail.Clone()
  546. }
  547. if o.SceneInfo != nil {
  548. ret.SceneInfo = o.SceneInfo.Clone()
  549. }
  550. if o.SettleInfo != nil {
  551. ret.SettleInfo = o.SettleInfo.Clone()
  552. }
  553. return &ret
  554. }
  555. // PrepayResponse
  556. type PrepayResponse struct {
  557. // 支付跳转链接
  558. H5Url *string `json:"h5_url"`
  559. }
  560. func (o PrepayResponse) MarshalJSON() ([]byte, error) {
  561. toSerialize := map[string]interface{}{}
  562. if o.H5Url == nil {
  563. return nil, fmt.Errorf("field `H5Url` is required and must be specified in PrepayResponse")
  564. }
  565. toSerialize["h5_url"] = o.H5Url
  566. return json.Marshal(toSerialize)
  567. }
  568. func (o PrepayResponse) String() string {
  569. var ret string
  570. if o.H5Url == nil {
  571. ret += "H5Url:<nil>"
  572. } else {
  573. ret += fmt.Sprintf("H5Url:%v", *o.H5Url)
  574. }
  575. return fmt.Sprintf("PrepayResponse{%s}", ret)
  576. }
  577. func (o PrepayResponse) Clone() *PrepayResponse {
  578. ret := PrepayResponse{}
  579. if o.H5Url != nil {
  580. ret.H5Url = new(string)
  581. *ret.H5Url = *o.H5Url
  582. }
  583. return &ret
  584. }
  585. // QueryOrderByIdRequest
  586. type QueryOrderByIdRequest struct {
  587. TransactionId *string `json:"transaction_id"`
  588. // 直连商户号
  589. Mchid *string `json:"mchid"`
  590. }
  591. func (o QueryOrderByIdRequest) MarshalJSON() ([]byte, error) {
  592. toSerialize := map[string]interface{}{}
  593. if o.TransactionId == nil {
  594. return nil, fmt.Errorf("field `TransactionId` is required and must be specified in QueryOrderByIdRequest")
  595. }
  596. toSerialize["transaction_id"] = o.TransactionId
  597. if o.Mchid == nil {
  598. return nil, fmt.Errorf("field `Mchid` is required and must be specified in QueryOrderByIdRequest")
  599. }
  600. toSerialize["mchid"] = o.Mchid
  601. return json.Marshal(toSerialize)
  602. }
  603. func (o QueryOrderByIdRequest) String() string {
  604. var ret string
  605. if o.TransactionId == nil {
  606. ret += "TransactionId:<nil>, "
  607. } else {
  608. ret += fmt.Sprintf("TransactionId:%v, ", *o.TransactionId)
  609. }
  610. if o.Mchid == nil {
  611. ret += "Mchid:<nil>"
  612. } else {
  613. ret += fmt.Sprintf("Mchid:%v", *o.Mchid)
  614. }
  615. return fmt.Sprintf("QueryOrderByIdRequest{%s}", ret)
  616. }
  617. func (o QueryOrderByIdRequest) Clone() *QueryOrderByIdRequest {
  618. ret := QueryOrderByIdRequest{}
  619. if o.TransactionId != nil {
  620. ret.TransactionId = new(string)
  621. *ret.TransactionId = *o.TransactionId
  622. }
  623. if o.Mchid != nil {
  624. ret.Mchid = new(string)
  625. *ret.Mchid = *o.Mchid
  626. }
  627. return &ret
  628. }
  629. // QueryOrderByOutTradeNoRequest
  630. type QueryOrderByOutTradeNoRequest struct {
  631. OutTradeNo *string `json:"out_trade_no"`
  632. // 直连商户号
  633. Mchid *string `json:"mchid"`
  634. }
  635. func (o QueryOrderByOutTradeNoRequest) MarshalJSON() ([]byte, error) {
  636. toSerialize := map[string]interface{}{}
  637. if o.OutTradeNo == nil {
  638. return nil, fmt.Errorf("field `OutTradeNo` is required and must be specified in QueryOrderByOutTradeNoRequest")
  639. }
  640. toSerialize["out_trade_no"] = o.OutTradeNo
  641. if o.Mchid == nil {
  642. return nil, fmt.Errorf("field `Mchid` is required and must be specified in QueryOrderByOutTradeNoRequest")
  643. }
  644. toSerialize["mchid"] = o.Mchid
  645. return json.Marshal(toSerialize)
  646. }
  647. func (o QueryOrderByOutTradeNoRequest) String() string {
  648. var ret string
  649. if o.OutTradeNo == nil {
  650. ret += "OutTradeNo:<nil>, "
  651. } else {
  652. ret += fmt.Sprintf("OutTradeNo:%v, ", *o.OutTradeNo)
  653. }
  654. if o.Mchid == nil {
  655. ret += "Mchid:<nil>"
  656. } else {
  657. ret += fmt.Sprintf("Mchid:%v", *o.Mchid)
  658. }
  659. return fmt.Sprintf("QueryOrderByOutTradeNoRequest{%s}", ret)
  660. }
  661. func (o QueryOrderByOutTradeNoRequest) Clone() *QueryOrderByOutTradeNoRequest {
  662. ret := QueryOrderByOutTradeNoRequest{}
  663. if o.OutTradeNo != nil {
  664. ret.OutTradeNo = new(string)
  665. *ret.OutTradeNo = *o.OutTradeNo
  666. }
  667. if o.Mchid != nil {
  668. ret.Mchid = new(string)
  669. *ret.Mchid = *o.Mchid
  670. }
  671. return &ret
  672. }
  673. // SceneInfo 支付场景描述
  674. type SceneInfo struct {
  675. // 用户终端IP
  676. PayerClientIp *string `json:"payer_client_ip"`
  677. // 商户端设备号
  678. DeviceId *string `json:"device_id,omitempty"`
  679. StoreInfo *StoreInfo `json:"store_info,omitempty"`
  680. }
  681. func (o SceneInfo) MarshalJSON() ([]byte, error) {
  682. toSerialize := map[string]interface{}{}
  683. if o.PayerClientIp == nil {
  684. return nil, fmt.Errorf("field `PayerClientIp` is required and must be specified in SceneInfo")
  685. }
  686. toSerialize["payer_client_ip"] = o.PayerClientIp
  687. if o.DeviceId != nil {
  688. toSerialize["device_id"] = o.DeviceId
  689. }
  690. if o.StoreInfo != nil {
  691. toSerialize["store_info"] = o.StoreInfo
  692. }
  693. return json.Marshal(toSerialize)
  694. }
  695. func (o SceneInfo) String() string {
  696. var ret string
  697. if o.PayerClientIp == nil {
  698. ret += "PayerClientIp:<nil>, "
  699. } else {
  700. ret += fmt.Sprintf("PayerClientIp:%v, ", *o.PayerClientIp)
  701. }
  702. if o.DeviceId == nil {
  703. ret += "DeviceId:<nil>, "
  704. } else {
  705. ret += fmt.Sprintf("DeviceId:%v, ", *o.DeviceId)
  706. }
  707. ret += fmt.Sprintf("StoreInfo:%v, ", o.StoreInfo)
  708. return fmt.Sprintf("SceneInfo{%s}", ret)
  709. }
  710. func (o SceneInfo) Clone() *SceneInfo {
  711. ret := SceneInfo{}
  712. if o.PayerClientIp != nil {
  713. ret.PayerClientIp = new(string)
  714. *ret.PayerClientIp = *o.PayerClientIp
  715. }
  716. if o.DeviceId != nil {
  717. ret.DeviceId = new(string)
  718. *ret.DeviceId = *o.DeviceId
  719. }
  720. if o.StoreInfo != nil {
  721. ret.StoreInfo = o.StoreInfo.Clone()
  722. }
  723. return &ret
  724. }
  725. // SettleInfo
  726. type SettleInfo struct {
  727. // 是否指定分账
  728. ProfitSharing *bool `json:"profit_sharing,omitempty"`
  729. }
  730. func (o SettleInfo) MarshalJSON() ([]byte, error) {
  731. toSerialize := map[string]interface{}{}
  732. if o.ProfitSharing != nil {
  733. toSerialize["profit_sharing"] = o.ProfitSharing
  734. }
  735. return json.Marshal(toSerialize)
  736. }
  737. func (o SettleInfo) String() string {
  738. var ret string
  739. if o.ProfitSharing == nil {
  740. ret += "ProfitSharing:<nil>"
  741. } else {
  742. ret += fmt.Sprintf("ProfitSharing:%v", *o.ProfitSharing)
  743. }
  744. return fmt.Sprintf("SettleInfo{%s}", ret)
  745. }
  746. func (o SettleInfo) Clone() *SettleInfo {
  747. ret := SettleInfo{}
  748. if o.ProfitSharing != nil {
  749. ret.ProfitSharing = new(bool)
  750. *ret.ProfitSharing = *o.ProfitSharing
  751. }
  752. return &ret
  753. }
  754. // StoreInfo 商户门店信息
  755. type StoreInfo struct {
  756. // 商户侧门店编号
  757. Id *string `json:"id"`
  758. // 商户侧门店名称
  759. Name *string `json:"name,omitempty"`
  760. // 地区编码,详细请见微信支付提供的文档
  761. AreaCode *string `json:"area_code,omitempty"`
  762. // 详细的商户门店地址
  763. Address *string `json:"address,omitempty"`
  764. }
  765. func (o StoreInfo) MarshalJSON() ([]byte, error) {
  766. toSerialize := map[string]interface{}{}
  767. if o.Id == nil {
  768. return nil, fmt.Errorf("field `Id` is required and must be specified in StoreInfo")
  769. }
  770. toSerialize["id"] = o.Id
  771. if o.Name != nil {
  772. toSerialize["name"] = o.Name
  773. }
  774. if o.AreaCode != nil {
  775. toSerialize["area_code"] = o.AreaCode
  776. }
  777. if o.Address != nil {
  778. toSerialize["address"] = o.Address
  779. }
  780. return json.Marshal(toSerialize)
  781. }
  782. func (o StoreInfo) String() string {
  783. var ret string
  784. if o.Id == nil {
  785. ret += "Id:<nil>, "
  786. } else {
  787. ret += fmt.Sprintf("Id:%v, ", *o.Id)
  788. }
  789. if o.Name == nil {
  790. ret += "Name:<nil>, "
  791. } else {
  792. ret += fmt.Sprintf("Name:%v, ", *o.Name)
  793. }
  794. if o.AreaCode == nil {
  795. ret += "AreaCode:<nil>, "
  796. } else {
  797. ret += fmt.Sprintf("AreaCode:%v, ", *o.AreaCode)
  798. }
  799. if o.Address == nil {
  800. ret += "Address:<nil>"
  801. } else {
  802. ret += fmt.Sprintf("Address:%v", *o.Address)
  803. }
  804. return fmt.Sprintf("StoreInfo{%s}", ret)
  805. }
  806. func (o StoreInfo) Clone() *StoreInfo {
  807. ret := StoreInfo{}
  808. if o.Id != nil {
  809. ret.Id = new(string)
  810. *ret.Id = *o.Id
  811. }
  812. if o.Name != nil {
  813. ret.Name = new(string)
  814. *ret.Name = *o.Name
  815. }
  816. if o.AreaCode != nil {
  817. ret.AreaCode = new(string)
  818. *ret.AreaCode = *o.AreaCode
  819. }
  820. if o.Address != nil {
  821. ret.Address = new(string)
  822. *ret.Address = *o.Address
  823. }
  824. return &ret
  825. }