models.go 45 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497
  1. // Copyright 2021 Tencent Inc. All rights reserved.
  2. //
  3. // 商家转账对外API
  4. //
  5. // * 场景及业务流程: 商户可通过该产品实现同时向多个用户微信零钱进行转账的操作,可用于发放奖金补贴、佣金货款结算、员工报销等场景。 [https://pay.weixin.qq.com/index.php/public/product/detail?pid=108&productType=0](https://pay.weixin.qq.com/index.php/public/product/detail?pid=108&productType=0) * 接入步骤: * 商户在微信支付商户平台开通“批量转账到零钱”产品权限,并勾选“使用API方式发起转账”。 * 调用批量转账接口,对多个用户微信零钱发起转账。 * 调用查询批次接口,可获取到转账批次详情及当前状态。 * 调用查询明细接口,可获取到单条转账明细详情及当前状态。
  6. //
  7. // API version: 1.0.5
  8. // Code generated by WechatPay APIv3 Generator based on [OpenAPI Generator](https://openapi-generator.tech); DO NOT EDIT.
  9. package transferbatch
  10. import (
  11. "encoding/json"
  12. "fmt"
  13. "time"
  14. )
  15. // CloseReasonType
  16. type CloseReasonType string
  17. func (e CloseReasonType) Ptr() *CloseReasonType {
  18. return &e
  19. }
  20. // Enums of CloseReasonType
  21. const (
  22. CLOSEREASONTYPE_OVERDUE_CLOSE CloseReasonType = "OVERDUE_CLOSE"
  23. CLOSEREASONTYPE_TRANSFER_SCENE_INVALID CloseReasonType = "TRANSFER_SCENE_INVALID"
  24. )
  25. // FailReasonType
  26. type FailReasonType string
  27. func (e FailReasonType) Ptr() *FailReasonType {
  28. return &e
  29. }
  30. // Enums of FailReasonType
  31. const (
  32. FAILREASONTYPE_ACCOUNT_FROZEN FailReasonType = "ACCOUNT_FROZEN"
  33. FAILREASONTYPE_REAL_NAME_CHECK_FAIL FailReasonType = "REAL_NAME_CHECK_FAIL"
  34. FAILREASONTYPE_NAME_NOT_CORRECT FailReasonType = "NAME_NOT_CORRECT"
  35. FAILREASONTYPE_OPENID_INVALID FailReasonType = "OPENID_INVALID"
  36. FAILREASONTYPE_TRANSFER_QUOTA_EXCEED FailReasonType = "TRANSFER_QUOTA_EXCEED"
  37. FAILREASONTYPE_DAY_RECEIVED_QUOTA_EXCEED FailReasonType = "DAY_RECEIVED_QUOTA_EXCEED"
  38. FAILREASONTYPE_MONTH_RECEIVED_QUOTA_EXCEED FailReasonType = "MONTH_RECEIVED_QUOTA_EXCEED"
  39. FAILREASONTYPE_DAY_RECEIVED_COUNT_EXCEED FailReasonType = "DAY_RECEIVED_COUNT_EXCEED"
  40. FAILREASONTYPE_PRODUCT_AUTH_CHECK_FAIL FailReasonType = "PRODUCT_AUTH_CHECK_FAIL"
  41. FAILREASONTYPE_OVERDUE_CLOSE FailReasonType = "OVERDUE_CLOSE"
  42. FAILREASONTYPE_ID_CARD_NOT_CORRECT FailReasonType = "ID_CARD_NOT_CORRECT"
  43. FAILREASONTYPE_ACCOUNT_NOT_EXIST FailReasonType = "ACCOUNT_NOT_EXIST"
  44. FAILREASONTYPE_TRANSFER_RISK FailReasonType = "TRANSFER_RISK"
  45. FAILREASONTYPE_OTHER_FAIL_REASON_TYPE FailReasonType = "OTHER_FAIL_REASON_TYPE"
  46. FAILREASONTYPE_REALNAME_ACCOUNT_RECEIVED_QUOTA_EXCEED FailReasonType = "REALNAME_ACCOUNT_RECEIVED_QUOTA_EXCEED"
  47. FAILREASONTYPE_RECEIVE_ACCOUNT_NOT_PERMMIT FailReasonType = "RECEIVE_ACCOUNT_NOT_PERMMIT"
  48. FAILREASONTYPE_PAYEE_ACCOUNT_ABNORMAL FailReasonType = "PAYEE_ACCOUNT_ABNORMAL"
  49. FAILREASONTYPE_PAYER_ACCOUNT_ABNORMAL FailReasonType = "PAYER_ACCOUNT_ABNORMAL"
  50. FAILREASONTYPE_TRANSFER_SCENE_UNAVAILABLE FailReasonType = "TRANSFER_SCENE_UNAVAILABLE"
  51. FAILREASONTYPE_TRANSFER_SCENE_INVALID FailReasonType = "TRANSFER_SCENE_INVALID"
  52. FAILREASONTYPE_TRANSFER_REMARK_SET_FAIL FailReasonType = "TRANSFER_REMARK_SET_FAIL"
  53. FAILREASONTYPE_RECEIVE_ACCOUNT_NOT_CONFIGURE FailReasonType = "RECEIVE_ACCOUNT_NOT_CONFIGURE"
  54. FAILREASONTYPE_BLOCK_B2_C_USERLIMITAMOUNT_BSRULE_MONTH FailReasonType = "BLOCK_B2C_USERLIMITAMOUNT_BSRULE_MONTH"
  55. FAILREASONTYPE_BLOCK_B2_C_USERLIMITAMOUNT_MONTH FailReasonType = "BLOCK_B2C_USERLIMITAMOUNT_MONTH"
  56. FAILREASONTYPE_MERCHANT_REJECT FailReasonType = "MERCHANT_REJECT"
  57. FAILREASONTYPE_MERCHANT_NOT_CONFIRM FailReasonType = "MERCHANT_NOT_CONFIRM"
  58. )
  59. // GetTransferBatchByNoRequest
  60. type GetTransferBatchByNoRequest struct {
  61. // 微信批次单号,微信商家转账系统返回的唯一标识
  62. BatchId *string `json:"batch_id"`
  63. // true-是;false-否,默认否。商户可选择是否查询指定状态的转账明细单,当转账批次单状态为“FINISHED”(已完成)时,才会返回满足条件的转账明细单
  64. NeedQueryDetail *bool `json:"need_query_detail"`
  65. // 该次请求资源的起始位置。返回的明细是按照设置的明细条数进行分页展示的,一次查询可能无法返回所有明细,我们使用该参数标识查询开始位置,默认值为0
  66. Offset *int64 `json:"offset,omitempty"`
  67. // 该次请求可返回的最大明细条数,最小20条,最大100条,不传则默认20条。不足20条按实际条数返回
  68. Limit *int64 `json:"limit,omitempty"`
  69. // WAIT_PAY: 待确认。待商户确认, 符合免密条件时, 系统会自动扭转为转账中 ALL:全部。需要同时查询转账成功、失败和待确认的明细单 SUCCESS:转账成功 FAIL:转账失败。需要确认失败原因后,再决定是否重新发起对该笔明细单的转账(并非整个转账批次单)
  70. DetailStatus *string `json:"detail_status,omitempty"`
  71. }
  72. func (o GetTransferBatchByNoRequest) MarshalJSON() ([]byte, error) {
  73. toSerialize := map[string]interface{}{}
  74. if o.BatchId == nil {
  75. return nil, fmt.Errorf("field `BatchId` is required and must be specified in GetTransferBatchByNoRequest")
  76. }
  77. toSerialize["batch_id"] = o.BatchId
  78. if o.NeedQueryDetail == nil {
  79. return nil, fmt.Errorf("field `NeedQueryDetail` is required and must be specified in GetTransferBatchByNoRequest")
  80. }
  81. toSerialize["need_query_detail"] = o.NeedQueryDetail
  82. if o.Offset != nil {
  83. toSerialize["offset"] = o.Offset
  84. }
  85. if o.Limit != nil {
  86. toSerialize["limit"] = o.Limit
  87. }
  88. if o.DetailStatus != nil {
  89. toSerialize["detail_status"] = o.DetailStatus
  90. }
  91. return json.Marshal(toSerialize)
  92. }
  93. func (o GetTransferBatchByNoRequest) String() string {
  94. var ret string
  95. if o.BatchId == nil {
  96. ret += "BatchId:<nil>, "
  97. } else {
  98. ret += fmt.Sprintf("BatchId:%v, ", *o.BatchId)
  99. }
  100. if o.NeedQueryDetail == nil {
  101. ret += "NeedQueryDetail:<nil>, "
  102. } else {
  103. ret += fmt.Sprintf("NeedQueryDetail:%v, ", *o.NeedQueryDetail)
  104. }
  105. if o.Offset == nil {
  106. ret += "Offset:<nil>, "
  107. } else {
  108. ret += fmt.Sprintf("Offset:%v, ", *o.Offset)
  109. }
  110. if o.Limit == nil {
  111. ret += "Limit:<nil>, "
  112. } else {
  113. ret += fmt.Sprintf("Limit:%v, ", *o.Limit)
  114. }
  115. if o.DetailStatus == nil {
  116. ret += "DetailStatus:<nil>"
  117. } else {
  118. ret += fmt.Sprintf("DetailStatus:%v", *o.DetailStatus)
  119. }
  120. return fmt.Sprintf("GetTransferBatchByNoRequest{%s}", ret)
  121. }
  122. func (o GetTransferBatchByNoRequest) Clone() *GetTransferBatchByNoRequest {
  123. ret := GetTransferBatchByNoRequest{}
  124. if o.BatchId != nil {
  125. ret.BatchId = new(string)
  126. *ret.BatchId = *o.BatchId
  127. }
  128. if o.NeedQueryDetail != nil {
  129. ret.NeedQueryDetail = new(bool)
  130. *ret.NeedQueryDetail = *o.NeedQueryDetail
  131. }
  132. if o.Offset != nil {
  133. ret.Offset = new(int64)
  134. *ret.Offset = *o.Offset
  135. }
  136. if o.Limit != nil {
  137. ret.Limit = new(int64)
  138. *ret.Limit = *o.Limit
  139. }
  140. if o.DetailStatus != nil {
  141. ret.DetailStatus = new(string)
  142. *ret.DetailStatus = *o.DetailStatus
  143. }
  144. return &ret
  145. }
  146. // GetTransferBatchByOutNoRequest
  147. type GetTransferBatchByOutNoRequest struct {
  148. // 商户系统内部的商家批次单号,在商户系统内部唯一
  149. OutBatchNo *string `json:"out_batch_no"`
  150. // true-是;false-否,默认否。商户可选择是否查询指定状态的转账明细单,当转账批次单状态为“FINISHED”(已完成)时,才会返回满足条件的转账明细单
  151. NeedQueryDetail *bool `json:"need_query_detail"`
  152. // 该次请求资源(转账明细单)的起始位置,从0开始,默认值为0
  153. Offset *int64 `json:"offset,omitempty"`
  154. // 该次请求可返回的最大资源(转账明细单)条数,最小20条,最大100条,不传则默认20条。不足20条按实际条数返回
  155. Limit *int64 `json:"limit,omitempty"`
  156. // WAIT_PAY: 待确认。待商户确认, 符合免密条件时, 系统会自动扭转为转账中 ALL:全部。需要同时查询转账成功、失败和待确认的明细单 SUCCESS:转账成功 FAIL:转账失败。需要确认失败原因后,再决定是否重新发起对该笔明细单的转账(并非整个转账批次单)
  157. DetailStatus *string `json:"detail_status,omitempty"`
  158. }
  159. func (o GetTransferBatchByOutNoRequest) MarshalJSON() ([]byte, error) {
  160. toSerialize := map[string]interface{}{}
  161. if o.OutBatchNo == nil {
  162. return nil, fmt.Errorf("field `OutBatchNo` is required and must be specified in GetTransferBatchByOutNoRequest")
  163. }
  164. toSerialize["out_batch_no"] = o.OutBatchNo
  165. if o.NeedQueryDetail == nil {
  166. return nil, fmt.Errorf("field `NeedQueryDetail` is required and must be specified in GetTransferBatchByOutNoRequest")
  167. }
  168. toSerialize["need_query_detail"] = o.NeedQueryDetail
  169. if o.Offset != nil {
  170. toSerialize["offset"] = o.Offset
  171. }
  172. if o.Limit != nil {
  173. toSerialize["limit"] = o.Limit
  174. }
  175. if o.DetailStatus != nil {
  176. toSerialize["detail_status"] = o.DetailStatus
  177. }
  178. return json.Marshal(toSerialize)
  179. }
  180. func (o GetTransferBatchByOutNoRequest) String() string {
  181. var ret string
  182. if o.OutBatchNo == nil {
  183. ret += "OutBatchNo:<nil>, "
  184. } else {
  185. ret += fmt.Sprintf("OutBatchNo:%v, ", *o.OutBatchNo)
  186. }
  187. if o.NeedQueryDetail == nil {
  188. ret += "NeedQueryDetail:<nil>, "
  189. } else {
  190. ret += fmt.Sprintf("NeedQueryDetail:%v, ", *o.NeedQueryDetail)
  191. }
  192. if o.Offset == nil {
  193. ret += "Offset:<nil>, "
  194. } else {
  195. ret += fmt.Sprintf("Offset:%v, ", *o.Offset)
  196. }
  197. if o.Limit == nil {
  198. ret += "Limit:<nil>, "
  199. } else {
  200. ret += fmt.Sprintf("Limit:%v, ", *o.Limit)
  201. }
  202. if o.DetailStatus == nil {
  203. ret += "DetailStatus:<nil>"
  204. } else {
  205. ret += fmt.Sprintf("DetailStatus:%v", *o.DetailStatus)
  206. }
  207. return fmt.Sprintf("GetTransferBatchByOutNoRequest{%s}", ret)
  208. }
  209. func (o GetTransferBatchByOutNoRequest) Clone() *GetTransferBatchByOutNoRequest {
  210. ret := GetTransferBatchByOutNoRequest{}
  211. if o.OutBatchNo != nil {
  212. ret.OutBatchNo = new(string)
  213. *ret.OutBatchNo = *o.OutBatchNo
  214. }
  215. if o.NeedQueryDetail != nil {
  216. ret.NeedQueryDetail = new(bool)
  217. *ret.NeedQueryDetail = *o.NeedQueryDetail
  218. }
  219. if o.Offset != nil {
  220. ret.Offset = new(int64)
  221. *ret.Offset = *o.Offset
  222. }
  223. if o.Limit != nil {
  224. ret.Limit = new(int64)
  225. *ret.Limit = *o.Limit
  226. }
  227. if o.DetailStatus != nil {
  228. ret.DetailStatus = new(string)
  229. *ret.DetailStatus = *o.DetailStatus
  230. }
  231. return &ret
  232. }
  233. // GetTransferDetailByNoRequest
  234. type GetTransferDetailByNoRequest struct {
  235. // 微信批次单号,微信商家转账系统返回的唯一标识
  236. BatchId *string `json:"batch_id"`
  237. // 微信支付系统内部区分转账批次单下不同转账明细单的唯一标识
  238. DetailId *string `json:"detail_id"`
  239. }
  240. func (o GetTransferDetailByNoRequest) MarshalJSON() ([]byte, error) {
  241. toSerialize := map[string]interface{}{}
  242. if o.BatchId == nil {
  243. return nil, fmt.Errorf("field `BatchId` is required and must be specified in GetTransferDetailByNoRequest")
  244. }
  245. toSerialize["batch_id"] = o.BatchId
  246. if o.DetailId == nil {
  247. return nil, fmt.Errorf("field `DetailId` is required and must be specified in GetTransferDetailByNoRequest")
  248. }
  249. toSerialize["detail_id"] = o.DetailId
  250. return json.Marshal(toSerialize)
  251. }
  252. func (o GetTransferDetailByNoRequest) String() string {
  253. var ret string
  254. if o.BatchId == nil {
  255. ret += "BatchId:<nil>, "
  256. } else {
  257. ret += fmt.Sprintf("BatchId:%v, ", *o.BatchId)
  258. }
  259. if o.DetailId == nil {
  260. ret += "DetailId:<nil>"
  261. } else {
  262. ret += fmt.Sprintf("DetailId:%v", *o.DetailId)
  263. }
  264. return fmt.Sprintf("GetTransferDetailByNoRequest{%s}", ret)
  265. }
  266. func (o GetTransferDetailByNoRequest) Clone() *GetTransferDetailByNoRequest {
  267. ret := GetTransferDetailByNoRequest{}
  268. if o.BatchId != nil {
  269. ret.BatchId = new(string)
  270. *ret.BatchId = *o.BatchId
  271. }
  272. if o.DetailId != nil {
  273. ret.DetailId = new(string)
  274. *ret.DetailId = *o.DetailId
  275. }
  276. return &ret
  277. }
  278. // GetTransferDetailByOutNoRequest
  279. type GetTransferDetailByOutNoRequest struct {
  280. // 商户系统内部区分转账批次单下不同转账明细单的唯一标识
  281. OutDetailNo *string `json:"out_detail_no"`
  282. // 商户系统内部的商家批次单号,在商户系统内部唯一
  283. OutBatchNo *string `json:"out_batch_no"`
  284. }
  285. func (o GetTransferDetailByOutNoRequest) MarshalJSON() ([]byte, error) {
  286. toSerialize := map[string]interface{}{}
  287. if o.OutDetailNo == nil {
  288. return nil, fmt.Errorf("field `OutDetailNo` is required and must be specified in GetTransferDetailByOutNoRequest")
  289. }
  290. toSerialize["out_detail_no"] = o.OutDetailNo
  291. if o.OutBatchNo == nil {
  292. return nil, fmt.Errorf("field `OutBatchNo` is required and must be specified in GetTransferDetailByOutNoRequest")
  293. }
  294. toSerialize["out_batch_no"] = o.OutBatchNo
  295. return json.Marshal(toSerialize)
  296. }
  297. func (o GetTransferDetailByOutNoRequest) String() string {
  298. var ret string
  299. if o.OutDetailNo == nil {
  300. ret += "OutDetailNo:<nil>, "
  301. } else {
  302. ret += fmt.Sprintf("OutDetailNo:%v, ", *o.OutDetailNo)
  303. }
  304. if o.OutBatchNo == nil {
  305. ret += "OutBatchNo:<nil>"
  306. } else {
  307. ret += fmt.Sprintf("OutBatchNo:%v", *o.OutBatchNo)
  308. }
  309. return fmt.Sprintf("GetTransferDetailByOutNoRequest{%s}", ret)
  310. }
  311. func (o GetTransferDetailByOutNoRequest) Clone() *GetTransferDetailByOutNoRequest {
  312. ret := GetTransferDetailByOutNoRequest{}
  313. if o.OutDetailNo != nil {
  314. ret.OutDetailNo = new(string)
  315. *ret.OutDetailNo = *o.OutDetailNo
  316. }
  317. if o.OutBatchNo != nil {
  318. ret.OutBatchNo = new(string)
  319. *ret.OutBatchNo = *o.OutBatchNo
  320. }
  321. return &ret
  322. }
  323. // InitiateBatchTransferRequest
  324. type InitiateBatchTransferRequest struct {
  325. // 申请商户号的appid或商户号绑定的appid(企业号corpid即为此appid)
  326. Appid *string `json:"appid"`
  327. // 商户系统内部的商家批次单号,要求此参数只能由数字、大小写字母组成,在商户系统内部唯一
  328. OutBatchNo *string `json:"out_batch_no"`
  329. // 该笔批量转账的名称
  330. BatchName *string `json:"batch_name"`
  331. // 转账说明,UTF8编码,最多允许32个字符
  332. BatchRemark *string `json:"batch_remark"`
  333. // 转账金额单位为“分”。转账总金额必须与批次内所有明细转账金额之和保持一致,否则无法发起转账操作
  334. TotalAmount *int64 `json:"total_amount"`
  335. // 一个转账批次单最多发起一千笔转账。转账总笔数必须与批次内所有明细之和保持一致,否则无法发起转账操作
  336. TotalNum *int64 `json:"total_num"`
  337. // 发起批量转账的明细列表,最多一千笔
  338. TransferDetailList []TransferDetailInput `json:"transfer_detail_list"`
  339. // 该批次转账使用的转账场景,如不填写则使用商家的默认场景,如无默认场景可为空,可前往“商家转账到零钱-前往功能”中申请。 如:1001-现金营销
  340. TransferSceneId *string `json:"transfer_scene_id,omitempty"`
  341. // 商户接收批次结果通知的URL,必须支持https,且只能是直接可访问的URL,不允许携带查询参数
  342. NotifyUrl *string `json:"notify_url,omitempty"`
  343. }
  344. func (o InitiateBatchTransferRequest) MarshalJSON() ([]byte, error) {
  345. toSerialize := map[string]interface{}{}
  346. if o.Appid == nil {
  347. return nil, fmt.Errorf("field `Appid` is required and must be specified in InitiateBatchTransferRequest")
  348. }
  349. toSerialize["appid"] = o.Appid
  350. if o.OutBatchNo == nil {
  351. return nil, fmt.Errorf("field `OutBatchNo` is required and must be specified in InitiateBatchTransferRequest")
  352. }
  353. toSerialize["out_batch_no"] = o.OutBatchNo
  354. if o.BatchName == nil {
  355. return nil, fmt.Errorf("field `BatchName` is required and must be specified in InitiateBatchTransferRequest")
  356. }
  357. toSerialize["batch_name"] = o.BatchName
  358. if o.BatchRemark == nil {
  359. return nil, fmt.Errorf("field `BatchRemark` is required and must be specified in InitiateBatchTransferRequest")
  360. }
  361. toSerialize["batch_remark"] = o.BatchRemark
  362. if o.TotalAmount == nil {
  363. return nil, fmt.Errorf("field `TotalAmount` is required and must be specified in InitiateBatchTransferRequest")
  364. }
  365. toSerialize["total_amount"] = o.TotalAmount
  366. if o.TotalNum == nil {
  367. return nil, fmt.Errorf("field `TotalNum` is required and must be specified in InitiateBatchTransferRequest")
  368. }
  369. toSerialize["total_num"] = o.TotalNum
  370. if o.TransferDetailList == nil {
  371. return nil, fmt.Errorf("field `TransferDetailList` is required and must be specified in InitiateBatchTransferRequest")
  372. }
  373. toSerialize["transfer_detail_list"] = o.TransferDetailList
  374. if o.TransferSceneId != nil {
  375. toSerialize["transfer_scene_id"] = o.TransferSceneId
  376. }
  377. if o.NotifyUrl != nil {
  378. toSerialize["notify_url"] = o.NotifyUrl
  379. }
  380. return json.Marshal(toSerialize)
  381. }
  382. func (o InitiateBatchTransferRequest) String() string {
  383. var ret string
  384. if o.Appid == nil {
  385. ret += "Appid:<nil>, "
  386. } else {
  387. ret += fmt.Sprintf("Appid:%v, ", *o.Appid)
  388. }
  389. if o.OutBatchNo == nil {
  390. ret += "OutBatchNo:<nil>, "
  391. } else {
  392. ret += fmt.Sprintf("OutBatchNo:%v, ", *o.OutBatchNo)
  393. }
  394. if o.BatchName == nil {
  395. ret += "BatchName:<nil>, "
  396. } else {
  397. ret += fmt.Sprintf("BatchName:%v, ", *o.BatchName)
  398. }
  399. if o.BatchRemark == nil {
  400. ret += "BatchRemark:<nil>, "
  401. } else {
  402. ret += fmt.Sprintf("BatchRemark:%v, ", *o.BatchRemark)
  403. }
  404. if o.TotalAmount == nil {
  405. ret += "TotalAmount:<nil>, "
  406. } else {
  407. ret += fmt.Sprintf("TotalAmount:%v, ", *o.TotalAmount)
  408. }
  409. if o.TotalNum == nil {
  410. ret += "TotalNum:<nil>, "
  411. } else {
  412. ret += fmt.Sprintf("TotalNum:%v, ", *o.TotalNum)
  413. }
  414. ret += fmt.Sprintf("TransferDetailList:%v, ", o.TransferDetailList)
  415. if o.TransferSceneId == nil {
  416. ret += "TransferSceneId:<nil>"
  417. } else {
  418. ret += fmt.Sprintf("TransferSceneId:%v", *o.TransferSceneId)
  419. }
  420. if o.NotifyUrl == nil {
  421. ret += "NotifyUrl:<nil>"
  422. } else {
  423. ret += fmt.Sprintf("NotifyUrl:%v", *o.NotifyUrl)
  424. }
  425. return fmt.Sprintf("InitiateBatchTransferRequest{%s}", ret)
  426. }
  427. func (o InitiateBatchTransferRequest) Clone() *InitiateBatchTransferRequest {
  428. ret := InitiateBatchTransferRequest{}
  429. if o.Appid != nil {
  430. ret.Appid = new(string)
  431. *ret.Appid = *o.Appid
  432. }
  433. if o.OutBatchNo != nil {
  434. ret.OutBatchNo = new(string)
  435. *ret.OutBatchNo = *o.OutBatchNo
  436. }
  437. if o.BatchName != nil {
  438. ret.BatchName = new(string)
  439. *ret.BatchName = *o.BatchName
  440. }
  441. if o.BatchRemark != nil {
  442. ret.BatchRemark = new(string)
  443. *ret.BatchRemark = *o.BatchRemark
  444. }
  445. if o.TotalAmount != nil {
  446. ret.TotalAmount = new(int64)
  447. *ret.TotalAmount = *o.TotalAmount
  448. }
  449. if o.TotalNum != nil {
  450. ret.TotalNum = new(int64)
  451. *ret.TotalNum = *o.TotalNum
  452. }
  453. if o.TransferDetailList != nil {
  454. ret.TransferDetailList = make([]TransferDetailInput, len(o.TransferDetailList))
  455. for i, item := range o.TransferDetailList {
  456. ret.TransferDetailList[i] = *item.Clone()
  457. }
  458. }
  459. if o.TransferSceneId != nil {
  460. ret.TransferSceneId = new(string)
  461. *ret.TransferSceneId = *o.TransferSceneId
  462. }
  463. if o.NotifyUrl != nil {
  464. ret.NotifyUrl = new(string)
  465. *ret.NotifyUrl = *o.NotifyUrl
  466. }
  467. return &ret
  468. }
  469. // InitiateBatchTransferResponse
  470. type InitiateBatchTransferResponse struct {
  471. // 商户系统内部的商家批次单号,在商户系统内部唯一
  472. OutBatchNo *string `json:"out_batch_no"`
  473. // 微信批次单号,微信商家转账系统返回的唯一标识
  474. BatchId *string `json:"batch_id"`
  475. // 批次受理成功时返回,按照使用rfc3339所定义的格式,格式为YYYY-MM-DDThh:mm:ss+TIMEZONE
  476. CreateTime *time.Time `json:"create_time"`
  477. // ACCEPTED:已受理。批次已受理成功,若发起批量转账的30分钟后,转账批次单仍处于该状态,可能原因是商户账户余额不足等。商户可查询账户资金流水,若该笔转账批次单的扣款已经发生,则表示批次已经进入转账中,请再次查单确认 PROCESSING:转账中。已开始处理批次内的转账明细单 FINISHED:已完成。批次内的所有转账明细单都已处理完成 CLOSED:已关闭。可查询具体的批次关闭原因确认
  478. BatchStatus *string `json:"batch_status,omitempty"`
  479. }
  480. func (o InitiateBatchTransferResponse) MarshalJSON() ([]byte, error) {
  481. toSerialize := map[string]interface{}{}
  482. if o.OutBatchNo == nil {
  483. return nil, fmt.Errorf("field `OutBatchNo` is required and must be specified in InitiateBatchTransferResponse")
  484. }
  485. toSerialize["out_batch_no"] = o.OutBatchNo
  486. if o.BatchId == nil {
  487. return nil, fmt.Errorf("field `BatchId` is required and must be specified in InitiateBatchTransferResponse")
  488. }
  489. toSerialize["batch_id"] = o.BatchId
  490. if o.CreateTime == nil {
  491. return nil, fmt.Errorf("field `CreateTime` is required and must be specified in InitiateBatchTransferResponse")
  492. }
  493. toSerialize["create_time"] = o.CreateTime.Format(time.RFC3339)
  494. if o.BatchStatus != nil {
  495. toSerialize["batch_status"] = o.BatchStatus
  496. }
  497. return json.Marshal(toSerialize)
  498. }
  499. func (o InitiateBatchTransferResponse) String() string {
  500. var ret string
  501. if o.OutBatchNo == nil {
  502. ret += "OutBatchNo:<nil>, "
  503. } else {
  504. ret += fmt.Sprintf("OutBatchNo:%v, ", *o.OutBatchNo)
  505. }
  506. if o.BatchId == nil {
  507. ret += "BatchId:<nil>, "
  508. } else {
  509. ret += fmt.Sprintf("BatchId:%v, ", *o.BatchId)
  510. }
  511. if o.CreateTime == nil {
  512. ret += "CreateTime:<nil>, "
  513. } else {
  514. ret += fmt.Sprintf("CreateTime:%v, ", *o.CreateTime)
  515. }
  516. if o.BatchStatus == nil {
  517. ret += "BatchStatus:<nil>"
  518. } else {
  519. ret += fmt.Sprintf("BatchStatus:%v", *o.BatchStatus)
  520. }
  521. return fmt.Sprintf("InitiateBatchTransferResponse{%s}", ret)
  522. }
  523. func (o InitiateBatchTransferResponse) Clone() *InitiateBatchTransferResponse {
  524. ret := InitiateBatchTransferResponse{}
  525. if o.OutBatchNo != nil {
  526. ret.OutBatchNo = new(string)
  527. *ret.OutBatchNo = *o.OutBatchNo
  528. }
  529. if o.BatchId != nil {
  530. ret.BatchId = new(string)
  531. *ret.BatchId = *o.BatchId
  532. }
  533. if o.CreateTime != nil {
  534. ret.CreateTime = new(time.Time)
  535. *ret.CreateTime = *o.CreateTime
  536. }
  537. if o.BatchStatus != nil {
  538. ret.BatchStatus = new(string)
  539. *ret.BatchStatus = *o.BatchStatus
  540. }
  541. return &ret
  542. }
  543. // TransferBatchEntity
  544. type TransferBatchEntity struct {
  545. // 转账批次单基本信息
  546. TransferBatch *TransferBatchGet `json:"transfer_batch"`
  547. // 当批次状态为“FINISHED”(已完成),且成功查询到转账明细单时返回。包括微信明细单号、明细状态信息
  548. TransferDetailList []TransferDetailCompact `json:"transfer_detail_list,omitempty"`
  549. }
  550. func (o TransferBatchEntity) MarshalJSON() ([]byte, error) {
  551. toSerialize := map[string]interface{}{}
  552. if o.TransferBatch == nil {
  553. return nil, fmt.Errorf("field `TransferBatch` is required and must be specified in TransferBatchEntity")
  554. }
  555. toSerialize["transfer_batch"] = o.TransferBatch
  556. if o.TransferDetailList != nil {
  557. toSerialize["transfer_detail_list"] = o.TransferDetailList
  558. }
  559. return json.Marshal(toSerialize)
  560. }
  561. func (o TransferBatchEntity) String() string {
  562. var ret string
  563. ret += fmt.Sprintf("TransferBatch:%v, ", o.TransferBatch)
  564. ret += fmt.Sprintf("TransferDetailList:%v", o.TransferDetailList)
  565. return fmt.Sprintf("TransferBatchEntity{%s}", ret)
  566. }
  567. func (o TransferBatchEntity) Clone() *TransferBatchEntity {
  568. ret := TransferBatchEntity{}
  569. if o.TransferBatch != nil {
  570. ret.TransferBatch = o.TransferBatch.Clone()
  571. }
  572. if o.TransferDetailList != nil {
  573. ret.TransferDetailList = make([]TransferDetailCompact, len(o.TransferDetailList))
  574. for i, item := range o.TransferDetailList {
  575. ret.TransferDetailList[i] = *item.Clone()
  576. }
  577. }
  578. return &ret
  579. }
  580. // TransferBatchGet
  581. type TransferBatchGet struct {
  582. // 微信支付分配的商户号
  583. Mchid *string `json:"mchid"`
  584. // 商户系统内部的商家批次单号,在商户系统内部唯一
  585. OutBatchNo *string `json:"out_batch_no"`
  586. // 微信批次单号,微信商家转账系统返回的唯一标识
  587. BatchId *string `json:"batch_id"`
  588. // 申请商户号的appid或商户号绑定的appid(企业号corpid即为此appid)
  589. Appid *string `json:"appid"`
  590. // WAIT_PAY: 待付款确认。需要付款出资商户在商家助手小程序或服务商助手小程序进行付款确认 ACCEPTED:已受理。批次已受理成功,若发起批量转账的30分钟后,转账批次单仍处于该状态,可能原因是商户账户余额不足等。商户可查询账户资金流水,若该笔转账批次单的扣款已经发生,则表示批次已经进入转账中,请再次查单确认 PROCESSING:转账中。已开始处理批次内的转账明细单 FINISHED:已完成。批次内的所有转账明细单都已处理完成 CLOSED:已关闭。可查询具体的批次关闭原因确认
  591. BatchStatus *string `json:"batch_status"`
  592. // API:API方式发起 WEB:页面方式发起
  593. BatchType *string `json:"batch_type"`
  594. // 该笔批量转账的名称
  595. BatchName *string `json:"batch_name"`
  596. // 转账说明,UTF8编码,最多允许32个字符
  597. BatchRemark *string `json:"batch_remark"`
  598. // 如果批次单状态为“CLOSED”(已关闭),则有关闭原因
  599. CloseReason *CloseReasonType `json:"close_reason,omitempty"`
  600. // 转账金额单位为“分”
  601. TotalAmount *int64 `json:"total_amount"`
  602. // 一个转账批次单最多发起三千笔转账
  603. TotalNum *int64 `json:"total_num"`
  604. // 批次受理成功时返回,按照使用rfc3339所定义的格式,格式为YYYY-MM-DDThh:mm:ss+TIMEZONE
  605. CreateTime *time.Time `json:"create_time,omitempty"`
  606. // 批次最近一次状态变更的时间,按照使用rfc3339所定义的格式,格式为YYYY-MM-DDThh:mm:ss+TIMEZONE
  607. UpdateTime *time.Time `json:"update_time,omitempty"`
  608. // 转账成功的金额,单位为“分”。当批次状态为“PROCESSING”(转账中)时,转账成功金额随时可能变化
  609. SuccessAmount *int64 `json:"success_amount,omitempty"`
  610. // 转账成功的笔数。当批次状态为“PROCESSING”(转账中)时,转账成功笔数随时可能变化
  611. SuccessNum *int64 `json:"success_num,omitempty"`
  612. // 转账失败的金额,单位为“分”
  613. FailAmount *int64 `json:"fail_amount,omitempty"`
  614. // 转账失败的笔数
  615. FailNum *int64 `json:"fail_num,omitempty"`
  616. // 指定的转账场景ID
  617. TransferSceneId *string `json:"transfer_scene_id,omitempty"`
  618. }
  619. func (o TransferBatchGet) MarshalJSON() ([]byte, error) {
  620. toSerialize := map[string]interface{}{}
  621. if o.Mchid == nil {
  622. return nil, fmt.Errorf("field `Mchid` is required and must be specified in TransferBatchGet")
  623. }
  624. toSerialize["mchid"] = o.Mchid
  625. if o.OutBatchNo == nil {
  626. return nil, fmt.Errorf("field `OutBatchNo` is required and must be specified in TransferBatchGet")
  627. }
  628. toSerialize["out_batch_no"] = o.OutBatchNo
  629. if o.BatchId == nil {
  630. return nil, fmt.Errorf("field `BatchId` is required and must be specified in TransferBatchGet")
  631. }
  632. toSerialize["batch_id"] = o.BatchId
  633. if o.Appid == nil {
  634. return nil, fmt.Errorf("field `Appid` is required and must be specified in TransferBatchGet")
  635. }
  636. toSerialize["appid"] = o.Appid
  637. if o.BatchStatus == nil {
  638. return nil, fmt.Errorf("field `BatchStatus` is required and must be specified in TransferBatchGet")
  639. }
  640. toSerialize["batch_status"] = o.BatchStatus
  641. if o.BatchType == nil {
  642. return nil, fmt.Errorf("field `BatchType` is required and must be specified in TransferBatchGet")
  643. }
  644. toSerialize["batch_type"] = o.BatchType
  645. if o.BatchName == nil {
  646. return nil, fmt.Errorf("field `BatchName` is required and must be specified in TransferBatchGet")
  647. }
  648. toSerialize["batch_name"] = o.BatchName
  649. if o.BatchRemark == nil {
  650. return nil, fmt.Errorf("field `BatchRemark` is required and must be specified in TransferBatchGet")
  651. }
  652. toSerialize["batch_remark"] = o.BatchRemark
  653. if o.CloseReason != nil {
  654. toSerialize["close_reason"] = o.CloseReason
  655. }
  656. if o.TotalAmount == nil {
  657. return nil, fmt.Errorf("field `TotalAmount` is required and must be specified in TransferBatchGet")
  658. }
  659. toSerialize["total_amount"] = o.TotalAmount
  660. if o.TotalNum == nil {
  661. return nil, fmt.Errorf("field `TotalNum` is required and must be specified in TransferBatchGet")
  662. }
  663. toSerialize["total_num"] = o.TotalNum
  664. if o.CreateTime != nil {
  665. toSerialize["create_time"] = o.CreateTime.Format(time.RFC3339)
  666. }
  667. if o.UpdateTime != nil {
  668. toSerialize["update_time"] = o.UpdateTime.Format(time.RFC3339)
  669. }
  670. if o.SuccessAmount != nil {
  671. toSerialize["success_amount"] = o.SuccessAmount
  672. }
  673. if o.SuccessNum != nil {
  674. toSerialize["success_num"] = o.SuccessNum
  675. }
  676. if o.FailAmount != nil {
  677. toSerialize["fail_amount"] = o.FailAmount
  678. }
  679. if o.FailNum != nil {
  680. toSerialize["fail_num"] = o.FailNum
  681. }
  682. if o.TransferSceneId != nil {
  683. toSerialize["transfer_scene_id"] = o.TransferSceneId
  684. }
  685. return json.Marshal(toSerialize)
  686. }
  687. func (o TransferBatchGet) String() string {
  688. var ret string
  689. if o.Mchid == nil {
  690. ret += "Mchid:<nil>, "
  691. } else {
  692. ret += fmt.Sprintf("Mchid:%v, ", *o.Mchid)
  693. }
  694. if o.OutBatchNo == nil {
  695. ret += "OutBatchNo:<nil>, "
  696. } else {
  697. ret += fmt.Sprintf("OutBatchNo:%v, ", *o.OutBatchNo)
  698. }
  699. if o.BatchId == nil {
  700. ret += "BatchId:<nil>, "
  701. } else {
  702. ret += fmt.Sprintf("BatchId:%v, ", *o.BatchId)
  703. }
  704. if o.Appid == nil {
  705. ret += "Appid:<nil>, "
  706. } else {
  707. ret += fmt.Sprintf("Appid:%v, ", *o.Appid)
  708. }
  709. if o.BatchStatus == nil {
  710. ret += "BatchStatus:<nil>, "
  711. } else {
  712. ret += fmt.Sprintf("BatchStatus:%v, ", *o.BatchStatus)
  713. }
  714. if o.BatchType == nil {
  715. ret += "BatchType:<nil>, "
  716. } else {
  717. ret += fmt.Sprintf("BatchType:%v, ", *o.BatchType)
  718. }
  719. if o.BatchName == nil {
  720. ret += "BatchName:<nil>, "
  721. } else {
  722. ret += fmt.Sprintf("BatchName:%v, ", *o.BatchName)
  723. }
  724. if o.BatchRemark == nil {
  725. ret += "BatchRemark:<nil>, "
  726. } else {
  727. ret += fmt.Sprintf("BatchRemark:%v, ", *o.BatchRemark)
  728. }
  729. if o.CloseReason == nil {
  730. ret += "CloseReason:<nil>, "
  731. } else {
  732. ret += fmt.Sprintf("CloseReason:%v, ", *o.CloseReason)
  733. }
  734. if o.TotalAmount == nil {
  735. ret += "TotalAmount:<nil>, "
  736. } else {
  737. ret += fmt.Sprintf("TotalAmount:%v, ", *o.TotalAmount)
  738. }
  739. if o.TotalNum == nil {
  740. ret += "TotalNum:<nil>, "
  741. } else {
  742. ret += fmt.Sprintf("TotalNum:%v, ", *o.TotalNum)
  743. }
  744. if o.CreateTime == nil {
  745. ret += "CreateTime:<nil>, "
  746. } else {
  747. ret += fmt.Sprintf("CreateTime:%v, ", *o.CreateTime)
  748. }
  749. if o.UpdateTime == nil {
  750. ret += "UpdateTime:<nil>, "
  751. } else {
  752. ret += fmt.Sprintf("UpdateTime:%v, ", *o.UpdateTime)
  753. }
  754. if o.SuccessAmount == nil {
  755. ret += "SuccessAmount:<nil>, "
  756. } else {
  757. ret += fmt.Sprintf("SuccessAmount:%v, ", *o.SuccessAmount)
  758. }
  759. if o.SuccessNum == nil {
  760. ret += "SuccessNum:<nil>, "
  761. } else {
  762. ret += fmt.Sprintf("SuccessNum:%v, ", *o.SuccessNum)
  763. }
  764. if o.FailAmount == nil {
  765. ret += "FailAmount:<nil>, "
  766. } else {
  767. ret += fmt.Sprintf("FailAmount:%v, ", *o.FailAmount)
  768. }
  769. if o.FailNum == nil {
  770. ret += "FailNum:<nil>, "
  771. } else {
  772. ret += fmt.Sprintf("FailNum:%v, ", *o.FailNum)
  773. }
  774. if o.TransferSceneId == nil {
  775. ret += "TransferSceneId:<nil>"
  776. } else {
  777. ret += fmt.Sprintf("TransferSceneId:%v", *o.TransferSceneId)
  778. }
  779. return fmt.Sprintf("TransferBatchGet{%s}", ret)
  780. }
  781. func (o TransferBatchGet) Clone() *TransferBatchGet {
  782. ret := TransferBatchGet{}
  783. if o.Mchid != nil {
  784. ret.Mchid = new(string)
  785. *ret.Mchid = *o.Mchid
  786. }
  787. if o.OutBatchNo != nil {
  788. ret.OutBatchNo = new(string)
  789. *ret.OutBatchNo = *o.OutBatchNo
  790. }
  791. if o.BatchId != nil {
  792. ret.BatchId = new(string)
  793. *ret.BatchId = *o.BatchId
  794. }
  795. if o.Appid != nil {
  796. ret.Appid = new(string)
  797. *ret.Appid = *o.Appid
  798. }
  799. if o.BatchStatus != nil {
  800. ret.BatchStatus = new(string)
  801. *ret.BatchStatus = *o.BatchStatus
  802. }
  803. if o.BatchType != nil {
  804. ret.BatchType = new(string)
  805. *ret.BatchType = *o.BatchType
  806. }
  807. if o.BatchName != nil {
  808. ret.BatchName = new(string)
  809. *ret.BatchName = *o.BatchName
  810. }
  811. if o.BatchRemark != nil {
  812. ret.BatchRemark = new(string)
  813. *ret.BatchRemark = *o.BatchRemark
  814. }
  815. if o.CloseReason != nil {
  816. ret.CloseReason = new(CloseReasonType)
  817. *ret.CloseReason = *o.CloseReason
  818. }
  819. if o.TotalAmount != nil {
  820. ret.TotalAmount = new(int64)
  821. *ret.TotalAmount = *o.TotalAmount
  822. }
  823. if o.TotalNum != nil {
  824. ret.TotalNum = new(int64)
  825. *ret.TotalNum = *o.TotalNum
  826. }
  827. if o.CreateTime != nil {
  828. ret.CreateTime = new(time.Time)
  829. *ret.CreateTime = *o.CreateTime
  830. }
  831. if o.UpdateTime != nil {
  832. ret.UpdateTime = new(time.Time)
  833. *ret.UpdateTime = *o.UpdateTime
  834. }
  835. if o.SuccessAmount != nil {
  836. ret.SuccessAmount = new(int64)
  837. *ret.SuccessAmount = *o.SuccessAmount
  838. }
  839. if o.SuccessNum != nil {
  840. ret.SuccessNum = new(int64)
  841. *ret.SuccessNum = *o.SuccessNum
  842. }
  843. if o.FailAmount != nil {
  844. ret.FailAmount = new(int64)
  845. *ret.FailAmount = *o.FailAmount
  846. }
  847. if o.FailNum != nil {
  848. ret.FailNum = new(int64)
  849. *ret.FailNum = *o.FailNum
  850. }
  851. if o.TransferSceneId != nil {
  852. ret.TransferSceneId = new(string)
  853. *ret.TransferSceneId = *o.TransferSceneId
  854. }
  855. return &ret
  856. }
  857. // TransferDetailCompact
  858. type TransferDetailCompact struct {
  859. // 微信支付系统内部区分转账批次单下不同转账明细单的唯一标识
  860. DetailId *string `json:"detail_id"`
  861. // 商户系统内部区分转账批次单下不同转账明细单的唯一标识
  862. OutDetailNo *string `json:"out_detail_no"`
  863. // INIT: 初始态。 系统转账校验中 WAIT_PAY: 待确认。待商户确认, 符合免密条件时, 系统会自动扭转为转账中 PROCESSING:转账中。正在处理中,转账结果尚未明确 SUCCESS:转账成功 FAIL:转账失败。需要确认失败原因后,再决定是否重新发起对该笔明细单的转账(并非整个转账批次单)
  864. DetailStatus *string `json:"detail_status"`
  865. }
  866. func (o TransferDetailCompact) MarshalJSON() ([]byte, error) {
  867. toSerialize := map[string]interface{}{}
  868. if o.DetailId == nil {
  869. return nil, fmt.Errorf("field `DetailId` is required and must be specified in TransferDetailCompact")
  870. }
  871. toSerialize["detail_id"] = o.DetailId
  872. if o.OutDetailNo == nil {
  873. return nil, fmt.Errorf("field `OutDetailNo` is required and must be specified in TransferDetailCompact")
  874. }
  875. toSerialize["out_detail_no"] = o.OutDetailNo
  876. if o.DetailStatus == nil {
  877. return nil, fmt.Errorf("field `DetailStatus` is required and must be specified in TransferDetailCompact")
  878. }
  879. toSerialize["detail_status"] = o.DetailStatus
  880. return json.Marshal(toSerialize)
  881. }
  882. func (o TransferDetailCompact) String() string {
  883. var ret string
  884. if o.DetailId == nil {
  885. ret += "DetailId:<nil>, "
  886. } else {
  887. ret += fmt.Sprintf("DetailId:%v, ", *o.DetailId)
  888. }
  889. if o.OutDetailNo == nil {
  890. ret += "OutDetailNo:<nil>, "
  891. } else {
  892. ret += fmt.Sprintf("OutDetailNo:%v, ", *o.OutDetailNo)
  893. }
  894. if o.DetailStatus == nil {
  895. ret += "DetailStatus:<nil>"
  896. } else {
  897. ret += fmt.Sprintf("DetailStatus:%v", *o.DetailStatus)
  898. }
  899. return fmt.Sprintf("TransferDetailCompact{%s}", ret)
  900. }
  901. func (o TransferDetailCompact) Clone() *TransferDetailCompact {
  902. ret := TransferDetailCompact{}
  903. if o.DetailId != nil {
  904. ret.DetailId = new(string)
  905. *ret.DetailId = *o.DetailId
  906. }
  907. if o.OutDetailNo != nil {
  908. ret.OutDetailNo = new(string)
  909. *ret.OutDetailNo = *o.OutDetailNo
  910. }
  911. if o.DetailStatus != nil {
  912. ret.DetailStatus = new(string)
  913. *ret.DetailStatus = *o.DetailStatus
  914. }
  915. return &ret
  916. }
  917. // TransferDetailEntity
  918. type TransferDetailEntity struct {
  919. // 微信支付分配的商户号
  920. Mchid *string `json:"mchid"`
  921. // 商户系统内部的商家批次单号,在商户系统内部唯一
  922. OutBatchNo *string `json:"out_batch_no"`
  923. // 微信批次单号,微信商家转账系统返回的唯一标识
  924. BatchId *string `json:"batch_id"`
  925. // 申请商户号的appid或商户号绑定的appid(企业号corpid即为此appid)
  926. Appid *string `json:"appid"`
  927. // 商户系统内部区分转账批次单下不同转账明细单的唯一标识
  928. OutDetailNo *string `json:"out_detail_no"`
  929. // 微信支付系统内部区分转账批次单下不同转账明细单的唯一标识
  930. DetailId *string `json:"detail_id"`
  931. // INIT: 初始态。 系统转账校验中 WAIT_PAY: 待确认。待商户确认, 符合免密条件时, 系统会自动扭转为转账中 PROCESSING:转账中。正在处理中,转账结果尚未明确 SUCCESS:转账成功 FAIL:转账失败。需要确认失败原因后,再决定是否重新发起对该笔明细单的转账(并非整个转账批次单)
  932. DetailStatus *string `json:"detail_status"`
  933. // 转账金额单位为“分”
  934. TransferAmount *int64 `json:"transfer_amount"`
  935. // 单条转账备注(微信用户会收到该备注),UTF8编码,最多允许32个字符
  936. TransferRemark *string `json:"transfer_remark"`
  937. // 如果转账失败则有失败原因
  938. FailReason *FailReasonType `json:"fail_reason,omitempty"`
  939. // 商户appid下,某用户的openid
  940. Openid *string `json:"openid"`
  941. // 收款方姓名。采用标准RSA算法,公钥由微信侧提供 商户转账时传入了收款用户姓名、查询时会返回收款用户姓名
  942. UserName *string `json:"user_name,omitempty" encryption:"EM_APIV3"`
  943. // 转账发起的时间,按照使用rfc3339所定义的格式,格式为YYYY-MM-DDThh:mm:ss+TIMEZONE
  944. InitiateTime *time.Time `json:"initiate_time"`
  945. // 明细最后一次状态变更的时间,按照使用rfc3339所定义的格式,格式为YYYY-MM-DDThh:mm:ss+TIMEZONE
  946. UpdateTime *time.Time `json:"update_time"`
  947. }
  948. func (o TransferDetailEntity) MarshalJSON() ([]byte, error) {
  949. toSerialize := map[string]interface{}{}
  950. if o.Mchid == nil {
  951. return nil, fmt.Errorf("field `Mchid` is required and must be specified in TransferDetailEntity")
  952. }
  953. toSerialize["mchid"] = o.Mchid
  954. if o.OutBatchNo == nil {
  955. return nil, fmt.Errorf("field `OutBatchNo` is required and must be specified in TransferDetailEntity")
  956. }
  957. toSerialize["out_batch_no"] = o.OutBatchNo
  958. if o.BatchId == nil {
  959. return nil, fmt.Errorf("field `BatchId` is required and must be specified in TransferDetailEntity")
  960. }
  961. toSerialize["batch_id"] = o.BatchId
  962. if o.Appid == nil {
  963. return nil, fmt.Errorf("field `Appid` is required and must be specified in TransferDetailEntity")
  964. }
  965. toSerialize["appid"] = o.Appid
  966. if o.OutDetailNo == nil {
  967. return nil, fmt.Errorf("field `OutDetailNo` is required and must be specified in TransferDetailEntity")
  968. }
  969. toSerialize["out_detail_no"] = o.OutDetailNo
  970. if o.DetailId == nil {
  971. return nil, fmt.Errorf("field `DetailId` is required and must be specified in TransferDetailEntity")
  972. }
  973. toSerialize["detail_id"] = o.DetailId
  974. if o.DetailStatus == nil {
  975. return nil, fmt.Errorf("field `DetailStatus` is required and must be specified in TransferDetailEntity")
  976. }
  977. toSerialize["detail_status"] = o.DetailStatus
  978. if o.TransferAmount == nil {
  979. return nil, fmt.Errorf("field `TransferAmount` is required and must be specified in TransferDetailEntity")
  980. }
  981. toSerialize["transfer_amount"] = o.TransferAmount
  982. if o.TransferRemark == nil {
  983. return nil, fmt.Errorf("field `TransferRemark` is required and must be specified in TransferDetailEntity")
  984. }
  985. toSerialize["transfer_remark"] = o.TransferRemark
  986. if o.FailReason != nil {
  987. toSerialize["fail_reason"] = o.FailReason
  988. }
  989. if o.Openid == nil {
  990. return nil, fmt.Errorf("field `Openid` is required and must be specified in TransferDetailEntity")
  991. }
  992. toSerialize["openid"] = o.Openid
  993. if o.UserName != nil {
  994. toSerialize["user_name"] = o.UserName
  995. }
  996. if o.InitiateTime == nil {
  997. return nil, fmt.Errorf("field `InitiateTime` is required and must be specified in TransferDetailEntity")
  998. }
  999. toSerialize["initiate_time"] = o.InitiateTime.Format(time.RFC3339)
  1000. if o.UpdateTime == nil {
  1001. return nil, fmt.Errorf("field `UpdateTime` is required and must be specified in TransferDetailEntity")
  1002. }
  1003. toSerialize["update_time"] = o.UpdateTime.Format(time.RFC3339)
  1004. return json.Marshal(toSerialize)
  1005. }
  1006. func (o TransferDetailEntity) String() string {
  1007. var ret string
  1008. if o.Mchid == nil {
  1009. ret += "Mchid:<nil>, "
  1010. } else {
  1011. ret += fmt.Sprintf("Mchid:%v, ", *o.Mchid)
  1012. }
  1013. if o.OutBatchNo == nil {
  1014. ret += "OutBatchNo:<nil>, "
  1015. } else {
  1016. ret += fmt.Sprintf("OutBatchNo:%v, ", *o.OutBatchNo)
  1017. }
  1018. if o.BatchId == nil {
  1019. ret += "BatchId:<nil>, "
  1020. } else {
  1021. ret += fmt.Sprintf("BatchId:%v, ", *o.BatchId)
  1022. }
  1023. if o.Appid == nil {
  1024. ret += "Appid:<nil>, "
  1025. } else {
  1026. ret += fmt.Sprintf("Appid:%v, ", *o.Appid)
  1027. }
  1028. if o.OutDetailNo == nil {
  1029. ret += "OutDetailNo:<nil>, "
  1030. } else {
  1031. ret += fmt.Sprintf("OutDetailNo:%v, ", *o.OutDetailNo)
  1032. }
  1033. if o.DetailId == nil {
  1034. ret += "DetailId:<nil>, "
  1035. } else {
  1036. ret += fmt.Sprintf("DetailId:%v, ", *o.DetailId)
  1037. }
  1038. if o.DetailStatus == nil {
  1039. ret += "DetailStatus:<nil>, "
  1040. } else {
  1041. ret += fmt.Sprintf("DetailStatus:%v, ", *o.DetailStatus)
  1042. }
  1043. if o.TransferAmount == nil {
  1044. ret += "TransferAmount:<nil>, "
  1045. } else {
  1046. ret += fmt.Sprintf("TransferAmount:%v, ", *o.TransferAmount)
  1047. }
  1048. if o.TransferRemark == nil {
  1049. ret += "TransferRemark:<nil>, "
  1050. } else {
  1051. ret += fmt.Sprintf("TransferRemark:%v, ", *o.TransferRemark)
  1052. }
  1053. if o.FailReason == nil {
  1054. ret += "FailReason:<nil>, "
  1055. } else {
  1056. ret += fmt.Sprintf("FailReason:%v, ", *o.FailReason)
  1057. }
  1058. if o.Openid == nil {
  1059. ret += "Openid:<nil>, "
  1060. } else {
  1061. ret += fmt.Sprintf("Openid:%v, ", *o.Openid)
  1062. }
  1063. if o.UserName == nil {
  1064. ret += "UserName:<nil>, "
  1065. } else {
  1066. ret += fmt.Sprintf("UserName:%v, ", *o.UserName)
  1067. }
  1068. if o.InitiateTime == nil {
  1069. ret += "InitiateTime:<nil>, "
  1070. } else {
  1071. ret += fmt.Sprintf("InitiateTime:%v, ", *o.InitiateTime)
  1072. }
  1073. if o.UpdateTime == nil {
  1074. ret += "UpdateTime:<nil>"
  1075. } else {
  1076. ret += fmt.Sprintf("UpdateTime:%v", *o.UpdateTime)
  1077. }
  1078. return fmt.Sprintf("TransferDetailEntity{%s}", ret)
  1079. }
  1080. func (o TransferDetailEntity) Clone() *TransferDetailEntity {
  1081. ret := TransferDetailEntity{}
  1082. if o.Mchid != nil {
  1083. ret.Mchid = new(string)
  1084. *ret.Mchid = *o.Mchid
  1085. }
  1086. if o.OutBatchNo != nil {
  1087. ret.OutBatchNo = new(string)
  1088. *ret.OutBatchNo = *o.OutBatchNo
  1089. }
  1090. if o.BatchId != nil {
  1091. ret.BatchId = new(string)
  1092. *ret.BatchId = *o.BatchId
  1093. }
  1094. if o.Appid != nil {
  1095. ret.Appid = new(string)
  1096. *ret.Appid = *o.Appid
  1097. }
  1098. if o.OutDetailNo != nil {
  1099. ret.OutDetailNo = new(string)
  1100. *ret.OutDetailNo = *o.OutDetailNo
  1101. }
  1102. if o.DetailId != nil {
  1103. ret.DetailId = new(string)
  1104. *ret.DetailId = *o.DetailId
  1105. }
  1106. if o.DetailStatus != nil {
  1107. ret.DetailStatus = new(string)
  1108. *ret.DetailStatus = *o.DetailStatus
  1109. }
  1110. if o.TransferAmount != nil {
  1111. ret.TransferAmount = new(int64)
  1112. *ret.TransferAmount = *o.TransferAmount
  1113. }
  1114. if o.TransferRemark != nil {
  1115. ret.TransferRemark = new(string)
  1116. *ret.TransferRemark = *o.TransferRemark
  1117. }
  1118. if o.FailReason != nil {
  1119. ret.FailReason = new(FailReasonType)
  1120. *ret.FailReason = *o.FailReason
  1121. }
  1122. if o.Openid != nil {
  1123. ret.Openid = new(string)
  1124. *ret.Openid = *o.Openid
  1125. }
  1126. if o.UserName != nil {
  1127. ret.UserName = new(string)
  1128. *ret.UserName = *o.UserName
  1129. }
  1130. if o.InitiateTime != nil {
  1131. ret.InitiateTime = new(time.Time)
  1132. *ret.InitiateTime = *o.InitiateTime
  1133. }
  1134. if o.UpdateTime != nil {
  1135. ret.UpdateTime = new(time.Time)
  1136. *ret.UpdateTime = *o.UpdateTime
  1137. }
  1138. return &ret
  1139. }
  1140. // TransferDetailInput
  1141. type TransferDetailInput struct {
  1142. // 商户系统内部区分转账批次单下不同转账明细单的唯一标识,要求此参数只能由数字、大小写字母组成
  1143. OutDetailNo *string `json:"out_detail_no"`
  1144. // 转账金额单位为“分”
  1145. TransferAmount *int64 `json:"transfer_amount"`
  1146. // 单条转账备注(微信用户会收到该备注),UTF8编码,最多允许32个字符
  1147. TransferRemark *string `json:"transfer_remark"`
  1148. // 商户appid下,某用户的openid
  1149. Openid *string `json:"openid"`
  1150. // 收款方真实姓名。支持标准RSA算法和国密算法,公钥由微信侧提供 明细转账金额<0.3元时,不允许填写收款用户姓名 明细转账金额 >= 2,000元时,该笔明细必须填写收款用户姓名 同一批次转账明细中的姓名字段传入规则需保持一致,也即全部填写、或全部不填写 若商户传入收款用户姓名,微信支付会校验用户openID与姓名是否一致,并提供电子回单
  1151. UserName *string `json:"user_name,omitempty" encryption:"EM_APIV3"`
  1152. }
  1153. func (o TransferDetailInput) MarshalJSON() ([]byte, error) {
  1154. toSerialize := map[string]interface{}{}
  1155. if o.OutDetailNo == nil {
  1156. return nil, fmt.Errorf("field `OutDetailNo` is required and must be specified in TransferDetailInput")
  1157. }
  1158. toSerialize["out_detail_no"] = o.OutDetailNo
  1159. if o.TransferAmount == nil {
  1160. return nil, fmt.Errorf("field `TransferAmount` is required and must be specified in TransferDetailInput")
  1161. }
  1162. toSerialize["transfer_amount"] = o.TransferAmount
  1163. if o.TransferRemark == nil {
  1164. return nil, fmt.Errorf("field `TransferRemark` is required and must be specified in TransferDetailInput")
  1165. }
  1166. toSerialize["transfer_remark"] = o.TransferRemark
  1167. if o.Openid == nil {
  1168. return nil, fmt.Errorf("field `Openid` is required and must be specified in TransferDetailInput")
  1169. }
  1170. toSerialize["openid"] = o.Openid
  1171. if o.UserName != nil {
  1172. toSerialize["user_name"] = o.UserName
  1173. }
  1174. return json.Marshal(toSerialize)
  1175. }
  1176. func (o TransferDetailInput) String() string {
  1177. var ret string
  1178. if o.OutDetailNo == nil {
  1179. ret += "OutDetailNo:<nil>, "
  1180. } else {
  1181. ret += fmt.Sprintf("OutDetailNo:%v, ", *o.OutDetailNo)
  1182. }
  1183. if o.TransferAmount == nil {
  1184. ret += "TransferAmount:<nil>, "
  1185. } else {
  1186. ret += fmt.Sprintf("TransferAmount:%v, ", *o.TransferAmount)
  1187. }
  1188. if o.TransferRemark == nil {
  1189. ret += "TransferRemark:<nil>, "
  1190. } else {
  1191. ret += fmt.Sprintf("TransferRemark:%v, ", *o.TransferRemark)
  1192. }
  1193. if o.Openid == nil {
  1194. ret += "Openid:<nil>, "
  1195. } else {
  1196. ret += fmt.Sprintf("Openid:%v, ", *o.Openid)
  1197. }
  1198. if o.UserName == nil {
  1199. ret += "UserName:<nil>"
  1200. } else {
  1201. ret += fmt.Sprintf("UserName:%v", *o.UserName)
  1202. }
  1203. return fmt.Sprintf("TransferDetailInput{%s}", ret)
  1204. }
  1205. func (o TransferDetailInput) Clone() *TransferDetailInput {
  1206. ret := TransferDetailInput{}
  1207. if o.OutDetailNo != nil {
  1208. ret.OutDetailNo = new(string)
  1209. *ret.OutDetailNo = *o.OutDetailNo
  1210. }
  1211. if o.TransferAmount != nil {
  1212. ret.TransferAmount = new(int64)
  1213. *ret.TransferAmount = *o.TransferAmount
  1214. }
  1215. if o.TransferRemark != nil {
  1216. ret.TransferRemark = new(string)
  1217. *ret.TransferRemark = *o.TransferRemark
  1218. }
  1219. if o.Openid != nil {
  1220. ret.Openid = new(string)
  1221. *ret.Openid = *o.Openid
  1222. }
  1223. if o.UserName != nil {
  1224. ret.UserName = new(string)
  1225. *ret.UserName = *o.UserName
  1226. }
  1227. return &ret
  1228. }