models.go 35 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413
  1. // Copyright 2021 Tencent Inc. All rights reserved.
  2. //
  3. // 公共出行平台代扣服务对外API
  4. //
  5. // 公共出行平台代扣服务对外API
  6. //
  7. // API version: 1.0.0
  8. // Code generated by WechatPay APIv3 Generator based on [OpenAPI Generator](https://openapi-generator.tech); DO NOT EDIT.
  9. package weixinpayscanandride
  10. import (
  11. "encoding/json"
  12. "fmt"
  13. )
  14. // BlockReasonEnum
  15. type BlockReasonEnum string
  16. func (e BlockReasonEnum) Ptr() *BlockReasonEnum {
  17. return &e
  18. }
  19. // Enums of BlockReasonEnum
  20. const (
  21. BLOCKREASONENUM_DELETED BlockReasonEnum = "DELETED"
  22. BLOCKREASONENUM_ACCOUNT_FROZEN BlockReasonEnum = "ACCOUNT_FROZEN"
  23. BLOCKREASONENUM_OVERDUE BlockReasonEnum = "OVERDUE"
  24. )
  25. // BusSceneInfo
  26. type BusSceneInfo struct {
  27. // 用户乘车时间(上车),按照使用rfc3339所定义的格式,格式为yyyy-MM-DDThh:mm:ss+TIMEZONE
  28. StartTime *string `json:"start_time"`
  29. // 乘车路线 路线名称的展示规则:\\^[A-Za-z0-9]{1,10}路$ 如line_name符合上述的规则,扣款凭证将增加展示乘车路线的字段
  30. LineName *string `json:"line_name,omitempty"`
  31. // 车牌号。仅包括省份+车牌,不包括特殊字符。
  32. PlateNumber *string `json:"plate_number,omitempty"`
  33. }
  34. func (o BusSceneInfo) MarshalJSON() ([]byte, error) {
  35. toSerialize := map[string]interface{}{}
  36. if o.StartTime == nil {
  37. return nil, fmt.Errorf("field `StartTime` is required and must be specified in BusSceneInfo")
  38. }
  39. toSerialize["start_time"] = o.StartTime
  40. if o.LineName != nil {
  41. toSerialize["line_name"] = o.LineName
  42. }
  43. if o.PlateNumber != nil {
  44. toSerialize["plate_number"] = o.PlateNumber
  45. }
  46. return json.Marshal(toSerialize)
  47. }
  48. func (o BusSceneInfo) String() string {
  49. var ret string
  50. if o.StartTime == nil {
  51. ret += "StartTime:<nil>, "
  52. } else {
  53. ret += fmt.Sprintf("StartTime:%v, ", *o.StartTime)
  54. }
  55. if o.LineName == nil {
  56. ret += "LineName:<nil>, "
  57. } else {
  58. ret += fmt.Sprintf("LineName:%v, ", *o.LineName)
  59. }
  60. if o.PlateNumber == nil {
  61. ret += "PlateNumber:<nil>"
  62. } else {
  63. ret += fmt.Sprintf("PlateNumber:%v", *o.PlateNumber)
  64. }
  65. return fmt.Sprintf("BusSceneInfo{%s}", ret)
  66. }
  67. func (o BusSceneInfo) Clone() *BusSceneInfo {
  68. ret := BusSceneInfo{}
  69. if o.StartTime != nil {
  70. ret.StartTime = new(string)
  71. *ret.StartTime = *o.StartTime
  72. }
  73. if o.LineName != nil {
  74. ret.LineName = new(string)
  75. *ret.LineName = *o.LineName
  76. }
  77. if o.PlateNumber != nil {
  78. ret.PlateNumber = new(string)
  79. *ret.PlateNumber = *o.PlateNumber
  80. }
  81. return &ret
  82. }
  83. // CreateTransactionRequest
  84. type CreateTransactionRequest struct {
  85. // 商户在微信申请公众号或移动应用成功后分配的账号ID,登录平台为mp.weixin.qq.com或open.weixin.qq.com
  86. Appid *string `json:"appid"`
  87. // 子公众账号ID,服务商模式下选传,用于扣费信息的商户信息展示,
  88. SubAppid *string `json:"sub_appid,omitempty"`
  89. // 微信支付分配的子商户号,服务商模式下必传
  90. SubMchid *string `json:"sub_mchid,omitempty"`
  91. // 商户自定义字段,用于交易账单中对扣费服务的描述。该字段长度限制为字节长度限制
  92. Description *string `json:"description"`
  93. // 附加数据,在查询API和支付通知中原样返回,可作为自定义参数使用,该字段长度限制为字节长度限制
  94. Attach *string `json:"attach,omitempty"`
  95. // 商户系统内部订单号,只能是数字、大小写字母,且在同一个商户号下唯一。该字段长度限制为字节长度限制
  96. OutTradeNo *string `json:"out_trade_no"`
  97. // 交易场景值,现在支持公交和地铁的场景值
  98. TradeScene *TradeScene `json:"trade_scene"`
  99. // 代金券或立减优惠功能的参数,说明详见代金券或立减优惠
  100. GoodsTag *string `json:"goods_tag,omitempty"`
  101. // 签约成功后,微信返回代扣签约ID 查用户是否能继续使用乘车卡时必传,此时,才会返回签约信息,如contract_state
  102. ContractId *string `json:"contract_id"`
  103. // 接受扣款结果异步回调通知的URL,注意回调URL只接受HTTPS
  104. NotifyUrl *string `json:"notify_url"`
  105. // 订单金额信息
  106. Amount *OrderAmount `json:"amount"`
  107. // 请求受理扣费 tradescene为BUS时,传入该参数
  108. BusInfo *BusSceneInfo `json:"bus_info,omitempty"`
  109. // 请求受理扣费 tradescene为METRO时,传入该参数
  110. MetroInfo *MetroSceneInfo `json:"metro_info,omitempty"`
  111. }
  112. func (o CreateTransactionRequest) MarshalJSON() ([]byte, error) {
  113. toSerialize := map[string]interface{}{}
  114. if o.Appid == nil {
  115. return nil, fmt.Errorf("field `Appid` is required and must be specified in CreateTransactionRequest")
  116. }
  117. toSerialize["appid"] = o.Appid
  118. if o.SubAppid != nil {
  119. toSerialize["sub_appid"] = o.SubAppid
  120. }
  121. if o.SubMchid != nil {
  122. toSerialize["sub_mchid"] = o.SubMchid
  123. }
  124. if o.Description == nil {
  125. return nil, fmt.Errorf("field `Description` is required and must be specified in CreateTransactionRequest")
  126. }
  127. toSerialize["description"] = o.Description
  128. if o.Attach != nil {
  129. toSerialize["attach"] = o.Attach
  130. }
  131. if o.OutTradeNo == nil {
  132. return nil, fmt.Errorf("field `OutTradeNo` is required and must be specified in CreateTransactionRequest")
  133. }
  134. toSerialize["out_trade_no"] = o.OutTradeNo
  135. if o.TradeScene == nil {
  136. return nil, fmt.Errorf("field `TradeScene` is required and must be specified in CreateTransactionRequest")
  137. }
  138. toSerialize["trade_scene"] = o.TradeScene
  139. if o.GoodsTag != nil {
  140. toSerialize["goods_tag"] = o.GoodsTag
  141. }
  142. if o.ContractId == nil {
  143. return nil, fmt.Errorf("field `ContractId` is required and must be specified in CreateTransactionRequest")
  144. }
  145. toSerialize["contract_id"] = o.ContractId
  146. if o.NotifyUrl == nil {
  147. return nil, fmt.Errorf("field `NotifyUrl` is required and must be specified in CreateTransactionRequest")
  148. }
  149. toSerialize["notify_url"] = o.NotifyUrl
  150. if o.Amount == nil {
  151. return nil, fmt.Errorf("field `Amount` is required and must be specified in CreateTransactionRequest")
  152. }
  153. toSerialize["amount"] = o.Amount
  154. if o.BusInfo != nil {
  155. toSerialize["bus_info"] = o.BusInfo
  156. }
  157. if o.MetroInfo != nil {
  158. toSerialize["metro_info"] = o.MetroInfo
  159. }
  160. return json.Marshal(toSerialize)
  161. }
  162. func (o CreateTransactionRequest) String() string {
  163. var ret string
  164. if o.Appid == nil {
  165. ret += "Appid:<nil>, "
  166. } else {
  167. ret += fmt.Sprintf("Appid:%v, ", *o.Appid)
  168. }
  169. if o.SubAppid == nil {
  170. ret += "SubAppid:<nil>, "
  171. } else {
  172. ret += fmt.Sprintf("SubAppid:%v, ", *o.SubAppid)
  173. }
  174. if o.SubMchid == nil {
  175. ret += "SubMchid:<nil>, "
  176. } else {
  177. ret += fmt.Sprintf("SubMchid:%v, ", *o.SubMchid)
  178. }
  179. if o.Description == nil {
  180. ret += "Description:<nil>, "
  181. } else {
  182. ret += fmt.Sprintf("Description:%v, ", *o.Description)
  183. }
  184. if o.Attach == nil {
  185. ret += "Attach:<nil>, "
  186. } else {
  187. ret += fmt.Sprintf("Attach:%v, ", *o.Attach)
  188. }
  189. if o.OutTradeNo == nil {
  190. ret += "OutTradeNo:<nil>, "
  191. } else {
  192. ret += fmt.Sprintf("OutTradeNo:%v, ", *o.OutTradeNo)
  193. }
  194. if o.TradeScene == nil {
  195. ret += "TradeScene:<nil>, "
  196. } else {
  197. ret += fmt.Sprintf("TradeScene:%v, ", *o.TradeScene)
  198. }
  199. if o.GoodsTag == nil {
  200. ret += "GoodsTag:<nil>, "
  201. } else {
  202. ret += fmt.Sprintf("GoodsTag:%v, ", *o.GoodsTag)
  203. }
  204. if o.ContractId == nil {
  205. ret += "ContractId:<nil>, "
  206. } else {
  207. ret += fmt.Sprintf("ContractId:%v, ", *o.ContractId)
  208. }
  209. if o.NotifyUrl == nil {
  210. ret += "NotifyUrl:<nil>, "
  211. } else {
  212. ret += fmt.Sprintf("NotifyUrl:%v, ", *o.NotifyUrl)
  213. }
  214. ret += fmt.Sprintf("Amount:%v, ", o.Amount)
  215. ret += fmt.Sprintf("BusInfo:%v, ", o.BusInfo)
  216. ret += fmt.Sprintf("MetroInfo:%v", o.MetroInfo)
  217. return fmt.Sprintf("CreateTransactionRequest{%s}", ret)
  218. }
  219. func (o CreateTransactionRequest) Clone() *CreateTransactionRequest {
  220. ret := CreateTransactionRequest{}
  221. if o.Appid != nil {
  222. ret.Appid = new(string)
  223. *ret.Appid = *o.Appid
  224. }
  225. if o.SubAppid != nil {
  226. ret.SubAppid = new(string)
  227. *ret.SubAppid = *o.SubAppid
  228. }
  229. if o.SubMchid != nil {
  230. ret.SubMchid = new(string)
  231. *ret.SubMchid = *o.SubMchid
  232. }
  233. if o.Description != nil {
  234. ret.Description = new(string)
  235. *ret.Description = *o.Description
  236. }
  237. if o.Attach != nil {
  238. ret.Attach = new(string)
  239. *ret.Attach = *o.Attach
  240. }
  241. if o.OutTradeNo != nil {
  242. ret.OutTradeNo = new(string)
  243. *ret.OutTradeNo = *o.OutTradeNo
  244. }
  245. if o.TradeScene != nil {
  246. ret.TradeScene = new(TradeScene)
  247. *ret.TradeScene = *o.TradeScene
  248. }
  249. if o.GoodsTag != nil {
  250. ret.GoodsTag = new(string)
  251. *ret.GoodsTag = *o.GoodsTag
  252. }
  253. if o.ContractId != nil {
  254. ret.ContractId = new(string)
  255. *ret.ContractId = *o.ContractId
  256. }
  257. if o.NotifyUrl != nil {
  258. ret.NotifyUrl = new(string)
  259. *ret.NotifyUrl = *o.NotifyUrl
  260. }
  261. if o.Amount != nil {
  262. ret.Amount = o.Amount.Clone()
  263. }
  264. if o.BusInfo != nil {
  265. ret.BusInfo = o.BusInfo.Clone()
  266. }
  267. if o.MetroInfo != nil {
  268. ret.MetroInfo = o.MetroInfo.Clone()
  269. }
  270. return &ret
  271. }
  272. // MetroSceneInfo
  273. type MetroSceneInfo struct {
  274. // 用户乘车时间(上车),按照使用rfc3339所定义的格式,格式为yyyy-MM-DDThh:mm:ss+TIMEZONE
  275. StartTime *string `json:"start_time"`
  276. // 用户下车时间,按照使用rfc3339所定义的格式,格式为yyyy-MM-DDThh:mm:ss+TIMEZONE
  277. EndTime *string `json:"end_time,omitempty"`
  278. // 乘车起始站,该值催缴时会向微信用户进行展示
  279. StartStation *string `json:"start_station,omitempty"`
  280. // 乘车终点站,该值催缴时会向微信用户进行展示
  281. EndStation *string `json:"end_station,omitempty"`
  282. }
  283. func (o MetroSceneInfo) MarshalJSON() ([]byte, error) {
  284. toSerialize := map[string]interface{}{}
  285. if o.StartTime == nil {
  286. return nil, fmt.Errorf("field `StartTime` is required and must be specified in MetroSceneInfo")
  287. }
  288. toSerialize["start_time"] = o.StartTime
  289. if o.EndTime != nil {
  290. toSerialize["end_time"] = o.EndTime
  291. }
  292. if o.StartStation != nil {
  293. toSerialize["start_station"] = o.StartStation
  294. }
  295. if o.EndStation != nil {
  296. toSerialize["end_station"] = o.EndStation
  297. }
  298. return json.Marshal(toSerialize)
  299. }
  300. func (o MetroSceneInfo) String() string {
  301. var ret string
  302. if o.StartTime == nil {
  303. ret += "StartTime:<nil>, "
  304. } else {
  305. ret += fmt.Sprintf("StartTime:%v, ", *o.StartTime)
  306. }
  307. if o.EndTime == nil {
  308. ret += "EndTime:<nil>, "
  309. } else {
  310. ret += fmt.Sprintf("EndTime:%v, ", *o.EndTime)
  311. }
  312. if o.StartStation == nil {
  313. ret += "StartStation:<nil>, "
  314. } else {
  315. ret += fmt.Sprintf("StartStation:%v, ", *o.StartStation)
  316. }
  317. if o.EndStation == nil {
  318. ret += "EndStation:<nil>"
  319. } else {
  320. ret += fmt.Sprintf("EndStation:%v", *o.EndStation)
  321. }
  322. return fmt.Sprintf("MetroSceneInfo{%s}", ret)
  323. }
  324. func (o MetroSceneInfo) Clone() *MetroSceneInfo {
  325. ret := MetroSceneInfo{}
  326. if o.StartTime != nil {
  327. ret.StartTime = new(string)
  328. *ret.StartTime = *o.StartTime
  329. }
  330. if o.EndTime != nil {
  331. ret.EndTime = new(string)
  332. *ret.EndTime = *o.EndTime
  333. }
  334. if o.StartStation != nil {
  335. ret.StartStation = new(string)
  336. *ret.StartStation = *o.StartStation
  337. }
  338. if o.EndStation != nil {
  339. ret.EndStation = new(string)
  340. *ret.EndStation = *o.EndStation
  341. }
  342. return &ret
  343. }
  344. // OrderAmount
  345. type OrderAmount struct {
  346. // 订单总金额,单位为分,只能为整数,详见支付金额
  347. Total *int64 `json:"total"`
  348. // 符合ISO 4217标准的三位字母代码,目前只支持人民币:CNY
  349. Currency *string `json:"currency,omitempty"`
  350. }
  351. func (o OrderAmount) MarshalJSON() ([]byte, error) {
  352. toSerialize := map[string]interface{}{}
  353. if o.Total == nil {
  354. return nil, fmt.Errorf("field `Total` is required and must be specified in OrderAmount")
  355. }
  356. toSerialize["total"] = o.Total
  357. if o.Currency != nil {
  358. toSerialize["currency"] = o.Currency
  359. }
  360. return json.Marshal(toSerialize)
  361. }
  362. func (o OrderAmount) String() string {
  363. var ret string
  364. if o.Total == nil {
  365. ret += "Total:<nil>, "
  366. } else {
  367. ret += fmt.Sprintf("Total:%v, ", *o.Total)
  368. }
  369. if o.Currency == nil {
  370. ret += "Currency:<nil>"
  371. } else {
  372. ret += fmt.Sprintf("Currency:%v", *o.Currency)
  373. }
  374. return fmt.Sprintf("OrderAmount{%s}", ret)
  375. }
  376. func (o OrderAmount) Clone() *OrderAmount {
  377. ret := OrderAmount{}
  378. if o.Total != nil {
  379. ret.Total = new(int64)
  380. *ret.Total = *o.Total
  381. }
  382. if o.Currency != nil {
  383. ret.Currency = new(string)
  384. *ret.Currency = *o.Currency
  385. }
  386. return &ret
  387. }
  388. // PromotionDetail
  389. type PromotionDetail struct {
  390. // 券或者立减优惠ID
  391. CouponId *string `json:"coupon_id"`
  392. // 优惠名称
  393. Name *string `json:"name,omitempty"`
  394. // GLOBAL-全场代金券,SINGLE-单品优惠
  395. Scope *string `json:"scope,omitempty"`
  396. // 优惠类型,枚举值有:
  397. Type *PromotionType `json:"type,omitempty"`
  398. // 在微信商户后台配置的批次ID
  399. StockId *string `json:"stock_id,omitempty"`
  400. // 用户享受优惠的金额
  401. Amount *int64 `json:"amount"`
  402. // 特指由微信支付商户平台创建的优惠,出资金额等于本项优惠总金额,单位为分
  403. WechatpayContribute *int64 `json:"wechatpay_contribute,omitempty"`
  404. // 特指商户自己创建的优惠,出资金额等于本项优惠总金额,单位为分
  405. MerchantContribute *int64 `json:"merchant_contribute,omitempty"`
  406. // 其他出资方出资金额,单位为分
  407. OtherContribute *int64 `json:"other_contribute,omitempty"`
  408. // CNY:人民币,境内商户号仅支持人民币。
  409. Currency *string `json:"currency,omitempty"`
  410. }
  411. func (o PromotionDetail) MarshalJSON() ([]byte, error) {
  412. toSerialize := map[string]interface{}{}
  413. if o.CouponId == nil {
  414. return nil, fmt.Errorf("field `CouponId` is required and must be specified in PromotionDetail")
  415. }
  416. toSerialize["coupon_id"] = o.CouponId
  417. if o.Name != nil {
  418. toSerialize["name"] = o.Name
  419. }
  420. if o.Scope != nil {
  421. toSerialize["scope"] = o.Scope
  422. }
  423. if o.Type != nil {
  424. toSerialize["type"] = o.Type
  425. }
  426. if o.StockId != nil {
  427. toSerialize["stock_id"] = o.StockId
  428. }
  429. if o.Amount == nil {
  430. return nil, fmt.Errorf("field `Amount` is required and must be specified in PromotionDetail")
  431. }
  432. toSerialize["amount"] = o.Amount
  433. if o.WechatpayContribute != nil {
  434. toSerialize["wechatpay_contribute"] = o.WechatpayContribute
  435. }
  436. if o.MerchantContribute != nil {
  437. toSerialize["merchant_contribute"] = o.MerchantContribute
  438. }
  439. if o.OtherContribute != nil {
  440. toSerialize["other_contribute"] = o.OtherContribute
  441. }
  442. if o.Currency != nil {
  443. toSerialize["currency"] = o.Currency
  444. }
  445. return json.Marshal(toSerialize)
  446. }
  447. func (o PromotionDetail) String() string {
  448. var ret string
  449. if o.CouponId == nil {
  450. ret += "CouponId:<nil>, "
  451. } else {
  452. ret += fmt.Sprintf("CouponId:%v, ", *o.CouponId)
  453. }
  454. if o.Name == nil {
  455. ret += "Name:<nil>, "
  456. } else {
  457. ret += fmt.Sprintf("Name:%v, ", *o.Name)
  458. }
  459. if o.Scope == nil {
  460. ret += "Scope:<nil>, "
  461. } else {
  462. ret += fmt.Sprintf("Scope:%v, ", *o.Scope)
  463. }
  464. if o.Type == nil {
  465. ret += "Type:<nil>, "
  466. } else {
  467. ret += fmt.Sprintf("Type:%v, ", *o.Type)
  468. }
  469. if o.StockId == nil {
  470. ret += "StockId:<nil>, "
  471. } else {
  472. ret += fmt.Sprintf("StockId:%v, ", *o.StockId)
  473. }
  474. if o.Amount == nil {
  475. ret += "Amount:<nil>, "
  476. } else {
  477. ret += fmt.Sprintf("Amount:%v, ", *o.Amount)
  478. }
  479. if o.WechatpayContribute == nil {
  480. ret += "WechatpayContribute:<nil>, "
  481. } else {
  482. ret += fmt.Sprintf("WechatpayContribute:%v, ", *o.WechatpayContribute)
  483. }
  484. if o.MerchantContribute == nil {
  485. ret += "MerchantContribute:<nil>, "
  486. } else {
  487. ret += fmt.Sprintf("MerchantContribute:%v, ", *o.MerchantContribute)
  488. }
  489. if o.OtherContribute == nil {
  490. ret += "OtherContribute:<nil>, "
  491. } else {
  492. ret += fmt.Sprintf("OtherContribute:%v, ", *o.OtherContribute)
  493. }
  494. if o.Currency == nil {
  495. ret += "Currency:<nil>"
  496. } else {
  497. ret += fmt.Sprintf("Currency:%v", *o.Currency)
  498. }
  499. return fmt.Sprintf("PromotionDetail{%s}", ret)
  500. }
  501. func (o PromotionDetail) Clone() *PromotionDetail {
  502. ret := PromotionDetail{}
  503. if o.CouponId != nil {
  504. ret.CouponId = new(string)
  505. *ret.CouponId = *o.CouponId
  506. }
  507. if o.Name != nil {
  508. ret.Name = new(string)
  509. *ret.Name = *o.Name
  510. }
  511. if o.Scope != nil {
  512. ret.Scope = new(string)
  513. *ret.Scope = *o.Scope
  514. }
  515. if o.Type != nil {
  516. ret.Type = new(PromotionType)
  517. *ret.Type = *o.Type
  518. }
  519. if o.StockId != nil {
  520. ret.StockId = new(string)
  521. *ret.StockId = *o.StockId
  522. }
  523. if o.Amount != nil {
  524. ret.Amount = new(int64)
  525. *ret.Amount = *o.Amount
  526. }
  527. if o.WechatpayContribute != nil {
  528. ret.WechatpayContribute = new(int64)
  529. *ret.WechatpayContribute = *o.WechatpayContribute
  530. }
  531. if o.MerchantContribute != nil {
  532. ret.MerchantContribute = new(int64)
  533. *ret.MerchantContribute = *o.MerchantContribute
  534. }
  535. if o.OtherContribute != nil {
  536. ret.OtherContribute = new(int64)
  537. *ret.OtherContribute = *o.OtherContribute
  538. }
  539. if o.Currency != nil {
  540. ret.Currency = new(string)
  541. *ret.Currency = *o.Currency
  542. }
  543. return &ret
  544. }
  545. // PromotionType
  546. type PromotionType string
  547. func (e PromotionType) Ptr() *PromotionType {
  548. return &e
  549. }
  550. // Enums of PromotionType
  551. const (
  552. PROMOTIONTYPE_CASH PromotionType = "CASH"
  553. PROMOTIONTYPE_NOCASH PromotionType = "NOCASH"
  554. )
  555. // QueryOrderAmount
  556. type QueryOrderAmount struct {
  557. // 订单总金额,单位为分,只能为整数,详见支付金额
  558. Total *int64 `json:"total,omitempty"`
  559. // 用户实际支付金额,单位为分,只能为整数,详见支付金额
  560. PayerTotal *int64 `json:"payer_total,omitempty"`
  561. // CNY:人民币,境内商户号仅支持人民币。
  562. Currency *string `json:"currency,omitempty"`
  563. }
  564. func (o QueryOrderAmount) MarshalJSON() ([]byte, error) {
  565. toSerialize := map[string]interface{}{}
  566. if o.Total != nil {
  567. toSerialize["total"] = o.Total
  568. }
  569. if o.PayerTotal != nil {
  570. toSerialize["payer_total"] = o.PayerTotal
  571. }
  572. if o.Currency != nil {
  573. toSerialize["currency"] = o.Currency
  574. }
  575. return json.Marshal(toSerialize)
  576. }
  577. func (o QueryOrderAmount) String() string {
  578. var ret string
  579. if o.Total == nil {
  580. ret += "Total:<nil>, "
  581. } else {
  582. ret += fmt.Sprintf("Total:%v, ", *o.Total)
  583. }
  584. if o.PayerTotal == nil {
  585. ret += "PayerTotal:<nil>, "
  586. } else {
  587. ret += fmt.Sprintf("PayerTotal:%v, ", *o.PayerTotal)
  588. }
  589. if o.Currency == nil {
  590. ret += "Currency:<nil>"
  591. } else {
  592. ret += fmt.Sprintf("Currency:%v", *o.Currency)
  593. }
  594. return fmt.Sprintf("QueryOrderAmount{%s}", ret)
  595. }
  596. func (o QueryOrderAmount) Clone() *QueryOrderAmount {
  597. ret := QueryOrderAmount{}
  598. if o.Total != nil {
  599. ret.Total = new(int64)
  600. *ret.Total = *o.Total
  601. }
  602. if o.PayerTotal != nil {
  603. ret.PayerTotal = new(int64)
  604. *ret.PayerTotal = *o.PayerTotal
  605. }
  606. if o.Currency != nil {
  607. ret.Currency = new(string)
  608. *ret.Currency = *o.Currency
  609. }
  610. return &ret
  611. }
  612. // QueryTransactionRequest
  613. type QueryTransactionRequest struct {
  614. // 商户系统内部订单号,只能是数字、大小写字母,且在同一个商户号下唯一。该字段长度限制为字节长度限制
  615. OutTradeNo *string `json:"out_trade_no"`
  616. // 微信支付分配的子商户号,服务商模式下必传
  617. SubMchid *string `json:"sub_mchid,omitempty"`
  618. }
  619. func (o QueryTransactionRequest) MarshalJSON() ([]byte, error) {
  620. toSerialize := map[string]interface{}{}
  621. if o.OutTradeNo == nil {
  622. return nil, fmt.Errorf("field `OutTradeNo` is required and must be specified in QueryTransactionRequest")
  623. }
  624. toSerialize["out_trade_no"] = o.OutTradeNo
  625. if o.SubMchid != nil {
  626. toSerialize["sub_mchid"] = o.SubMchid
  627. }
  628. return json.Marshal(toSerialize)
  629. }
  630. func (o QueryTransactionRequest) String() string {
  631. var ret string
  632. if o.OutTradeNo == nil {
  633. ret += "OutTradeNo:<nil>, "
  634. } else {
  635. ret += fmt.Sprintf("OutTradeNo:%v, ", *o.OutTradeNo)
  636. }
  637. if o.SubMchid == nil {
  638. ret += "SubMchid:<nil>"
  639. } else {
  640. ret += fmt.Sprintf("SubMchid:%v", *o.SubMchid)
  641. }
  642. return fmt.Sprintf("QueryTransactionRequest{%s}", ret)
  643. }
  644. func (o QueryTransactionRequest) Clone() *QueryTransactionRequest {
  645. ret := QueryTransactionRequest{}
  646. if o.OutTradeNo != nil {
  647. ret.OutTradeNo = new(string)
  648. *ret.OutTradeNo = *o.OutTradeNo
  649. }
  650. if o.SubMchid != nil {
  651. ret.SubMchid = new(string)
  652. *ret.SubMchid = *o.SubMchid
  653. }
  654. return &ret
  655. }
  656. // QueryUserServiceRequest
  657. type QueryUserServiceRequest struct {
  658. // 商户在微信申请公众号或移动应用成功后分配的账号ID,登录平台为mp.weixin.qq.com或open.weixin.qq.com
  659. Appid *string `json:"appid"`
  660. // 子公众账号ID,服务商模式下选传
  661. SubAppid *string `json:"sub_appid,omitempty"`
  662. // 微信支付分配的子商户号,服务商模式下必传
  663. SubMchid *string `json:"sub_mchid,omitempty"`
  664. // 签约成功后,微信返回代扣签约ID 查用户是否能继续使用乘车卡时必传
  665. ContractId *string `json:"contract_id"`
  666. }
  667. func (o QueryUserServiceRequest) MarshalJSON() ([]byte, error) {
  668. toSerialize := map[string]interface{}{}
  669. if o.Appid == nil {
  670. return nil, fmt.Errorf("field `Appid` is required and must be specified in QueryUserServiceRequest")
  671. }
  672. toSerialize["appid"] = o.Appid
  673. if o.SubAppid != nil {
  674. toSerialize["sub_appid"] = o.SubAppid
  675. }
  676. if o.SubMchid != nil {
  677. toSerialize["sub_mchid"] = o.SubMchid
  678. }
  679. if o.ContractId == nil {
  680. return nil, fmt.Errorf("field `ContractId` is required and must be specified in QueryUserServiceRequest")
  681. }
  682. toSerialize["contract_id"] = o.ContractId
  683. return json.Marshal(toSerialize)
  684. }
  685. func (o QueryUserServiceRequest) String() string {
  686. var ret string
  687. if o.Appid == nil {
  688. ret += "Appid:<nil>, "
  689. } else {
  690. ret += fmt.Sprintf("Appid:%v, ", *o.Appid)
  691. }
  692. if o.SubAppid == nil {
  693. ret += "SubAppid:<nil>, "
  694. } else {
  695. ret += fmt.Sprintf("SubAppid:%v, ", *o.SubAppid)
  696. }
  697. if o.SubMchid == nil {
  698. ret += "SubMchid:<nil>, "
  699. } else {
  700. ret += fmt.Sprintf("SubMchid:%v, ", *o.SubMchid)
  701. }
  702. if o.ContractId == nil {
  703. ret += "ContractId:<nil>"
  704. } else {
  705. ret += fmt.Sprintf("ContractId:%v", *o.ContractId)
  706. }
  707. return fmt.Sprintf("QueryUserServiceRequest{%s}", ret)
  708. }
  709. func (o QueryUserServiceRequest) Clone() *QueryUserServiceRequest {
  710. ret := QueryUserServiceRequest{}
  711. if o.Appid != nil {
  712. ret.Appid = new(string)
  713. *ret.Appid = *o.Appid
  714. }
  715. if o.SubAppid != nil {
  716. ret.SubAppid = new(string)
  717. *ret.SubAppid = *o.SubAppid
  718. }
  719. if o.SubMchid != nil {
  720. ret.SubMchid = new(string)
  721. *ret.SubMchid = *o.SubMchid
  722. }
  723. if o.ContractId != nil {
  724. ret.ContractId = new(string)
  725. *ret.ContractId = *o.ContractId
  726. }
  727. return &ret
  728. }
  729. // TradeScene
  730. type TradeScene string
  731. func (e TradeScene) Ptr() *TradeScene {
  732. return &e
  733. }
  734. // Enums of TradeScene
  735. const (
  736. TRADESCENE_BUS TradeScene = "BUS"
  737. TRADESCENE_METRO TradeScene = "METRO"
  738. )
  739. // TradeState
  740. type TradeState string
  741. func (e TradeState) Ptr() *TradeState {
  742. return &e
  743. }
  744. // Enums of TradeState
  745. const (
  746. TRADESTATE_SUCCESS TradeState = "SUCCESS"
  747. TRADESTATE_ACCEPTED TradeState = "ACCEPTED"
  748. TRADESTATE_PAY_FAIL TradeState = "PAY_FAIL"
  749. TRADESTATE_REFUND TradeState = "REFUND"
  750. )
  751. // TransactionsEntity
  752. type TransactionsEntity struct {
  753. // 商户在微信申请公众号或移动应用成功后分配的账号ID,登录平台为mp.weixin.qq.com或open.weixin.qq.com
  754. Appid *string `json:"appid"`
  755. // 子商户申请的公众号或移动应用AppID,需要在服务商的商户平台为子商户绑定
  756. SubAppid *string `json:"sub_appid,omitempty"`
  757. // 微信支付分配的商户号
  758. SpMchid *string `json:"sp_mchid"`
  759. // 微信支付分配的子商户号
  760. SubMchid *string `json:"sub_mchid,omitempty"`
  761. // 商户自定义字段,用于交易账单中对扣费服务的描述。
  762. Description *string `json:"description"`
  763. // 订单成功创建时返回,按照使用rfc3339所定义的格式,格式为yyyy-MM-DDThh:mm:ss+TIMEZONE
  764. CreateTime *string `json:"create_time"`
  765. // 商户系统内部订单号,只能是数字、大小写字母,且在同一个商户号下唯一
  766. OutTradeNo *string `json:"out_trade_no"`
  767. // 微信支付订单号
  768. TransactionId *string `json:"transaction_id,omitempty"`
  769. // 交易状态,枚举值:
  770. TradeState *TradeState `json:"trade_state"`
  771. // 对当前订单状态的描述和下一步操作的指引
  772. TradeStateDescription *string `json:"trade_state_description,omitempty"`
  773. // 订单支付完成时间,按照使用rfc3339所定义的格式,格式为yyyy-MM-DDThh:mm:ss+TIMEZONE
  774. SuccessTime *string `json:"success_time,omitempty"`
  775. // 银行类型,采用字符串类型的银行标识,详细可参考 微信支付银行类型标识(https://pay.weixin.qq.com/wiki/doc/apiv3/terms_definition/chapter1_1_3.shtml)。 特殊标识 BPA:该笔订单由微信进行垫付
  776. BankType *string `json:"bank_type,omitempty"`
  777. // 该字段标识对应的垫资单是否已还款或者已撤销。注意,使用此字段前需先确认bank_type字段值为BPA 以及 trade_state字段值为SUCCESS或者REFUND。枚举值如下:
  778. UserRepayState *UserRepayState `json:"user_repay_state,omitempty"`
  779. // 用户还款成功的微信支付订单号。用户已还款会返回该字段。
  780. RepayTransactionId *string `json:"repay_transaction_id,omitempty"`
  781. // 垫资还款时间,该笔订单发生过垫资,并且用户还款成功后,会返回该字段信息,按照使用rfc3339所定义的格式,格式为yyyy-MM-DDThh:mm:ss+TIMEZONE
  782. RepayTime *string `json:"repay_time,omitempty"`
  783. // 附加数据,在查询API和支付通知中原样返回,可作为自定义参数使用
  784. Attach *string `json:"attach,omitempty"`
  785. // 签约成功后,微信返回的代扣签约ID
  786. ContractId *string `json:"contract_id,omitempty"`
  787. // 交易场景值,枚举值:
  788. TradeScene *TradeScene `json:"trade_scene"`
  789. // 返回信息中的trade_scene为BUS,返回该场景信息
  790. BusInfo *BusSceneInfo `json:"bus_info,omitempty"`
  791. // 返回信息中的trade_scene为METRO,返回该场景信息
  792. MetroInfo *MetroSceneInfo `json:"metro_info,omitempty"`
  793. // 订单金额信息
  794. Amount *QueryOrderAmount `json:"amount"`
  795. // 优惠信息
  796. PromotionDetail []PromotionDetail `json:"promotion_detail,omitempty"`
  797. }
  798. func (o TransactionsEntity) MarshalJSON() ([]byte, error) {
  799. toSerialize := map[string]interface{}{}
  800. if o.Appid == nil {
  801. return nil, fmt.Errorf("field `Appid` is required and must be specified in TransactionsEntity")
  802. }
  803. toSerialize["appid"] = o.Appid
  804. if o.SubAppid != nil {
  805. toSerialize["sub_appid"] = o.SubAppid
  806. }
  807. if o.SpMchid == nil {
  808. return nil, fmt.Errorf("field `SpMchid` is required and must be specified in TransactionsEntity")
  809. }
  810. toSerialize["sp_mchid"] = o.SpMchid
  811. if o.SubMchid != nil {
  812. toSerialize["sub_mchid"] = o.SubMchid
  813. }
  814. if o.Description == nil {
  815. return nil, fmt.Errorf("field `Description` is required and must be specified in TransactionsEntity")
  816. }
  817. toSerialize["description"] = o.Description
  818. if o.CreateTime == nil {
  819. return nil, fmt.Errorf("field `CreateTime` is required and must be specified in TransactionsEntity")
  820. }
  821. toSerialize["create_time"] = o.CreateTime
  822. if o.OutTradeNo == nil {
  823. return nil, fmt.Errorf("field `OutTradeNo` is required and must be specified in TransactionsEntity")
  824. }
  825. toSerialize["out_trade_no"] = o.OutTradeNo
  826. if o.TransactionId != nil {
  827. toSerialize["transaction_id"] = o.TransactionId
  828. }
  829. if o.TradeState == nil {
  830. return nil, fmt.Errorf("field `TradeState` is required and must be specified in TransactionsEntity")
  831. }
  832. toSerialize["trade_state"] = o.TradeState
  833. if o.TradeStateDescription != nil {
  834. toSerialize["trade_state_description"] = o.TradeStateDescription
  835. }
  836. if o.SuccessTime != nil {
  837. toSerialize["success_time"] = o.SuccessTime
  838. }
  839. if o.BankType != nil {
  840. toSerialize["bank_type"] = o.BankType
  841. }
  842. if o.UserRepayState != nil {
  843. toSerialize["user_repay_state"] = o.UserRepayState
  844. }
  845. if o.RepayTransactionId != nil {
  846. toSerialize["repay_transaction_id"] = o.RepayTransactionId
  847. }
  848. if o.RepayTime != nil {
  849. toSerialize["repay_time"] = o.RepayTime
  850. }
  851. if o.Attach != nil {
  852. toSerialize["attach"] = o.Attach
  853. }
  854. if o.ContractId != nil {
  855. toSerialize["contract_id"] = o.ContractId
  856. }
  857. if o.TradeScene == nil {
  858. return nil, fmt.Errorf("field `TradeScene` is required and must be specified in TransactionsEntity")
  859. }
  860. toSerialize["trade_scene"] = o.TradeScene
  861. if o.BusInfo != nil {
  862. toSerialize["bus_info"] = o.BusInfo
  863. }
  864. if o.MetroInfo != nil {
  865. toSerialize["metro_info"] = o.MetroInfo
  866. }
  867. if o.Amount == nil {
  868. return nil, fmt.Errorf("field `Amount` is required and must be specified in TransactionsEntity")
  869. }
  870. toSerialize["amount"] = o.Amount
  871. if o.PromotionDetail != nil {
  872. toSerialize["promotion_detail"] = o.PromotionDetail
  873. }
  874. return json.Marshal(toSerialize)
  875. }
  876. func (o TransactionsEntity) String() string {
  877. var ret string
  878. if o.Appid == nil {
  879. ret += "Appid:<nil>, "
  880. } else {
  881. ret += fmt.Sprintf("Appid:%v, ", *o.Appid)
  882. }
  883. if o.SubAppid == nil {
  884. ret += "SubAppid:<nil>, "
  885. } else {
  886. ret += fmt.Sprintf("SubAppid:%v, ", *o.SubAppid)
  887. }
  888. if o.SpMchid == nil {
  889. ret += "SpMchid:<nil>, "
  890. } else {
  891. ret += fmt.Sprintf("SpMchid:%v, ", *o.SpMchid)
  892. }
  893. if o.SubMchid == nil {
  894. ret += "SubMchid:<nil>, "
  895. } else {
  896. ret += fmt.Sprintf("SubMchid:%v, ", *o.SubMchid)
  897. }
  898. if o.Description == nil {
  899. ret += "Description:<nil>, "
  900. } else {
  901. ret += fmt.Sprintf("Description:%v, ", *o.Description)
  902. }
  903. if o.CreateTime == nil {
  904. ret += "CreateTime:<nil>, "
  905. } else {
  906. ret += fmt.Sprintf("CreateTime:%v, ", *o.CreateTime)
  907. }
  908. if o.OutTradeNo == nil {
  909. ret += "OutTradeNo:<nil>, "
  910. } else {
  911. ret += fmt.Sprintf("OutTradeNo:%v, ", *o.OutTradeNo)
  912. }
  913. if o.TransactionId == nil {
  914. ret += "TransactionId:<nil>, "
  915. } else {
  916. ret += fmt.Sprintf("TransactionId:%v, ", *o.TransactionId)
  917. }
  918. if o.TradeState == nil {
  919. ret += "TradeState:<nil>, "
  920. } else {
  921. ret += fmt.Sprintf("TradeState:%v, ", *o.TradeState)
  922. }
  923. if o.TradeStateDescription == nil {
  924. ret += "TradeStateDescription:<nil>, "
  925. } else {
  926. ret += fmt.Sprintf("TradeStateDescription:%v, ", *o.TradeStateDescription)
  927. }
  928. if o.SuccessTime == nil {
  929. ret += "SuccessTime:<nil>, "
  930. } else {
  931. ret += fmt.Sprintf("SuccessTime:%v, ", *o.SuccessTime)
  932. }
  933. if o.BankType == nil {
  934. ret += "BankType:<nil>, "
  935. } else {
  936. ret += fmt.Sprintf("BankType:%v, ", *o.BankType)
  937. }
  938. if o.UserRepayState == nil {
  939. ret += "UserRepayState:<nil>, "
  940. } else {
  941. ret += fmt.Sprintf("UserRepayState:%v, ", *o.UserRepayState)
  942. }
  943. if o.RepayTransactionId == nil {
  944. ret += "RepayTransactionId:<nil>, "
  945. } else {
  946. ret += fmt.Sprintf("RepayTransactionId:%v, ", *o.RepayTransactionId)
  947. }
  948. if o.RepayTime == nil {
  949. ret += "RepayTime:<nil>, "
  950. } else {
  951. ret += fmt.Sprintf("RepayTime:%v, ", *o.RepayTime)
  952. }
  953. if o.Attach == nil {
  954. ret += "Attach:<nil>, "
  955. } else {
  956. ret += fmt.Sprintf("Attach:%v, ", *o.Attach)
  957. }
  958. if o.ContractId == nil {
  959. ret += "ContractId:<nil>, "
  960. } else {
  961. ret += fmt.Sprintf("ContractId:%v, ", *o.ContractId)
  962. }
  963. if o.TradeScene == nil {
  964. ret += "TradeScene:<nil>, "
  965. } else {
  966. ret += fmt.Sprintf("TradeScene:%v, ", *o.TradeScene)
  967. }
  968. ret += fmt.Sprintf("BusInfo:%v, ", o.BusInfo)
  969. ret += fmt.Sprintf("MetroInfo:%v, ", o.MetroInfo)
  970. ret += fmt.Sprintf("Amount:%v, ", o.Amount)
  971. ret += fmt.Sprintf("PromotionDetail:%v", o.PromotionDetail)
  972. return fmt.Sprintf("TransactionsEntity{%s}", ret)
  973. }
  974. func (o TransactionsEntity) Clone() *TransactionsEntity {
  975. ret := TransactionsEntity{}
  976. if o.Appid != nil {
  977. ret.Appid = new(string)
  978. *ret.Appid = *o.Appid
  979. }
  980. if o.SubAppid != nil {
  981. ret.SubAppid = new(string)
  982. *ret.SubAppid = *o.SubAppid
  983. }
  984. if o.SpMchid != nil {
  985. ret.SpMchid = new(string)
  986. *ret.SpMchid = *o.SpMchid
  987. }
  988. if o.SubMchid != nil {
  989. ret.SubMchid = new(string)
  990. *ret.SubMchid = *o.SubMchid
  991. }
  992. if o.Description != nil {
  993. ret.Description = new(string)
  994. *ret.Description = *o.Description
  995. }
  996. if o.CreateTime != nil {
  997. ret.CreateTime = new(string)
  998. *ret.CreateTime = *o.CreateTime
  999. }
  1000. if o.OutTradeNo != nil {
  1001. ret.OutTradeNo = new(string)
  1002. *ret.OutTradeNo = *o.OutTradeNo
  1003. }
  1004. if o.TransactionId != nil {
  1005. ret.TransactionId = new(string)
  1006. *ret.TransactionId = *o.TransactionId
  1007. }
  1008. if o.TradeState != nil {
  1009. ret.TradeState = new(TradeState)
  1010. *ret.TradeState = *o.TradeState
  1011. }
  1012. if o.TradeStateDescription != nil {
  1013. ret.TradeStateDescription = new(string)
  1014. *ret.TradeStateDescription = *o.TradeStateDescription
  1015. }
  1016. if o.SuccessTime != nil {
  1017. ret.SuccessTime = new(string)
  1018. *ret.SuccessTime = *o.SuccessTime
  1019. }
  1020. if o.BankType != nil {
  1021. ret.BankType = new(string)
  1022. *ret.BankType = *o.BankType
  1023. }
  1024. if o.UserRepayState != nil {
  1025. ret.UserRepayState = new(UserRepayState)
  1026. *ret.UserRepayState = *o.UserRepayState
  1027. }
  1028. if o.RepayTransactionId != nil {
  1029. ret.RepayTransactionId = new(string)
  1030. *ret.RepayTransactionId = *o.RepayTransactionId
  1031. }
  1032. if o.RepayTime != nil {
  1033. ret.RepayTime = new(string)
  1034. *ret.RepayTime = *o.RepayTime
  1035. }
  1036. if o.Attach != nil {
  1037. ret.Attach = new(string)
  1038. *ret.Attach = *o.Attach
  1039. }
  1040. if o.ContractId != nil {
  1041. ret.ContractId = new(string)
  1042. *ret.ContractId = *o.ContractId
  1043. }
  1044. if o.TradeScene != nil {
  1045. ret.TradeScene = new(TradeScene)
  1046. *ret.TradeScene = *o.TradeScene
  1047. }
  1048. if o.BusInfo != nil {
  1049. ret.BusInfo = o.BusInfo.Clone()
  1050. }
  1051. if o.MetroInfo != nil {
  1052. ret.MetroInfo = o.MetroInfo.Clone()
  1053. }
  1054. if o.Amount != nil {
  1055. ret.Amount = o.Amount.Clone()
  1056. }
  1057. if o.PromotionDetail != nil {
  1058. ret.PromotionDetail = make([]PromotionDetail, len(o.PromotionDetail))
  1059. for i, item := range o.PromotionDetail {
  1060. ret.PromotionDetail[i] = *item.Clone()
  1061. }
  1062. }
  1063. return &ret
  1064. }
  1065. // UserRepayState
  1066. type UserRepayState string
  1067. func (e UserRepayState) Ptr() *UserRepayState {
  1068. return &e
  1069. }
  1070. // Enums of UserRepayState
  1071. const (
  1072. USERREPAYSTATE_NOT_REPAY UserRepayState = "NOT_REPAY"
  1073. USERREPAYSTATE_REPAID UserRepayState = "REPAID"
  1074. USERREPAYSTATE_ALL_REFUND UserRepayState = "ALL_REFUND"
  1075. )
  1076. // UserServiceEntity
  1077. type UserServiceEntity struct {
  1078. // 签约成功后,微信返回代扣签约ID
  1079. ContractId *string `json:"contract_id"`
  1080. // 用户服务可用状态,枚举值有:
  1081. UserServiceState *UserServiceStateEnum `json:"user_service_state"`
  1082. // blocked服务状态描述,返回用户状态为BLOCKED,会返回该字段,具体描述的枚举值如下:
  1083. BlockReason *BlockReasonEnum `json:"block_reason,omitempty"`
  1084. }
  1085. func (o UserServiceEntity) MarshalJSON() ([]byte, error) {
  1086. toSerialize := map[string]interface{}{}
  1087. if o.ContractId == nil {
  1088. return nil, fmt.Errorf("field `ContractId` is required and must be specified in UserServiceEntity")
  1089. }
  1090. toSerialize["contract_id"] = o.ContractId
  1091. if o.UserServiceState == nil {
  1092. return nil, fmt.Errorf("field `UserServiceState` is required and must be specified in UserServiceEntity")
  1093. }
  1094. toSerialize["user_service_state"] = o.UserServiceState
  1095. if o.BlockReason != nil {
  1096. toSerialize["block_reason"] = o.BlockReason
  1097. }
  1098. return json.Marshal(toSerialize)
  1099. }
  1100. func (o UserServiceEntity) String() string {
  1101. var ret string
  1102. if o.ContractId == nil {
  1103. ret += "ContractId:<nil>, "
  1104. } else {
  1105. ret += fmt.Sprintf("ContractId:%v, ", *o.ContractId)
  1106. }
  1107. if o.UserServiceState == nil {
  1108. ret += "UserServiceState:<nil>, "
  1109. } else {
  1110. ret += fmt.Sprintf("UserServiceState:%v, ", *o.UserServiceState)
  1111. }
  1112. if o.BlockReason == nil {
  1113. ret += "BlockReason:<nil>"
  1114. } else {
  1115. ret += fmt.Sprintf("BlockReason:%v", *o.BlockReason)
  1116. }
  1117. return fmt.Sprintf("UserServiceEntity{%s}", ret)
  1118. }
  1119. func (o UserServiceEntity) Clone() *UserServiceEntity {
  1120. ret := UserServiceEntity{}
  1121. if o.ContractId != nil {
  1122. ret.ContractId = new(string)
  1123. *ret.ContractId = *o.ContractId
  1124. }
  1125. if o.UserServiceState != nil {
  1126. ret.UserServiceState = new(UserServiceStateEnum)
  1127. *ret.UserServiceState = *o.UserServiceState
  1128. }
  1129. if o.BlockReason != nil {
  1130. ret.BlockReason = new(BlockReasonEnum)
  1131. *ret.BlockReason = *o.BlockReason
  1132. }
  1133. return &ret
  1134. }
  1135. // UserServiceStateEnum
  1136. type UserServiceStateEnum string
  1137. func (e UserServiceStateEnum) Ptr() *UserServiceStateEnum {
  1138. return &e
  1139. }
  1140. // Enums of UserServiceStateEnum
  1141. const (
  1142. USERSERVICESTATEENUM_NORMAL UserServiceStateEnum = "NORMAL"
  1143. USERSERVICESTATEENUM_BLOCKED UserServiceStateEnum = "BLOCKED"
  1144. )