123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497 |
- // Copyright 2021 Tencent Inc. All rights reserved.
- //
- // 商家转账对外API
- //
- // * 场景及业务流程: 商户可通过该产品实现同时向多个用户微信零钱进行转账的操作,可用于发放奖金补贴、佣金货款结算、员工报销等场景。 [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方式发起转账”。 * 调用批量转账接口,对多个用户微信零钱发起转账。 * 调用查询批次接口,可获取到转账批次详情及当前状态。 * 调用查询明细接口,可获取到单条转账明细详情及当前状态。
- //
- // API version: 1.0.5
- // Code generated by WechatPay APIv3 Generator based on [OpenAPI Generator](https://openapi-generator.tech); DO NOT EDIT.
- package transferbatch
- import (
- "encoding/json"
- "fmt"
- "time"
- )
- // CloseReasonType
- type CloseReasonType string
- func (e CloseReasonType) Ptr() *CloseReasonType {
- return &e
- }
- // Enums of CloseReasonType
- const (
- CLOSEREASONTYPE_OVERDUE_CLOSE CloseReasonType = "OVERDUE_CLOSE"
- CLOSEREASONTYPE_TRANSFER_SCENE_INVALID CloseReasonType = "TRANSFER_SCENE_INVALID"
- )
- // FailReasonType
- type FailReasonType string
- func (e FailReasonType) Ptr() *FailReasonType {
- return &e
- }
- // Enums of FailReasonType
- const (
- FAILREASONTYPE_ACCOUNT_FROZEN FailReasonType = "ACCOUNT_FROZEN"
- FAILREASONTYPE_REAL_NAME_CHECK_FAIL FailReasonType = "REAL_NAME_CHECK_FAIL"
- FAILREASONTYPE_NAME_NOT_CORRECT FailReasonType = "NAME_NOT_CORRECT"
- FAILREASONTYPE_OPENID_INVALID FailReasonType = "OPENID_INVALID"
- FAILREASONTYPE_TRANSFER_QUOTA_EXCEED FailReasonType = "TRANSFER_QUOTA_EXCEED"
- FAILREASONTYPE_DAY_RECEIVED_QUOTA_EXCEED FailReasonType = "DAY_RECEIVED_QUOTA_EXCEED"
- FAILREASONTYPE_MONTH_RECEIVED_QUOTA_EXCEED FailReasonType = "MONTH_RECEIVED_QUOTA_EXCEED"
- FAILREASONTYPE_DAY_RECEIVED_COUNT_EXCEED FailReasonType = "DAY_RECEIVED_COUNT_EXCEED"
- FAILREASONTYPE_PRODUCT_AUTH_CHECK_FAIL FailReasonType = "PRODUCT_AUTH_CHECK_FAIL"
- FAILREASONTYPE_OVERDUE_CLOSE FailReasonType = "OVERDUE_CLOSE"
- FAILREASONTYPE_ID_CARD_NOT_CORRECT FailReasonType = "ID_CARD_NOT_CORRECT"
- FAILREASONTYPE_ACCOUNT_NOT_EXIST FailReasonType = "ACCOUNT_NOT_EXIST"
- FAILREASONTYPE_TRANSFER_RISK FailReasonType = "TRANSFER_RISK"
- FAILREASONTYPE_OTHER_FAIL_REASON_TYPE FailReasonType = "OTHER_FAIL_REASON_TYPE"
- FAILREASONTYPE_REALNAME_ACCOUNT_RECEIVED_QUOTA_EXCEED FailReasonType = "REALNAME_ACCOUNT_RECEIVED_QUOTA_EXCEED"
- FAILREASONTYPE_RECEIVE_ACCOUNT_NOT_PERMMIT FailReasonType = "RECEIVE_ACCOUNT_NOT_PERMMIT"
- FAILREASONTYPE_PAYEE_ACCOUNT_ABNORMAL FailReasonType = "PAYEE_ACCOUNT_ABNORMAL"
- FAILREASONTYPE_PAYER_ACCOUNT_ABNORMAL FailReasonType = "PAYER_ACCOUNT_ABNORMAL"
- FAILREASONTYPE_TRANSFER_SCENE_UNAVAILABLE FailReasonType = "TRANSFER_SCENE_UNAVAILABLE"
- FAILREASONTYPE_TRANSFER_SCENE_INVALID FailReasonType = "TRANSFER_SCENE_INVALID"
- FAILREASONTYPE_TRANSFER_REMARK_SET_FAIL FailReasonType = "TRANSFER_REMARK_SET_FAIL"
- FAILREASONTYPE_RECEIVE_ACCOUNT_NOT_CONFIGURE FailReasonType = "RECEIVE_ACCOUNT_NOT_CONFIGURE"
- FAILREASONTYPE_BLOCK_B2_C_USERLIMITAMOUNT_BSRULE_MONTH FailReasonType = "BLOCK_B2C_USERLIMITAMOUNT_BSRULE_MONTH"
- FAILREASONTYPE_BLOCK_B2_C_USERLIMITAMOUNT_MONTH FailReasonType = "BLOCK_B2C_USERLIMITAMOUNT_MONTH"
- FAILREASONTYPE_MERCHANT_REJECT FailReasonType = "MERCHANT_REJECT"
- FAILREASONTYPE_MERCHANT_NOT_CONFIRM FailReasonType = "MERCHANT_NOT_CONFIRM"
- )
- // GetTransferBatchByNoRequest
- type GetTransferBatchByNoRequest struct {
- // 微信批次单号,微信商家转账系统返回的唯一标识
- BatchId *string `json:"batch_id"`
- // true-是;false-否,默认否。商户可选择是否查询指定状态的转账明细单,当转账批次单状态为“FINISHED”(已完成)时,才会返回满足条件的转账明细单
- NeedQueryDetail *bool `json:"need_query_detail"`
- // 该次请求资源的起始位置。返回的明细是按照设置的明细条数进行分页展示的,一次查询可能无法返回所有明细,我们使用该参数标识查询开始位置,默认值为0
- Offset *int64 `json:"offset,omitempty"`
- // 该次请求可返回的最大明细条数,最小20条,最大100条,不传则默认20条。不足20条按实际条数返回
- Limit *int64 `json:"limit,omitempty"`
- // WAIT_PAY: 待确认。待商户确认, 符合免密条件时, 系统会自动扭转为转账中 ALL:全部。需要同时查询转账成功、失败和待确认的明细单 SUCCESS:转账成功 FAIL:转账失败。需要确认失败原因后,再决定是否重新发起对该笔明细单的转账(并非整个转账批次单)
- DetailStatus *string `json:"detail_status,omitempty"`
- }
- func (o GetTransferBatchByNoRequest) MarshalJSON() ([]byte, error) {
- toSerialize := map[string]interface{}{}
- if o.BatchId == nil {
- return nil, fmt.Errorf("field `BatchId` is required and must be specified in GetTransferBatchByNoRequest")
- }
- toSerialize["batch_id"] = o.BatchId
- if o.NeedQueryDetail == nil {
- return nil, fmt.Errorf("field `NeedQueryDetail` is required and must be specified in GetTransferBatchByNoRequest")
- }
- toSerialize["need_query_detail"] = o.NeedQueryDetail
- if o.Offset != nil {
- toSerialize["offset"] = o.Offset
- }
- if o.Limit != nil {
- toSerialize["limit"] = o.Limit
- }
- if o.DetailStatus != nil {
- toSerialize["detail_status"] = o.DetailStatus
- }
- return json.Marshal(toSerialize)
- }
- func (o GetTransferBatchByNoRequest) String() string {
- var ret string
- if o.BatchId == nil {
- ret += "BatchId:<nil>, "
- } else {
- ret += fmt.Sprintf("BatchId:%v, ", *o.BatchId)
- }
- if o.NeedQueryDetail == nil {
- ret += "NeedQueryDetail:<nil>, "
- } else {
- ret += fmt.Sprintf("NeedQueryDetail:%v, ", *o.NeedQueryDetail)
- }
- if o.Offset == nil {
- ret += "Offset:<nil>, "
- } else {
- ret += fmt.Sprintf("Offset:%v, ", *o.Offset)
- }
- if o.Limit == nil {
- ret += "Limit:<nil>, "
- } else {
- ret += fmt.Sprintf("Limit:%v, ", *o.Limit)
- }
- if o.DetailStatus == nil {
- ret += "DetailStatus:<nil>"
- } else {
- ret += fmt.Sprintf("DetailStatus:%v", *o.DetailStatus)
- }
- return fmt.Sprintf("GetTransferBatchByNoRequest{%s}", ret)
- }
- func (o GetTransferBatchByNoRequest) Clone() *GetTransferBatchByNoRequest {
- ret := GetTransferBatchByNoRequest{}
- if o.BatchId != nil {
- ret.BatchId = new(string)
- *ret.BatchId = *o.BatchId
- }
- if o.NeedQueryDetail != nil {
- ret.NeedQueryDetail = new(bool)
- *ret.NeedQueryDetail = *o.NeedQueryDetail
- }
- if o.Offset != nil {
- ret.Offset = new(int64)
- *ret.Offset = *o.Offset
- }
- if o.Limit != nil {
- ret.Limit = new(int64)
- *ret.Limit = *o.Limit
- }
- if o.DetailStatus != nil {
- ret.DetailStatus = new(string)
- *ret.DetailStatus = *o.DetailStatus
- }
- return &ret
- }
- // GetTransferBatchByOutNoRequest
- type GetTransferBatchByOutNoRequest struct {
- // 商户系统内部的商家批次单号,在商户系统内部唯一
- OutBatchNo *string `json:"out_batch_no"`
- // true-是;false-否,默认否。商户可选择是否查询指定状态的转账明细单,当转账批次单状态为“FINISHED”(已完成)时,才会返回满足条件的转账明细单
- NeedQueryDetail *bool `json:"need_query_detail"`
- // 该次请求资源(转账明细单)的起始位置,从0开始,默认值为0
- Offset *int64 `json:"offset,omitempty"`
- // 该次请求可返回的最大资源(转账明细单)条数,最小20条,最大100条,不传则默认20条。不足20条按实际条数返回
- Limit *int64 `json:"limit,omitempty"`
- // WAIT_PAY: 待确认。待商户确认, 符合免密条件时, 系统会自动扭转为转账中 ALL:全部。需要同时查询转账成功、失败和待确认的明细单 SUCCESS:转账成功 FAIL:转账失败。需要确认失败原因后,再决定是否重新发起对该笔明细单的转账(并非整个转账批次单)
- DetailStatus *string `json:"detail_status,omitempty"`
- }
- func (o GetTransferBatchByOutNoRequest) MarshalJSON() ([]byte, error) {
- toSerialize := map[string]interface{}{}
- if o.OutBatchNo == nil {
- return nil, fmt.Errorf("field `OutBatchNo` is required and must be specified in GetTransferBatchByOutNoRequest")
- }
- toSerialize["out_batch_no"] = o.OutBatchNo
- if o.NeedQueryDetail == nil {
- return nil, fmt.Errorf("field `NeedQueryDetail` is required and must be specified in GetTransferBatchByOutNoRequest")
- }
- toSerialize["need_query_detail"] = o.NeedQueryDetail
- if o.Offset != nil {
- toSerialize["offset"] = o.Offset
- }
- if o.Limit != nil {
- toSerialize["limit"] = o.Limit
- }
- if o.DetailStatus != nil {
- toSerialize["detail_status"] = o.DetailStatus
- }
- return json.Marshal(toSerialize)
- }
- func (o GetTransferBatchByOutNoRequest) String() string {
- var ret string
- if o.OutBatchNo == nil {
- ret += "OutBatchNo:<nil>, "
- } else {
- ret += fmt.Sprintf("OutBatchNo:%v, ", *o.OutBatchNo)
- }
- if o.NeedQueryDetail == nil {
- ret += "NeedQueryDetail:<nil>, "
- } else {
- ret += fmt.Sprintf("NeedQueryDetail:%v, ", *o.NeedQueryDetail)
- }
- if o.Offset == nil {
- ret += "Offset:<nil>, "
- } else {
- ret += fmt.Sprintf("Offset:%v, ", *o.Offset)
- }
- if o.Limit == nil {
- ret += "Limit:<nil>, "
- } else {
- ret += fmt.Sprintf("Limit:%v, ", *o.Limit)
- }
- if o.DetailStatus == nil {
- ret += "DetailStatus:<nil>"
- } else {
- ret += fmt.Sprintf("DetailStatus:%v", *o.DetailStatus)
- }
- return fmt.Sprintf("GetTransferBatchByOutNoRequest{%s}", ret)
- }
- func (o GetTransferBatchByOutNoRequest) Clone() *GetTransferBatchByOutNoRequest {
- ret := GetTransferBatchByOutNoRequest{}
- if o.OutBatchNo != nil {
- ret.OutBatchNo = new(string)
- *ret.OutBatchNo = *o.OutBatchNo
- }
- if o.NeedQueryDetail != nil {
- ret.NeedQueryDetail = new(bool)
- *ret.NeedQueryDetail = *o.NeedQueryDetail
- }
- if o.Offset != nil {
- ret.Offset = new(int64)
- *ret.Offset = *o.Offset
- }
- if o.Limit != nil {
- ret.Limit = new(int64)
- *ret.Limit = *o.Limit
- }
- if o.DetailStatus != nil {
- ret.DetailStatus = new(string)
- *ret.DetailStatus = *o.DetailStatus
- }
- return &ret
- }
- // GetTransferDetailByNoRequest
- type GetTransferDetailByNoRequest struct {
- // 微信批次单号,微信商家转账系统返回的唯一标识
- BatchId *string `json:"batch_id"`
- // 微信支付系统内部区分转账批次单下不同转账明细单的唯一标识
- DetailId *string `json:"detail_id"`
- }
- func (o GetTransferDetailByNoRequest) MarshalJSON() ([]byte, error) {
- toSerialize := map[string]interface{}{}
- if o.BatchId == nil {
- return nil, fmt.Errorf("field `BatchId` is required and must be specified in GetTransferDetailByNoRequest")
- }
- toSerialize["batch_id"] = o.BatchId
- if o.DetailId == nil {
- return nil, fmt.Errorf("field `DetailId` is required and must be specified in GetTransferDetailByNoRequest")
- }
- toSerialize["detail_id"] = o.DetailId
- return json.Marshal(toSerialize)
- }
- func (o GetTransferDetailByNoRequest) String() string {
- var ret string
- if o.BatchId == nil {
- ret += "BatchId:<nil>, "
- } else {
- ret += fmt.Sprintf("BatchId:%v, ", *o.BatchId)
- }
- if o.DetailId == nil {
- ret += "DetailId:<nil>"
- } else {
- ret += fmt.Sprintf("DetailId:%v", *o.DetailId)
- }
- return fmt.Sprintf("GetTransferDetailByNoRequest{%s}", ret)
- }
- func (o GetTransferDetailByNoRequest) Clone() *GetTransferDetailByNoRequest {
- ret := GetTransferDetailByNoRequest{}
- if o.BatchId != nil {
- ret.BatchId = new(string)
- *ret.BatchId = *o.BatchId
- }
- if o.DetailId != nil {
- ret.DetailId = new(string)
- *ret.DetailId = *o.DetailId
- }
- return &ret
- }
- // GetTransferDetailByOutNoRequest
- type GetTransferDetailByOutNoRequest struct {
- // 商户系统内部区分转账批次单下不同转账明细单的唯一标识
- OutDetailNo *string `json:"out_detail_no"`
- // 商户系统内部的商家批次单号,在商户系统内部唯一
- OutBatchNo *string `json:"out_batch_no"`
- }
- func (o GetTransferDetailByOutNoRequest) MarshalJSON() ([]byte, error) {
- toSerialize := map[string]interface{}{}
- if o.OutDetailNo == nil {
- return nil, fmt.Errorf("field `OutDetailNo` is required and must be specified in GetTransferDetailByOutNoRequest")
- }
- toSerialize["out_detail_no"] = o.OutDetailNo
- if o.OutBatchNo == nil {
- return nil, fmt.Errorf("field `OutBatchNo` is required and must be specified in GetTransferDetailByOutNoRequest")
- }
- toSerialize["out_batch_no"] = o.OutBatchNo
- return json.Marshal(toSerialize)
- }
- func (o GetTransferDetailByOutNoRequest) String() string {
- var ret string
- if o.OutDetailNo == nil {
- ret += "OutDetailNo:<nil>, "
- } else {
- ret += fmt.Sprintf("OutDetailNo:%v, ", *o.OutDetailNo)
- }
- if o.OutBatchNo == nil {
- ret += "OutBatchNo:<nil>"
- } else {
- ret += fmt.Sprintf("OutBatchNo:%v", *o.OutBatchNo)
- }
- return fmt.Sprintf("GetTransferDetailByOutNoRequest{%s}", ret)
- }
- func (o GetTransferDetailByOutNoRequest) Clone() *GetTransferDetailByOutNoRequest {
- ret := GetTransferDetailByOutNoRequest{}
- if o.OutDetailNo != nil {
- ret.OutDetailNo = new(string)
- *ret.OutDetailNo = *o.OutDetailNo
- }
- if o.OutBatchNo != nil {
- ret.OutBatchNo = new(string)
- *ret.OutBatchNo = *o.OutBatchNo
- }
- return &ret
- }
- // InitiateBatchTransferRequest
- type InitiateBatchTransferRequest struct {
- // 申请商户号的appid或商户号绑定的appid(企业号corpid即为此appid)
- Appid *string `json:"appid"`
- // 商户系统内部的商家批次单号,要求此参数只能由数字、大小写字母组成,在商户系统内部唯一
- OutBatchNo *string `json:"out_batch_no"`
- // 该笔批量转账的名称
- BatchName *string `json:"batch_name"`
- // 转账说明,UTF8编码,最多允许32个字符
- BatchRemark *string `json:"batch_remark"`
- // 转账金额单位为“分”。转账总金额必须与批次内所有明细转账金额之和保持一致,否则无法发起转账操作
- TotalAmount *int64 `json:"total_amount"`
- // 一个转账批次单最多发起一千笔转账。转账总笔数必须与批次内所有明细之和保持一致,否则无法发起转账操作
- TotalNum *int64 `json:"total_num"`
- // 发起批量转账的明细列表,最多一千笔
- TransferDetailList []TransferDetailInput `json:"transfer_detail_list"`
- // 该批次转账使用的转账场景,如不填写则使用商家的默认场景,如无默认场景可为空,可前往“商家转账到零钱-前往功能”中申请。 如:1001-现金营销
- TransferSceneId *string `json:"transfer_scene_id,omitempty"`
- // 商户接收批次结果通知的URL,必须支持https,且只能是直接可访问的URL,不允许携带查询参数
- NotifyUrl *string `json:"notify_url,omitempty"`
- }
- func (o InitiateBatchTransferRequest) MarshalJSON() ([]byte, error) {
- toSerialize := map[string]interface{}{}
- if o.Appid == nil {
- return nil, fmt.Errorf("field `Appid` is required and must be specified in InitiateBatchTransferRequest")
- }
- toSerialize["appid"] = o.Appid
- if o.OutBatchNo == nil {
- return nil, fmt.Errorf("field `OutBatchNo` is required and must be specified in InitiateBatchTransferRequest")
- }
- toSerialize["out_batch_no"] = o.OutBatchNo
- if o.BatchName == nil {
- return nil, fmt.Errorf("field `BatchName` is required and must be specified in InitiateBatchTransferRequest")
- }
- toSerialize["batch_name"] = o.BatchName
- if o.BatchRemark == nil {
- return nil, fmt.Errorf("field `BatchRemark` is required and must be specified in InitiateBatchTransferRequest")
- }
- toSerialize["batch_remark"] = o.BatchRemark
- if o.TotalAmount == nil {
- return nil, fmt.Errorf("field `TotalAmount` is required and must be specified in InitiateBatchTransferRequest")
- }
- toSerialize["total_amount"] = o.TotalAmount
- if o.TotalNum == nil {
- return nil, fmt.Errorf("field `TotalNum` is required and must be specified in InitiateBatchTransferRequest")
- }
- toSerialize["total_num"] = o.TotalNum
- if o.TransferDetailList == nil {
- return nil, fmt.Errorf("field `TransferDetailList` is required and must be specified in InitiateBatchTransferRequest")
- }
- toSerialize["transfer_detail_list"] = o.TransferDetailList
- if o.TransferSceneId != nil {
- toSerialize["transfer_scene_id"] = o.TransferSceneId
- }
- if o.NotifyUrl != nil {
- toSerialize["notify_url"] = o.NotifyUrl
- }
- return json.Marshal(toSerialize)
- }
- func (o InitiateBatchTransferRequest) String() string {
- var ret string
- if o.Appid == nil {
- ret += "Appid:<nil>, "
- } else {
- ret += fmt.Sprintf("Appid:%v, ", *o.Appid)
- }
- if o.OutBatchNo == nil {
- ret += "OutBatchNo:<nil>, "
- } else {
- ret += fmt.Sprintf("OutBatchNo:%v, ", *o.OutBatchNo)
- }
- if o.BatchName == nil {
- ret += "BatchName:<nil>, "
- } else {
- ret += fmt.Sprintf("BatchName:%v, ", *o.BatchName)
- }
- if o.BatchRemark == nil {
- ret += "BatchRemark:<nil>, "
- } else {
- ret += fmt.Sprintf("BatchRemark:%v, ", *o.BatchRemark)
- }
- if o.TotalAmount == nil {
- ret += "TotalAmount:<nil>, "
- } else {
- ret += fmt.Sprintf("TotalAmount:%v, ", *o.TotalAmount)
- }
- if o.TotalNum == nil {
- ret += "TotalNum:<nil>, "
- } else {
- ret += fmt.Sprintf("TotalNum:%v, ", *o.TotalNum)
- }
- ret += fmt.Sprintf("TransferDetailList:%v, ", o.TransferDetailList)
- if o.TransferSceneId == nil {
- ret += "TransferSceneId:<nil>"
- } else {
- ret += fmt.Sprintf("TransferSceneId:%v", *o.TransferSceneId)
- }
- if o.NotifyUrl == nil {
- ret += "NotifyUrl:<nil>"
- } else {
- ret += fmt.Sprintf("NotifyUrl:%v", *o.NotifyUrl)
- }
- return fmt.Sprintf("InitiateBatchTransferRequest{%s}", ret)
- }
- func (o InitiateBatchTransferRequest) Clone() *InitiateBatchTransferRequest {
- ret := InitiateBatchTransferRequest{}
- if o.Appid != nil {
- ret.Appid = new(string)
- *ret.Appid = *o.Appid
- }
- if o.OutBatchNo != nil {
- ret.OutBatchNo = new(string)
- *ret.OutBatchNo = *o.OutBatchNo
- }
- if o.BatchName != nil {
- ret.BatchName = new(string)
- *ret.BatchName = *o.BatchName
- }
- if o.BatchRemark != nil {
- ret.BatchRemark = new(string)
- *ret.BatchRemark = *o.BatchRemark
- }
- if o.TotalAmount != nil {
- ret.TotalAmount = new(int64)
- *ret.TotalAmount = *o.TotalAmount
- }
- if o.TotalNum != nil {
- ret.TotalNum = new(int64)
- *ret.TotalNum = *o.TotalNum
- }
- if o.TransferDetailList != nil {
- ret.TransferDetailList = make([]TransferDetailInput, len(o.TransferDetailList))
- for i, item := range o.TransferDetailList {
- ret.TransferDetailList[i] = *item.Clone()
- }
- }
- if o.TransferSceneId != nil {
- ret.TransferSceneId = new(string)
- *ret.TransferSceneId = *o.TransferSceneId
- }
- if o.NotifyUrl != nil {
- ret.NotifyUrl = new(string)
- *ret.NotifyUrl = *o.NotifyUrl
- }
- return &ret
- }
- // InitiateBatchTransferResponse
- type InitiateBatchTransferResponse struct {
- // 商户系统内部的商家批次单号,在商户系统内部唯一
- OutBatchNo *string `json:"out_batch_no"`
- // 微信批次单号,微信商家转账系统返回的唯一标识
- BatchId *string `json:"batch_id"`
- // 批次受理成功时返回,按照使用rfc3339所定义的格式,格式为YYYY-MM-DDThh:mm:ss+TIMEZONE
- CreateTime *time.Time `json:"create_time"`
- // ACCEPTED:已受理。批次已受理成功,若发起批量转账的30分钟后,转账批次单仍处于该状态,可能原因是商户账户余额不足等。商户可查询账户资金流水,若该笔转账批次单的扣款已经发生,则表示批次已经进入转账中,请再次查单确认 PROCESSING:转账中。已开始处理批次内的转账明细单 FINISHED:已完成。批次内的所有转账明细单都已处理完成 CLOSED:已关闭。可查询具体的批次关闭原因确认
- BatchStatus *string `json:"batch_status,omitempty"`
- }
- func (o InitiateBatchTransferResponse) MarshalJSON() ([]byte, error) {
- toSerialize := map[string]interface{}{}
- if o.OutBatchNo == nil {
- return nil, fmt.Errorf("field `OutBatchNo` is required and must be specified in InitiateBatchTransferResponse")
- }
- toSerialize["out_batch_no"] = o.OutBatchNo
- if o.BatchId == nil {
- return nil, fmt.Errorf("field `BatchId` is required and must be specified in InitiateBatchTransferResponse")
- }
- toSerialize["batch_id"] = o.BatchId
- if o.CreateTime == nil {
- return nil, fmt.Errorf("field `CreateTime` is required and must be specified in InitiateBatchTransferResponse")
- }
- toSerialize["create_time"] = o.CreateTime.Format(time.RFC3339)
- if o.BatchStatus != nil {
- toSerialize["batch_status"] = o.BatchStatus
- }
- return json.Marshal(toSerialize)
- }
- func (o InitiateBatchTransferResponse) String() string {
- var ret string
- if o.OutBatchNo == nil {
- ret += "OutBatchNo:<nil>, "
- } else {
- ret += fmt.Sprintf("OutBatchNo:%v, ", *o.OutBatchNo)
- }
- if o.BatchId == nil {
- ret += "BatchId:<nil>, "
- } else {
- ret += fmt.Sprintf("BatchId:%v, ", *o.BatchId)
- }
- if o.CreateTime == nil {
- ret += "CreateTime:<nil>, "
- } else {
- ret += fmt.Sprintf("CreateTime:%v, ", *o.CreateTime)
- }
- if o.BatchStatus == nil {
- ret += "BatchStatus:<nil>"
- } else {
- ret += fmt.Sprintf("BatchStatus:%v", *o.BatchStatus)
- }
- return fmt.Sprintf("InitiateBatchTransferResponse{%s}", ret)
- }
- func (o InitiateBatchTransferResponse) Clone() *InitiateBatchTransferResponse {
- ret := InitiateBatchTransferResponse{}
- if o.OutBatchNo != nil {
- ret.OutBatchNo = new(string)
- *ret.OutBatchNo = *o.OutBatchNo
- }
- if o.BatchId != nil {
- ret.BatchId = new(string)
- *ret.BatchId = *o.BatchId
- }
- if o.CreateTime != nil {
- ret.CreateTime = new(time.Time)
- *ret.CreateTime = *o.CreateTime
- }
- if o.BatchStatus != nil {
- ret.BatchStatus = new(string)
- *ret.BatchStatus = *o.BatchStatus
- }
- return &ret
- }
- // TransferBatchEntity
- type TransferBatchEntity struct {
- // 转账批次单基本信息
- TransferBatch *TransferBatchGet `json:"transfer_batch"`
- // 当批次状态为“FINISHED”(已完成),且成功查询到转账明细单时返回。包括微信明细单号、明细状态信息
- TransferDetailList []TransferDetailCompact `json:"transfer_detail_list,omitempty"`
- }
- func (o TransferBatchEntity) MarshalJSON() ([]byte, error) {
- toSerialize := map[string]interface{}{}
- if o.TransferBatch == nil {
- return nil, fmt.Errorf("field `TransferBatch` is required and must be specified in TransferBatchEntity")
- }
- toSerialize["transfer_batch"] = o.TransferBatch
- if o.TransferDetailList != nil {
- toSerialize["transfer_detail_list"] = o.TransferDetailList
- }
- return json.Marshal(toSerialize)
- }
- func (o TransferBatchEntity) String() string {
- var ret string
- ret += fmt.Sprintf("TransferBatch:%v, ", o.TransferBatch)
- ret += fmt.Sprintf("TransferDetailList:%v", o.TransferDetailList)
- return fmt.Sprintf("TransferBatchEntity{%s}", ret)
- }
- func (o TransferBatchEntity) Clone() *TransferBatchEntity {
- ret := TransferBatchEntity{}
- if o.TransferBatch != nil {
- ret.TransferBatch = o.TransferBatch.Clone()
- }
- if o.TransferDetailList != nil {
- ret.TransferDetailList = make([]TransferDetailCompact, len(o.TransferDetailList))
- for i, item := range o.TransferDetailList {
- ret.TransferDetailList[i] = *item.Clone()
- }
- }
- return &ret
- }
- // TransferBatchGet
- type TransferBatchGet struct {
- // 微信支付分配的商户号
- Mchid *string `json:"mchid"`
- // 商户系统内部的商家批次单号,在商户系统内部唯一
- OutBatchNo *string `json:"out_batch_no"`
- // 微信批次单号,微信商家转账系统返回的唯一标识
- BatchId *string `json:"batch_id"`
- // 申请商户号的appid或商户号绑定的appid(企业号corpid即为此appid)
- Appid *string `json:"appid"`
- // WAIT_PAY: 待付款确认。需要付款出资商户在商家助手小程序或服务商助手小程序进行付款确认 ACCEPTED:已受理。批次已受理成功,若发起批量转账的30分钟后,转账批次单仍处于该状态,可能原因是商户账户余额不足等。商户可查询账户资金流水,若该笔转账批次单的扣款已经发生,则表示批次已经进入转账中,请再次查单确认 PROCESSING:转账中。已开始处理批次内的转账明细单 FINISHED:已完成。批次内的所有转账明细单都已处理完成 CLOSED:已关闭。可查询具体的批次关闭原因确认
- BatchStatus *string `json:"batch_status"`
- // API:API方式发起 WEB:页面方式发起
- BatchType *string `json:"batch_type"`
- // 该笔批量转账的名称
- BatchName *string `json:"batch_name"`
- // 转账说明,UTF8编码,最多允许32个字符
- BatchRemark *string `json:"batch_remark"`
- // 如果批次单状态为“CLOSED”(已关闭),则有关闭原因
- CloseReason *CloseReasonType `json:"close_reason,omitempty"`
- // 转账金额单位为“分”
- TotalAmount *int64 `json:"total_amount"`
- // 一个转账批次单最多发起三千笔转账
- TotalNum *int64 `json:"total_num"`
- // 批次受理成功时返回,按照使用rfc3339所定义的格式,格式为YYYY-MM-DDThh:mm:ss+TIMEZONE
- CreateTime *time.Time `json:"create_time,omitempty"`
- // 批次最近一次状态变更的时间,按照使用rfc3339所定义的格式,格式为YYYY-MM-DDThh:mm:ss+TIMEZONE
- UpdateTime *time.Time `json:"update_time,omitempty"`
- // 转账成功的金额,单位为“分”。当批次状态为“PROCESSING”(转账中)时,转账成功金额随时可能变化
- SuccessAmount *int64 `json:"success_amount,omitempty"`
- // 转账成功的笔数。当批次状态为“PROCESSING”(转账中)时,转账成功笔数随时可能变化
- SuccessNum *int64 `json:"success_num,omitempty"`
- // 转账失败的金额,单位为“分”
- FailAmount *int64 `json:"fail_amount,omitempty"`
- // 转账失败的笔数
- FailNum *int64 `json:"fail_num,omitempty"`
- // 指定的转账场景ID
- TransferSceneId *string `json:"transfer_scene_id,omitempty"`
- }
- func (o TransferBatchGet) MarshalJSON() ([]byte, error) {
- toSerialize := map[string]interface{}{}
- if o.Mchid == nil {
- return nil, fmt.Errorf("field `Mchid` is required and must be specified in TransferBatchGet")
- }
- toSerialize["mchid"] = o.Mchid
- if o.OutBatchNo == nil {
- return nil, fmt.Errorf("field `OutBatchNo` is required and must be specified in TransferBatchGet")
- }
- toSerialize["out_batch_no"] = o.OutBatchNo
- if o.BatchId == nil {
- return nil, fmt.Errorf("field `BatchId` is required and must be specified in TransferBatchGet")
- }
- toSerialize["batch_id"] = o.BatchId
- if o.Appid == nil {
- return nil, fmt.Errorf("field `Appid` is required and must be specified in TransferBatchGet")
- }
- toSerialize["appid"] = o.Appid
- if o.BatchStatus == nil {
- return nil, fmt.Errorf("field `BatchStatus` is required and must be specified in TransferBatchGet")
- }
- toSerialize["batch_status"] = o.BatchStatus
- if o.BatchType == nil {
- return nil, fmt.Errorf("field `BatchType` is required and must be specified in TransferBatchGet")
- }
- toSerialize["batch_type"] = o.BatchType
- if o.BatchName == nil {
- return nil, fmt.Errorf("field `BatchName` is required and must be specified in TransferBatchGet")
- }
- toSerialize["batch_name"] = o.BatchName
- if o.BatchRemark == nil {
- return nil, fmt.Errorf("field `BatchRemark` is required and must be specified in TransferBatchGet")
- }
- toSerialize["batch_remark"] = o.BatchRemark
- if o.CloseReason != nil {
- toSerialize["close_reason"] = o.CloseReason
- }
- if o.TotalAmount == nil {
- return nil, fmt.Errorf("field `TotalAmount` is required and must be specified in TransferBatchGet")
- }
- toSerialize["total_amount"] = o.TotalAmount
- if o.TotalNum == nil {
- return nil, fmt.Errorf("field `TotalNum` is required and must be specified in TransferBatchGet")
- }
- toSerialize["total_num"] = o.TotalNum
- if o.CreateTime != nil {
- toSerialize["create_time"] = o.CreateTime.Format(time.RFC3339)
- }
- if o.UpdateTime != nil {
- toSerialize["update_time"] = o.UpdateTime.Format(time.RFC3339)
- }
- if o.SuccessAmount != nil {
- toSerialize["success_amount"] = o.SuccessAmount
- }
- if o.SuccessNum != nil {
- toSerialize["success_num"] = o.SuccessNum
- }
- if o.FailAmount != nil {
- toSerialize["fail_amount"] = o.FailAmount
- }
- if o.FailNum != nil {
- toSerialize["fail_num"] = o.FailNum
- }
- if o.TransferSceneId != nil {
- toSerialize["transfer_scene_id"] = o.TransferSceneId
- }
- return json.Marshal(toSerialize)
- }
- func (o TransferBatchGet) String() string {
- var ret string
- if o.Mchid == nil {
- ret += "Mchid:<nil>, "
- } else {
- ret += fmt.Sprintf("Mchid:%v, ", *o.Mchid)
- }
- if o.OutBatchNo == nil {
- ret += "OutBatchNo:<nil>, "
- } else {
- ret += fmt.Sprintf("OutBatchNo:%v, ", *o.OutBatchNo)
- }
- if o.BatchId == nil {
- ret += "BatchId:<nil>, "
- } else {
- ret += fmt.Sprintf("BatchId:%v, ", *o.BatchId)
- }
- if o.Appid == nil {
- ret += "Appid:<nil>, "
- } else {
- ret += fmt.Sprintf("Appid:%v, ", *o.Appid)
- }
- if o.BatchStatus == nil {
- ret += "BatchStatus:<nil>, "
- } else {
- ret += fmt.Sprintf("BatchStatus:%v, ", *o.BatchStatus)
- }
- if o.BatchType == nil {
- ret += "BatchType:<nil>, "
- } else {
- ret += fmt.Sprintf("BatchType:%v, ", *o.BatchType)
- }
- if o.BatchName == nil {
- ret += "BatchName:<nil>, "
- } else {
- ret += fmt.Sprintf("BatchName:%v, ", *o.BatchName)
- }
- if o.BatchRemark == nil {
- ret += "BatchRemark:<nil>, "
- } else {
- ret += fmt.Sprintf("BatchRemark:%v, ", *o.BatchRemark)
- }
- if o.CloseReason == nil {
- ret += "CloseReason:<nil>, "
- } else {
- ret += fmt.Sprintf("CloseReason:%v, ", *o.CloseReason)
- }
- if o.TotalAmount == nil {
- ret += "TotalAmount:<nil>, "
- } else {
- ret += fmt.Sprintf("TotalAmount:%v, ", *o.TotalAmount)
- }
- if o.TotalNum == nil {
- ret += "TotalNum:<nil>, "
- } else {
- ret += fmt.Sprintf("TotalNum:%v, ", *o.TotalNum)
- }
- if o.CreateTime == nil {
- ret += "CreateTime:<nil>, "
- } else {
- ret += fmt.Sprintf("CreateTime:%v, ", *o.CreateTime)
- }
- if o.UpdateTime == nil {
- ret += "UpdateTime:<nil>, "
- } else {
- ret += fmt.Sprintf("UpdateTime:%v, ", *o.UpdateTime)
- }
- if o.SuccessAmount == nil {
- ret += "SuccessAmount:<nil>, "
- } else {
- ret += fmt.Sprintf("SuccessAmount:%v, ", *o.SuccessAmount)
- }
- if o.SuccessNum == nil {
- ret += "SuccessNum:<nil>, "
- } else {
- ret += fmt.Sprintf("SuccessNum:%v, ", *o.SuccessNum)
- }
- if o.FailAmount == nil {
- ret += "FailAmount:<nil>, "
- } else {
- ret += fmt.Sprintf("FailAmount:%v, ", *o.FailAmount)
- }
- if o.FailNum == nil {
- ret += "FailNum:<nil>, "
- } else {
- ret += fmt.Sprintf("FailNum:%v, ", *o.FailNum)
- }
- if o.TransferSceneId == nil {
- ret += "TransferSceneId:<nil>"
- } else {
- ret += fmt.Sprintf("TransferSceneId:%v", *o.TransferSceneId)
- }
- return fmt.Sprintf("TransferBatchGet{%s}", ret)
- }
- func (o TransferBatchGet) Clone() *TransferBatchGet {
- ret := TransferBatchGet{}
- if o.Mchid != nil {
- ret.Mchid = new(string)
- *ret.Mchid = *o.Mchid
- }
- if o.OutBatchNo != nil {
- ret.OutBatchNo = new(string)
- *ret.OutBatchNo = *o.OutBatchNo
- }
- if o.BatchId != nil {
- ret.BatchId = new(string)
- *ret.BatchId = *o.BatchId
- }
- if o.Appid != nil {
- ret.Appid = new(string)
- *ret.Appid = *o.Appid
- }
- if o.BatchStatus != nil {
- ret.BatchStatus = new(string)
- *ret.BatchStatus = *o.BatchStatus
- }
- if o.BatchType != nil {
- ret.BatchType = new(string)
- *ret.BatchType = *o.BatchType
- }
- if o.BatchName != nil {
- ret.BatchName = new(string)
- *ret.BatchName = *o.BatchName
- }
- if o.BatchRemark != nil {
- ret.BatchRemark = new(string)
- *ret.BatchRemark = *o.BatchRemark
- }
- if o.CloseReason != nil {
- ret.CloseReason = new(CloseReasonType)
- *ret.CloseReason = *o.CloseReason
- }
- if o.TotalAmount != nil {
- ret.TotalAmount = new(int64)
- *ret.TotalAmount = *o.TotalAmount
- }
- if o.TotalNum != nil {
- ret.TotalNum = new(int64)
- *ret.TotalNum = *o.TotalNum
- }
- if o.CreateTime != nil {
- ret.CreateTime = new(time.Time)
- *ret.CreateTime = *o.CreateTime
- }
- if o.UpdateTime != nil {
- ret.UpdateTime = new(time.Time)
- *ret.UpdateTime = *o.UpdateTime
- }
- if o.SuccessAmount != nil {
- ret.SuccessAmount = new(int64)
- *ret.SuccessAmount = *o.SuccessAmount
- }
- if o.SuccessNum != nil {
- ret.SuccessNum = new(int64)
- *ret.SuccessNum = *o.SuccessNum
- }
- if o.FailAmount != nil {
- ret.FailAmount = new(int64)
- *ret.FailAmount = *o.FailAmount
- }
- if o.FailNum != nil {
- ret.FailNum = new(int64)
- *ret.FailNum = *o.FailNum
- }
- if o.TransferSceneId != nil {
- ret.TransferSceneId = new(string)
- *ret.TransferSceneId = *o.TransferSceneId
- }
- return &ret
- }
- // TransferDetailCompact
- type TransferDetailCompact struct {
- // 微信支付系统内部区分转账批次单下不同转账明细单的唯一标识
- DetailId *string `json:"detail_id"`
- // 商户系统内部区分转账批次单下不同转账明细单的唯一标识
- OutDetailNo *string `json:"out_detail_no"`
- // INIT: 初始态。 系统转账校验中 WAIT_PAY: 待确认。待商户确认, 符合免密条件时, 系统会自动扭转为转账中 PROCESSING:转账中。正在处理中,转账结果尚未明确 SUCCESS:转账成功 FAIL:转账失败。需要确认失败原因后,再决定是否重新发起对该笔明细单的转账(并非整个转账批次单)
- DetailStatus *string `json:"detail_status"`
- }
- func (o TransferDetailCompact) MarshalJSON() ([]byte, error) {
- toSerialize := map[string]interface{}{}
- if o.DetailId == nil {
- return nil, fmt.Errorf("field `DetailId` is required and must be specified in TransferDetailCompact")
- }
- toSerialize["detail_id"] = o.DetailId
- if o.OutDetailNo == nil {
- return nil, fmt.Errorf("field `OutDetailNo` is required and must be specified in TransferDetailCompact")
- }
- toSerialize["out_detail_no"] = o.OutDetailNo
- if o.DetailStatus == nil {
- return nil, fmt.Errorf("field `DetailStatus` is required and must be specified in TransferDetailCompact")
- }
- toSerialize["detail_status"] = o.DetailStatus
- return json.Marshal(toSerialize)
- }
- func (o TransferDetailCompact) String() string {
- var ret string
- if o.DetailId == nil {
- ret += "DetailId:<nil>, "
- } else {
- ret += fmt.Sprintf("DetailId:%v, ", *o.DetailId)
- }
- if o.OutDetailNo == nil {
- ret += "OutDetailNo:<nil>, "
- } else {
- ret += fmt.Sprintf("OutDetailNo:%v, ", *o.OutDetailNo)
- }
- if o.DetailStatus == nil {
- ret += "DetailStatus:<nil>"
- } else {
- ret += fmt.Sprintf("DetailStatus:%v", *o.DetailStatus)
- }
- return fmt.Sprintf("TransferDetailCompact{%s}", ret)
- }
- func (o TransferDetailCompact) Clone() *TransferDetailCompact {
- ret := TransferDetailCompact{}
- if o.DetailId != nil {
- ret.DetailId = new(string)
- *ret.DetailId = *o.DetailId
- }
- if o.OutDetailNo != nil {
- ret.OutDetailNo = new(string)
- *ret.OutDetailNo = *o.OutDetailNo
- }
- if o.DetailStatus != nil {
- ret.DetailStatus = new(string)
- *ret.DetailStatus = *o.DetailStatus
- }
- return &ret
- }
- // TransferDetailEntity
- type TransferDetailEntity struct {
- // 微信支付分配的商户号
- Mchid *string `json:"mchid"`
- // 商户系统内部的商家批次单号,在商户系统内部唯一
- OutBatchNo *string `json:"out_batch_no"`
- // 微信批次单号,微信商家转账系统返回的唯一标识
- BatchId *string `json:"batch_id"`
- // 申请商户号的appid或商户号绑定的appid(企业号corpid即为此appid)
- Appid *string `json:"appid"`
- // 商户系统内部区分转账批次单下不同转账明细单的唯一标识
- OutDetailNo *string `json:"out_detail_no"`
- // 微信支付系统内部区分转账批次单下不同转账明细单的唯一标识
- DetailId *string `json:"detail_id"`
- // INIT: 初始态。 系统转账校验中 WAIT_PAY: 待确认。待商户确认, 符合免密条件时, 系统会自动扭转为转账中 PROCESSING:转账中。正在处理中,转账结果尚未明确 SUCCESS:转账成功 FAIL:转账失败。需要确认失败原因后,再决定是否重新发起对该笔明细单的转账(并非整个转账批次单)
- DetailStatus *string `json:"detail_status"`
- // 转账金额单位为“分”
- TransferAmount *int64 `json:"transfer_amount"`
- // 单条转账备注(微信用户会收到该备注),UTF8编码,最多允许32个字符
- TransferRemark *string `json:"transfer_remark"`
- // 如果转账失败则有失败原因
- FailReason *FailReasonType `json:"fail_reason,omitempty"`
- // 商户appid下,某用户的openid
- Openid *string `json:"openid"`
- // 收款方姓名。采用标准RSA算法,公钥由微信侧提供 商户转账时传入了收款用户姓名、查询时会返回收款用户姓名
- UserName *string `json:"user_name,omitempty" encryption:"EM_APIV3"`
- // 转账发起的时间,按照使用rfc3339所定义的格式,格式为YYYY-MM-DDThh:mm:ss+TIMEZONE
- InitiateTime *time.Time `json:"initiate_time"`
- // 明细最后一次状态变更的时间,按照使用rfc3339所定义的格式,格式为YYYY-MM-DDThh:mm:ss+TIMEZONE
- UpdateTime *time.Time `json:"update_time"`
- }
- func (o TransferDetailEntity) MarshalJSON() ([]byte, error) {
- toSerialize := map[string]interface{}{}
- if o.Mchid == nil {
- return nil, fmt.Errorf("field `Mchid` is required and must be specified in TransferDetailEntity")
- }
- toSerialize["mchid"] = o.Mchid
- if o.OutBatchNo == nil {
- return nil, fmt.Errorf("field `OutBatchNo` is required and must be specified in TransferDetailEntity")
- }
- toSerialize["out_batch_no"] = o.OutBatchNo
- if o.BatchId == nil {
- return nil, fmt.Errorf("field `BatchId` is required and must be specified in TransferDetailEntity")
- }
- toSerialize["batch_id"] = o.BatchId
- if o.Appid == nil {
- return nil, fmt.Errorf("field `Appid` is required and must be specified in TransferDetailEntity")
- }
- toSerialize["appid"] = o.Appid
- if o.OutDetailNo == nil {
- return nil, fmt.Errorf("field `OutDetailNo` is required and must be specified in TransferDetailEntity")
- }
- toSerialize["out_detail_no"] = o.OutDetailNo
- if o.DetailId == nil {
- return nil, fmt.Errorf("field `DetailId` is required and must be specified in TransferDetailEntity")
- }
- toSerialize["detail_id"] = o.DetailId
- if o.DetailStatus == nil {
- return nil, fmt.Errorf("field `DetailStatus` is required and must be specified in TransferDetailEntity")
- }
- toSerialize["detail_status"] = o.DetailStatus
- if o.TransferAmount == nil {
- return nil, fmt.Errorf("field `TransferAmount` is required and must be specified in TransferDetailEntity")
- }
- toSerialize["transfer_amount"] = o.TransferAmount
- if o.TransferRemark == nil {
- return nil, fmt.Errorf("field `TransferRemark` is required and must be specified in TransferDetailEntity")
- }
- toSerialize["transfer_remark"] = o.TransferRemark
- if o.FailReason != nil {
- toSerialize["fail_reason"] = o.FailReason
- }
- if o.Openid == nil {
- return nil, fmt.Errorf("field `Openid` is required and must be specified in TransferDetailEntity")
- }
- toSerialize["openid"] = o.Openid
- if o.UserName != nil {
- toSerialize["user_name"] = o.UserName
- }
- if o.InitiateTime == nil {
- return nil, fmt.Errorf("field `InitiateTime` is required and must be specified in TransferDetailEntity")
- }
- toSerialize["initiate_time"] = o.InitiateTime.Format(time.RFC3339)
- if o.UpdateTime == nil {
- return nil, fmt.Errorf("field `UpdateTime` is required and must be specified in TransferDetailEntity")
- }
- toSerialize["update_time"] = o.UpdateTime.Format(time.RFC3339)
- return json.Marshal(toSerialize)
- }
- func (o TransferDetailEntity) String() string {
- var ret string
- if o.Mchid == nil {
- ret += "Mchid:<nil>, "
- } else {
- ret += fmt.Sprintf("Mchid:%v, ", *o.Mchid)
- }
- if o.OutBatchNo == nil {
- ret += "OutBatchNo:<nil>, "
- } else {
- ret += fmt.Sprintf("OutBatchNo:%v, ", *o.OutBatchNo)
- }
- if o.BatchId == nil {
- ret += "BatchId:<nil>, "
- } else {
- ret += fmt.Sprintf("BatchId:%v, ", *o.BatchId)
- }
- if o.Appid == nil {
- ret += "Appid:<nil>, "
- } else {
- ret += fmt.Sprintf("Appid:%v, ", *o.Appid)
- }
- if o.OutDetailNo == nil {
- ret += "OutDetailNo:<nil>, "
- } else {
- ret += fmt.Sprintf("OutDetailNo:%v, ", *o.OutDetailNo)
- }
- if o.DetailId == nil {
- ret += "DetailId:<nil>, "
- } else {
- ret += fmt.Sprintf("DetailId:%v, ", *o.DetailId)
- }
- if o.DetailStatus == nil {
- ret += "DetailStatus:<nil>, "
- } else {
- ret += fmt.Sprintf("DetailStatus:%v, ", *o.DetailStatus)
- }
- if o.TransferAmount == nil {
- ret += "TransferAmount:<nil>, "
- } else {
- ret += fmt.Sprintf("TransferAmount:%v, ", *o.TransferAmount)
- }
- if o.TransferRemark == nil {
- ret += "TransferRemark:<nil>, "
- } else {
- ret += fmt.Sprintf("TransferRemark:%v, ", *o.TransferRemark)
- }
- if o.FailReason == nil {
- ret += "FailReason:<nil>, "
- } else {
- ret += fmt.Sprintf("FailReason:%v, ", *o.FailReason)
- }
- if o.Openid == nil {
- ret += "Openid:<nil>, "
- } else {
- ret += fmt.Sprintf("Openid:%v, ", *o.Openid)
- }
- if o.UserName == nil {
- ret += "UserName:<nil>, "
- } else {
- ret += fmt.Sprintf("UserName:%v, ", *o.UserName)
- }
- if o.InitiateTime == nil {
- ret += "InitiateTime:<nil>, "
- } else {
- ret += fmt.Sprintf("InitiateTime:%v, ", *o.InitiateTime)
- }
- if o.UpdateTime == nil {
- ret += "UpdateTime:<nil>"
- } else {
- ret += fmt.Sprintf("UpdateTime:%v", *o.UpdateTime)
- }
- return fmt.Sprintf("TransferDetailEntity{%s}", ret)
- }
- func (o TransferDetailEntity) Clone() *TransferDetailEntity {
- ret := TransferDetailEntity{}
- if o.Mchid != nil {
- ret.Mchid = new(string)
- *ret.Mchid = *o.Mchid
- }
- if o.OutBatchNo != nil {
- ret.OutBatchNo = new(string)
- *ret.OutBatchNo = *o.OutBatchNo
- }
- if o.BatchId != nil {
- ret.BatchId = new(string)
- *ret.BatchId = *o.BatchId
- }
- if o.Appid != nil {
- ret.Appid = new(string)
- *ret.Appid = *o.Appid
- }
- if o.OutDetailNo != nil {
- ret.OutDetailNo = new(string)
- *ret.OutDetailNo = *o.OutDetailNo
- }
- if o.DetailId != nil {
- ret.DetailId = new(string)
- *ret.DetailId = *o.DetailId
- }
- if o.DetailStatus != nil {
- ret.DetailStatus = new(string)
- *ret.DetailStatus = *o.DetailStatus
- }
- if o.TransferAmount != nil {
- ret.TransferAmount = new(int64)
- *ret.TransferAmount = *o.TransferAmount
- }
- if o.TransferRemark != nil {
- ret.TransferRemark = new(string)
- *ret.TransferRemark = *o.TransferRemark
- }
- if o.FailReason != nil {
- ret.FailReason = new(FailReasonType)
- *ret.FailReason = *o.FailReason
- }
- if o.Openid != nil {
- ret.Openid = new(string)
- *ret.Openid = *o.Openid
- }
- if o.UserName != nil {
- ret.UserName = new(string)
- *ret.UserName = *o.UserName
- }
- if o.InitiateTime != nil {
- ret.InitiateTime = new(time.Time)
- *ret.InitiateTime = *o.InitiateTime
- }
- if o.UpdateTime != nil {
- ret.UpdateTime = new(time.Time)
- *ret.UpdateTime = *o.UpdateTime
- }
- return &ret
- }
- // TransferDetailInput
- type TransferDetailInput struct {
- // 商户系统内部区分转账批次单下不同转账明细单的唯一标识,要求此参数只能由数字、大小写字母组成
- OutDetailNo *string `json:"out_detail_no"`
- // 转账金额单位为“分”
- TransferAmount *int64 `json:"transfer_amount"`
- // 单条转账备注(微信用户会收到该备注),UTF8编码,最多允许32个字符
- TransferRemark *string `json:"transfer_remark"`
- // 商户appid下,某用户的openid
- Openid *string `json:"openid"`
- // 收款方真实姓名。支持标准RSA算法和国密算法,公钥由微信侧提供 明细转账金额<0.3元时,不允许填写收款用户姓名 明细转账金额 >= 2,000元时,该笔明细必须填写收款用户姓名 同一批次转账明细中的姓名字段传入规则需保持一致,也即全部填写、或全部不填写 若商户传入收款用户姓名,微信支付会校验用户openID与姓名是否一致,并提供电子回单
- UserName *string `json:"user_name,omitempty" encryption:"EM_APIV3"`
- }
- func (o TransferDetailInput) MarshalJSON() ([]byte, error) {
- toSerialize := map[string]interface{}{}
- if o.OutDetailNo == nil {
- return nil, fmt.Errorf("field `OutDetailNo` is required and must be specified in TransferDetailInput")
- }
- toSerialize["out_detail_no"] = o.OutDetailNo
- if o.TransferAmount == nil {
- return nil, fmt.Errorf("field `TransferAmount` is required and must be specified in TransferDetailInput")
- }
- toSerialize["transfer_amount"] = o.TransferAmount
- if o.TransferRemark == nil {
- return nil, fmt.Errorf("field `TransferRemark` is required and must be specified in TransferDetailInput")
- }
- toSerialize["transfer_remark"] = o.TransferRemark
- if o.Openid == nil {
- return nil, fmt.Errorf("field `Openid` is required and must be specified in TransferDetailInput")
- }
- toSerialize["openid"] = o.Openid
- if o.UserName != nil {
- toSerialize["user_name"] = o.UserName
- }
- return json.Marshal(toSerialize)
- }
- func (o TransferDetailInput) String() string {
- var ret string
- if o.OutDetailNo == nil {
- ret += "OutDetailNo:<nil>, "
- } else {
- ret += fmt.Sprintf("OutDetailNo:%v, ", *o.OutDetailNo)
- }
- if o.TransferAmount == nil {
- ret += "TransferAmount:<nil>, "
- } else {
- ret += fmt.Sprintf("TransferAmount:%v, ", *o.TransferAmount)
- }
- if o.TransferRemark == nil {
- ret += "TransferRemark:<nil>, "
- } else {
- ret += fmt.Sprintf("TransferRemark:%v, ", *o.TransferRemark)
- }
- if o.Openid == nil {
- ret += "Openid:<nil>, "
- } else {
- ret += fmt.Sprintf("Openid:%v, ", *o.Openid)
- }
- if o.UserName == nil {
- ret += "UserName:<nil>"
- } else {
- ret += fmt.Sprintf("UserName:%v", *o.UserName)
- }
- return fmt.Sprintf("TransferDetailInput{%s}", ret)
- }
- func (o TransferDetailInput) Clone() *TransferDetailInput {
- ret := TransferDetailInput{}
- if o.OutDetailNo != nil {
- ret.OutDetailNo = new(string)
- *ret.OutDetailNo = *o.OutDetailNo
- }
- if o.TransferAmount != nil {
- ret.TransferAmount = new(int64)
- *ret.TransferAmount = *o.TransferAmount
- }
- if o.TransferRemark != nil {
- ret.TransferRemark = new(string)
- *ret.TransferRemark = *o.TransferRemark
- }
- if o.Openid != nil {
- ret.Openid = new(string)
- *ret.Openid = *o.Openid
- }
- if o.UserName != nil {
- ret.UserName = new(string)
- *ret.UserName = *o.UserName
- }
- return &ret
- }
|