// Copyright 2021 Tencent Inc. All rights reserved. // // 公共出行平台代扣服务对外API // // 公共出行平台代扣服务对外API // // API version: 1.0.0 // Code generated by WechatPay APIv3 Generator based on [OpenAPI Generator](https://openapi-generator.tech); DO NOT EDIT. package weixinpayscanandride import ( "encoding/json" "fmt" ) // BlockReasonEnum type BlockReasonEnum string func (e BlockReasonEnum) Ptr() *BlockReasonEnum { return &e } // Enums of BlockReasonEnum const ( BLOCKREASONENUM_DELETED BlockReasonEnum = "DELETED" BLOCKREASONENUM_ACCOUNT_FROZEN BlockReasonEnum = "ACCOUNT_FROZEN" BLOCKREASONENUM_OVERDUE BlockReasonEnum = "OVERDUE" ) // BusSceneInfo type BusSceneInfo struct { // 用户乘车时间(上车),按照使用rfc3339所定义的格式,格式为yyyy-MM-DDThh:mm:ss+TIMEZONE StartTime *string `json:"start_time"` // 乘车路线 路线名称的展示规则:\\^[A-Za-z0-9]{1,10}路$ 如line_name符合上述的规则,扣款凭证将增加展示乘车路线的字段 LineName *string `json:"line_name,omitempty"` // 车牌号。仅包括省份+车牌,不包括特殊字符。 PlateNumber *string `json:"plate_number,omitempty"` } func (o BusSceneInfo) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} if o.StartTime == nil { return nil, fmt.Errorf("field `StartTime` is required and must be specified in BusSceneInfo") } toSerialize["start_time"] = o.StartTime if o.LineName != nil { toSerialize["line_name"] = o.LineName } if o.PlateNumber != nil { toSerialize["plate_number"] = o.PlateNumber } return json.Marshal(toSerialize) } func (o BusSceneInfo) String() string { var ret string if o.StartTime == nil { ret += "StartTime:, " } else { ret += fmt.Sprintf("StartTime:%v, ", *o.StartTime) } if o.LineName == nil { ret += "LineName:, " } else { ret += fmt.Sprintf("LineName:%v, ", *o.LineName) } if o.PlateNumber == nil { ret += "PlateNumber:" } else { ret += fmt.Sprintf("PlateNumber:%v", *o.PlateNumber) } return fmt.Sprintf("BusSceneInfo{%s}", ret) } func (o BusSceneInfo) Clone() *BusSceneInfo { ret := BusSceneInfo{} if o.StartTime != nil { ret.StartTime = new(string) *ret.StartTime = *o.StartTime } if o.LineName != nil { ret.LineName = new(string) *ret.LineName = *o.LineName } if o.PlateNumber != nil { ret.PlateNumber = new(string) *ret.PlateNumber = *o.PlateNumber } return &ret } // CreateTransactionRequest type CreateTransactionRequest struct { // 商户在微信申请公众号或移动应用成功后分配的账号ID,登录平台为mp.weixin.qq.com或open.weixin.qq.com Appid *string `json:"appid"` // 子公众账号ID,服务商模式下选传,用于扣费信息的商户信息展示, SubAppid *string `json:"sub_appid,omitempty"` // 微信支付分配的子商户号,服务商模式下必传 SubMchid *string `json:"sub_mchid,omitempty"` // 商户自定义字段,用于交易账单中对扣费服务的描述。该字段长度限制为字节长度限制 Description *string `json:"description"` // 附加数据,在查询API和支付通知中原样返回,可作为自定义参数使用,该字段长度限制为字节长度限制 Attach *string `json:"attach,omitempty"` // 商户系统内部订单号,只能是数字、大小写字母,且在同一个商户号下唯一。该字段长度限制为字节长度限制 OutTradeNo *string `json:"out_trade_no"` // 交易场景值,现在支持公交和地铁的场景值 TradeScene *TradeScene `json:"trade_scene"` // 代金券或立减优惠功能的参数,说明详见代金券或立减优惠 GoodsTag *string `json:"goods_tag,omitempty"` // 签约成功后,微信返回代扣签约ID 查用户是否能继续使用乘车卡时必传,此时,才会返回签约信息,如contract_state ContractId *string `json:"contract_id"` // 接受扣款结果异步回调通知的URL,注意回调URL只接受HTTPS NotifyUrl *string `json:"notify_url"` // 订单金额信息 Amount *OrderAmount `json:"amount"` // 请求受理扣费 tradescene为BUS时,传入该参数 BusInfo *BusSceneInfo `json:"bus_info,omitempty"` // 请求受理扣费 tradescene为METRO时,传入该参数 MetroInfo *MetroSceneInfo `json:"metro_info,omitempty"` } func (o CreateTransactionRequest) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} if o.Appid == nil { return nil, fmt.Errorf("field `Appid` is required and must be specified in CreateTransactionRequest") } toSerialize["appid"] = o.Appid if o.SubAppid != nil { toSerialize["sub_appid"] = o.SubAppid } if o.SubMchid != nil { toSerialize["sub_mchid"] = o.SubMchid } if o.Description == nil { return nil, fmt.Errorf("field `Description` is required and must be specified in CreateTransactionRequest") } toSerialize["description"] = o.Description if o.Attach != nil { toSerialize["attach"] = o.Attach } if o.OutTradeNo == nil { return nil, fmt.Errorf("field `OutTradeNo` is required and must be specified in CreateTransactionRequest") } toSerialize["out_trade_no"] = o.OutTradeNo if o.TradeScene == nil { return nil, fmt.Errorf("field `TradeScene` is required and must be specified in CreateTransactionRequest") } toSerialize["trade_scene"] = o.TradeScene if o.GoodsTag != nil { toSerialize["goods_tag"] = o.GoodsTag } if o.ContractId == nil { return nil, fmt.Errorf("field `ContractId` is required and must be specified in CreateTransactionRequest") } toSerialize["contract_id"] = o.ContractId if o.NotifyUrl == nil { return nil, fmt.Errorf("field `NotifyUrl` is required and must be specified in CreateTransactionRequest") } toSerialize["notify_url"] = o.NotifyUrl if o.Amount == nil { return nil, fmt.Errorf("field `Amount` is required and must be specified in CreateTransactionRequest") } toSerialize["amount"] = o.Amount if o.BusInfo != nil { toSerialize["bus_info"] = o.BusInfo } if o.MetroInfo != nil { toSerialize["metro_info"] = o.MetroInfo } return json.Marshal(toSerialize) } func (o CreateTransactionRequest) String() string { var ret string if o.Appid == nil { ret += "Appid:, " } else { ret += fmt.Sprintf("Appid:%v, ", *o.Appid) } if o.SubAppid == nil { ret += "SubAppid:, " } else { ret += fmt.Sprintf("SubAppid:%v, ", *o.SubAppid) } if o.SubMchid == nil { ret += "SubMchid:, " } else { ret += fmt.Sprintf("SubMchid:%v, ", *o.SubMchid) } if o.Description == nil { ret += "Description:, " } else { ret += fmt.Sprintf("Description:%v, ", *o.Description) } if o.Attach == nil { ret += "Attach:, " } else { ret += fmt.Sprintf("Attach:%v, ", *o.Attach) } if o.OutTradeNo == nil { ret += "OutTradeNo:, " } else { ret += fmt.Sprintf("OutTradeNo:%v, ", *o.OutTradeNo) } if o.TradeScene == nil { ret += "TradeScene:, " } else { ret += fmt.Sprintf("TradeScene:%v, ", *o.TradeScene) } if o.GoodsTag == nil { ret += "GoodsTag:, " } else { ret += fmt.Sprintf("GoodsTag:%v, ", *o.GoodsTag) } if o.ContractId == nil { ret += "ContractId:, " } else { ret += fmt.Sprintf("ContractId:%v, ", *o.ContractId) } if o.NotifyUrl == nil { ret += "NotifyUrl:, " } else { ret += fmt.Sprintf("NotifyUrl:%v, ", *o.NotifyUrl) } ret += fmt.Sprintf("Amount:%v, ", o.Amount) ret += fmt.Sprintf("BusInfo:%v, ", o.BusInfo) ret += fmt.Sprintf("MetroInfo:%v", o.MetroInfo) return fmt.Sprintf("CreateTransactionRequest{%s}", ret) } func (o CreateTransactionRequest) Clone() *CreateTransactionRequest { ret := CreateTransactionRequest{} if o.Appid != nil { ret.Appid = new(string) *ret.Appid = *o.Appid } if o.SubAppid != nil { ret.SubAppid = new(string) *ret.SubAppid = *o.SubAppid } if o.SubMchid != nil { ret.SubMchid = new(string) *ret.SubMchid = *o.SubMchid } if o.Description != nil { ret.Description = new(string) *ret.Description = *o.Description } if o.Attach != nil { ret.Attach = new(string) *ret.Attach = *o.Attach } if o.OutTradeNo != nil { ret.OutTradeNo = new(string) *ret.OutTradeNo = *o.OutTradeNo } if o.TradeScene != nil { ret.TradeScene = new(TradeScene) *ret.TradeScene = *o.TradeScene } if o.GoodsTag != nil { ret.GoodsTag = new(string) *ret.GoodsTag = *o.GoodsTag } if o.ContractId != nil { ret.ContractId = new(string) *ret.ContractId = *o.ContractId } if o.NotifyUrl != nil { ret.NotifyUrl = new(string) *ret.NotifyUrl = *o.NotifyUrl } if o.Amount != nil { ret.Amount = o.Amount.Clone() } if o.BusInfo != nil { ret.BusInfo = o.BusInfo.Clone() } if o.MetroInfo != nil { ret.MetroInfo = o.MetroInfo.Clone() } return &ret } // MetroSceneInfo type MetroSceneInfo struct { // 用户乘车时间(上车),按照使用rfc3339所定义的格式,格式为yyyy-MM-DDThh:mm:ss+TIMEZONE StartTime *string `json:"start_time"` // 用户下车时间,按照使用rfc3339所定义的格式,格式为yyyy-MM-DDThh:mm:ss+TIMEZONE EndTime *string `json:"end_time,omitempty"` // 乘车起始站,该值催缴时会向微信用户进行展示 StartStation *string `json:"start_station,omitempty"` // 乘车终点站,该值催缴时会向微信用户进行展示 EndStation *string `json:"end_station,omitempty"` } func (o MetroSceneInfo) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} if o.StartTime == nil { return nil, fmt.Errorf("field `StartTime` is required and must be specified in MetroSceneInfo") } toSerialize["start_time"] = o.StartTime if o.EndTime != nil { toSerialize["end_time"] = o.EndTime } if o.StartStation != nil { toSerialize["start_station"] = o.StartStation } if o.EndStation != nil { toSerialize["end_station"] = o.EndStation } return json.Marshal(toSerialize) } func (o MetroSceneInfo) String() string { var ret string if o.StartTime == nil { ret += "StartTime:, " } else { ret += fmt.Sprintf("StartTime:%v, ", *o.StartTime) } if o.EndTime == nil { ret += "EndTime:, " } else { ret += fmt.Sprintf("EndTime:%v, ", *o.EndTime) } if o.StartStation == nil { ret += "StartStation:, " } else { ret += fmt.Sprintf("StartStation:%v, ", *o.StartStation) } if o.EndStation == nil { ret += "EndStation:" } else { ret += fmt.Sprintf("EndStation:%v", *o.EndStation) } return fmt.Sprintf("MetroSceneInfo{%s}", ret) } func (o MetroSceneInfo) Clone() *MetroSceneInfo { ret := MetroSceneInfo{} if o.StartTime != nil { ret.StartTime = new(string) *ret.StartTime = *o.StartTime } if o.EndTime != nil { ret.EndTime = new(string) *ret.EndTime = *o.EndTime } if o.StartStation != nil { ret.StartStation = new(string) *ret.StartStation = *o.StartStation } if o.EndStation != nil { ret.EndStation = new(string) *ret.EndStation = *o.EndStation } return &ret } // OrderAmount type OrderAmount struct { // 订单总金额,单位为分,只能为整数,详见支付金额 Total *int64 `json:"total"` // 符合ISO 4217标准的三位字母代码,目前只支持人民币:CNY Currency *string `json:"currency,omitempty"` } func (o OrderAmount) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} if o.Total == nil { return nil, fmt.Errorf("field `Total` is required and must be specified in OrderAmount") } toSerialize["total"] = o.Total if o.Currency != nil { toSerialize["currency"] = o.Currency } return json.Marshal(toSerialize) } func (o OrderAmount) String() string { var ret string if o.Total == nil { ret += "Total:, " } else { ret += fmt.Sprintf("Total:%v, ", *o.Total) } if o.Currency == nil { ret += "Currency:" } else { ret += fmt.Sprintf("Currency:%v", *o.Currency) } return fmt.Sprintf("OrderAmount{%s}", ret) } func (o OrderAmount) Clone() *OrderAmount { ret := OrderAmount{} if o.Total != nil { ret.Total = new(int64) *ret.Total = *o.Total } if o.Currency != nil { ret.Currency = new(string) *ret.Currency = *o.Currency } return &ret } // PromotionDetail type PromotionDetail struct { // 券或者立减优惠ID CouponId *string `json:"coupon_id"` // 优惠名称 Name *string `json:"name,omitempty"` // GLOBAL-全场代金券,SINGLE-单品优惠 Scope *string `json:"scope,omitempty"` // 优惠类型,枚举值有: Type *PromotionType `json:"type,omitempty"` // 在微信商户后台配置的批次ID StockId *string `json:"stock_id,omitempty"` // 用户享受优惠的金额 Amount *int64 `json:"amount"` // 特指由微信支付商户平台创建的优惠,出资金额等于本项优惠总金额,单位为分 WechatpayContribute *int64 `json:"wechatpay_contribute,omitempty"` // 特指商户自己创建的优惠,出资金额等于本项优惠总金额,单位为分 MerchantContribute *int64 `json:"merchant_contribute,omitempty"` // 其他出资方出资金额,单位为分 OtherContribute *int64 `json:"other_contribute,omitempty"` // CNY:人民币,境内商户号仅支持人民币。 Currency *string `json:"currency,omitempty"` } func (o PromotionDetail) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} if o.CouponId == nil { return nil, fmt.Errorf("field `CouponId` is required and must be specified in PromotionDetail") } toSerialize["coupon_id"] = o.CouponId if o.Name != nil { toSerialize["name"] = o.Name } if o.Scope != nil { toSerialize["scope"] = o.Scope } if o.Type != nil { toSerialize["type"] = o.Type } if o.StockId != nil { toSerialize["stock_id"] = o.StockId } if o.Amount == nil { return nil, fmt.Errorf("field `Amount` is required and must be specified in PromotionDetail") } toSerialize["amount"] = o.Amount if o.WechatpayContribute != nil { toSerialize["wechatpay_contribute"] = o.WechatpayContribute } if o.MerchantContribute != nil { toSerialize["merchant_contribute"] = o.MerchantContribute } if o.OtherContribute != nil { toSerialize["other_contribute"] = o.OtherContribute } if o.Currency != nil { toSerialize["currency"] = o.Currency } return json.Marshal(toSerialize) } func (o PromotionDetail) String() string { var ret string if o.CouponId == nil { ret += "CouponId:, " } else { ret += fmt.Sprintf("CouponId:%v, ", *o.CouponId) } if o.Name == nil { ret += "Name:, " } else { ret += fmt.Sprintf("Name:%v, ", *o.Name) } if o.Scope == nil { ret += "Scope:, " } else { ret += fmt.Sprintf("Scope:%v, ", *o.Scope) } if o.Type == nil { ret += "Type:, " } else { ret += fmt.Sprintf("Type:%v, ", *o.Type) } if o.StockId == nil { ret += "StockId:, " } else { ret += fmt.Sprintf("StockId:%v, ", *o.StockId) } if o.Amount == nil { ret += "Amount:, " } else { ret += fmt.Sprintf("Amount:%v, ", *o.Amount) } if o.WechatpayContribute == nil { ret += "WechatpayContribute:, " } else { ret += fmt.Sprintf("WechatpayContribute:%v, ", *o.WechatpayContribute) } if o.MerchantContribute == nil { ret += "MerchantContribute:, " } else { ret += fmt.Sprintf("MerchantContribute:%v, ", *o.MerchantContribute) } if o.OtherContribute == nil { ret += "OtherContribute:, " } else { ret += fmt.Sprintf("OtherContribute:%v, ", *o.OtherContribute) } if o.Currency == nil { ret += "Currency:" } else { ret += fmt.Sprintf("Currency:%v", *o.Currency) } return fmt.Sprintf("PromotionDetail{%s}", ret) } func (o PromotionDetail) Clone() *PromotionDetail { ret := PromotionDetail{} if o.CouponId != nil { ret.CouponId = new(string) *ret.CouponId = *o.CouponId } if o.Name != nil { ret.Name = new(string) *ret.Name = *o.Name } if o.Scope != nil { ret.Scope = new(string) *ret.Scope = *o.Scope } if o.Type != nil { ret.Type = new(PromotionType) *ret.Type = *o.Type } if o.StockId != nil { ret.StockId = new(string) *ret.StockId = *o.StockId } if o.Amount != nil { ret.Amount = new(int64) *ret.Amount = *o.Amount } if o.WechatpayContribute != nil { ret.WechatpayContribute = new(int64) *ret.WechatpayContribute = *o.WechatpayContribute } if o.MerchantContribute != nil { ret.MerchantContribute = new(int64) *ret.MerchantContribute = *o.MerchantContribute } if o.OtherContribute != nil { ret.OtherContribute = new(int64) *ret.OtherContribute = *o.OtherContribute } if o.Currency != nil { ret.Currency = new(string) *ret.Currency = *o.Currency } return &ret } // PromotionType type PromotionType string func (e PromotionType) Ptr() *PromotionType { return &e } // Enums of PromotionType const ( PROMOTIONTYPE_CASH PromotionType = "CASH" PROMOTIONTYPE_NOCASH PromotionType = "NOCASH" ) // QueryOrderAmount type QueryOrderAmount struct { // 订单总金额,单位为分,只能为整数,详见支付金额 Total *int64 `json:"total,omitempty"` // 用户实际支付金额,单位为分,只能为整数,详见支付金额 PayerTotal *int64 `json:"payer_total,omitempty"` // CNY:人民币,境内商户号仅支持人民币。 Currency *string `json:"currency,omitempty"` } func (o QueryOrderAmount) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} if o.Total != nil { toSerialize["total"] = o.Total } if o.PayerTotal != nil { toSerialize["payer_total"] = o.PayerTotal } if o.Currency != nil { toSerialize["currency"] = o.Currency } return json.Marshal(toSerialize) } func (o QueryOrderAmount) String() string { var ret string if o.Total == nil { ret += "Total:, " } else { ret += fmt.Sprintf("Total:%v, ", *o.Total) } if o.PayerTotal == nil { ret += "PayerTotal:, " } else { ret += fmt.Sprintf("PayerTotal:%v, ", *o.PayerTotal) } if o.Currency == nil { ret += "Currency:" } else { ret += fmt.Sprintf("Currency:%v", *o.Currency) } return fmt.Sprintf("QueryOrderAmount{%s}", ret) } func (o QueryOrderAmount) Clone() *QueryOrderAmount { ret := QueryOrderAmount{} if o.Total != nil { ret.Total = new(int64) *ret.Total = *o.Total } if o.PayerTotal != nil { ret.PayerTotal = new(int64) *ret.PayerTotal = *o.PayerTotal } if o.Currency != nil { ret.Currency = new(string) *ret.Currency = *o.Currency } return &ret } // QueryTransactionRequest type QueryTransactionRequest struct { // 商户系统内部订单号,只能是数字、大小写字母,且在同一个商户号下唯一。该字段长度限制为字节长度限制 OutTradeNo *string `json:"out_trade_no"` // 微信支付分配的子商户号,服务商模式下必传 SubMchid *string `json:"sub_mchid,omitempty"` } func (o QueryTransactionRequest) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} if o.OutTradeNo == nil { return nil, fmt.Errorf("field `OutTradeNo` is required and must be specified in QueryTransactionRequest") } toSerialize["out_trade_no"] = o.OutTradeNo if o.SubMchid != nil { toSerialize["sub_mchid"] = o.SubMchid } return json.Marshal(toSerialize) } func (o QueryTransactionRequest) String() string { var ret string if o.OutTradeNo == nil { ret += "OutTradeNo:, " } else { ret += fmt.Sprintf("OutTradeNo:%v, ", *o.OutTradeNo) } if o.SubMchid == nil { ret += "SubMchid:" } else { ret += fmt.Sprintf("SubMchid:%v", *o.SubMchid) } return fmt.Sprintf("QueryTransactionRequest{%s}", ret) } func (o QueryTransactionRequest) Clone() *QueryTransactionRequest { ret := QueryTransactionRequest{} if o.OutTradeNo != nil { ret.OutTradeNo = new(string) *ret.OutTradeNo = *o.OutTradeNo } if o.SubMchid != nil { ret.SubMchid = new(string) *ret.SubMchid = *o.SubMchid } return &ret } // QueryUserServiceRequest type QueryUserServiceRequest struct { // 商户在微信申请公众号或移动应用成功后分配的账号ID,登录平台为mp.weixin.qq.com或open.weixin.qq.com Appid *string `json:"appid"` // 子公众账号ID,服务商模式下选传 SubAppid *string `json:"sub_appid,omitempty"` // 微信支付分配的子商户号,服务商模式下必传 SubMchid *string `json:"sub_mchid,omitempty"` // 签约成功后,微信返回代扣签约ID 查用户是否能继续使用乘车卡时必传 ContractId *string `json:"contract_id"` } func (o QueryUserServiceRequest) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} if o.Appid == nil { return nil, fmt.Errorf("field `Appid` is required and must be specified in QueryUserServiceRequest") } toSerialize["appid"] = o.Appid if o.SubAppid != nil { toSerialize["sub_appid"] = o.SubAppid } if o.SubMchid != nil { toSerialize["sub_mchid"] = o.SubMchid } if o.ContractId == nil { return nil, fmt.Errorf("field `ContractId` is required and must be specified in QueryUserServiceRequest") } toSerialize["contract_id"] = o.ContractId return json.Marshal(toSerialize) } func (o QueryUserServiceRequest) String() string { var ret string if o.Appid == nil { ret += "Appid:, " } else { ret += fmt.Sprintf("Appid:%v, ", *o.Appid) } if o.SubAppid == nil { ret += "SubAppid:, " } else { ret += fmt.Sprintf("SubAppid:%v, ", *o.SubAppid) } if o.SubMchid == nil { ret += "SubMchid:, " } else { ret += fmt.Sprintf("SubMchid:%v, ", *o.SubMchid) } if o.ContractId == nil { ret += "ContractId:" } else { ret += fmt.Sprintf("ContractId:%v", *o.ContractId) } return fmt.Sprintf("QueryUserServiceRequest{%s}", ret) } func (o QueryUserServiceRequest) Clone() *QueryUserServiceRequest { ret := QueryUserServiceRequest{} if o.Appid != nil { ret.Appid = new(string) *ret.Appid = *o.Appid } if o.SubAppid != nil { ret.SubAppid = new(string) *ret.SubAppid = *o.SubAppid } if o.SubMchid != nil { ret.SubMchid = new(string) *ret.SubMchid = *o.SubMchid } if o.ContractId != nil { ret.ContractId = new(string) *ret.ContractId = *o.ContractId } return &ret } // TradeScene type TradeScene string func (e TradeScene) Ptr() *TradeScene { return &e } // Enums of TradeScene const ( TRADESCENE_BUS TradeScene = "BUS" TRADESCENE_METRO TradeScene = "METRO" ) // TradeState type TradeState string func (e TradeState) Ptr() *TradeState { return &e } // Enums of TradeState const ( TRADESTATE_SUCCESS TradeState = "SUCCESS" TRADESTATE_ACCEPTED TradeState = "ACCEPTED" TRADESTATE_PAY_FAIL TradeState = "PAY_FAIL" TRADESTATE_REFUND TradeState = "REFUND" ) // TransactionsEntity type TransactionsEntity struct { // 商户在微信申请公众号或移动应用成功后分配的账号ID,登录平台为mp.weixin.qq.com或open.weixin.qq.com Appid *string `json:"appid"` // 子商户申请的公众号或移动应用AppID,需要在服务商的商户平台为子商户绑定 SubAppid *string `json:"sub_appid,omitempty"` // 微信支付分配的商户号 SpMchid *string `json:"sp_mchid"` // 微信支付分配的子商户号 SubMchid *string `json:"sub_mchid,omitempty"` // 商户自定义字段,用于交易账单中对扣费服务的描述。 Description *string `json:"description"` // 订单成功创建时返回,按照使用rfc3339所定义的格式,格式为yyyy-MM-DDThh:mm:ss+TIMEZONE CreateTime *string `json:"create_time"` // 商户系统内部订单号,只能是数字、大小写字母,且在同一个商户号下唯一 OutTradeNo *string `json:"out_trade_no"` // 微信支付订单号 TransactionId *string `json:"transaction_id,omitempty"` // 交易状态,枚举值: TradeState *TradeState `json:"trade_state"` // 对当前订单状态的描述和下一步操作的指引 TradeStateDescription *string `json:"trade_state_description,omitempty"` // 订单支付完成时间,按照使用rfc3339所定义的格式,格式为yyyy-MM-DDThh:mm:ss+TIMEZONE SuccessTime *string `json:"success_time,omitempty"` // 银行类型,采用字符串类型的银行标识,详细可参考 微信支付银行类型标识(https://pay.weixin.qq.com/wiki/doc/apiv3/terms_definition/chapter1_1_3.shtml)。 特殊标识 BPA:该笔订单由微信进行垫付 BankType *string `json:"bank_type,omitempty"` // 该字段标识对应的垫资单是否已还款或者已撤销。注意,使用此字段前需先确认bank_type字段值为BPA 以及 trade_state字段值为SUCCESS或者REFUND。枚举值如下: UserRepayState *UserRepayState `json:"user_repay_state,omitempty"` // 用户还款成功的微信支付订单号。用户已还款会返回该字段。 RepayTransactionId *string `json:"repay_transaction_id,omitempty"` // 垫资还款时间,该笔订单发生过垫资,并且用户还款成功后,会返回该字段信息,按照使用rfc3339所定义的格式,格式为yyyy-MM-DDThh:mm:ss+TIMEZONE RepayTime *string `json:"repay_time,omitempty"` // 附加数据,在查询API和支付通知中原样返回,可作为自定义参数使用 Attach *string `json:"attach,omitempty"` // 签约成功后,微信返回的代扣签约ID ContractId *string `json:"contract_id,omitempty"` // 交易场景值,枚举值: TradeScene *TradeScene `json:"trade_scene"` // 返回信息中的trade_scene为BUS,返回该场景信息 BusInfo *BusSceneInfo `json:"bus_info,omitempty"` // 返回信息中的trade_scene为METRO,返回该场景信息 MetroInfo *MetroSceneInfo `json:"metro_info,omitempty"` // 订单金额信息 Amount *QueryOrderAmount `json:"amount"` // 优惠信息 PromotionDetail []PromotionDetail `json:"promotion_detail,omitempty"` } func (o TransactionsEntity) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} if o.Appid == nil { return nil, fmt.Errorf("field `Appid` is required and must be specified in TransactionsEntity") } toSerialize["appid"] = o.Appid if o.SubAppid != nil { toSerialize["sub_appid"] = o.SubAppid } if o.SpMchid == nil { return nil, fmt.Errorf("field `SpMchid` is required and must be specified in TransactionsEntity") } toSerialize["sp_mchid"] = o.SpMchid if o.SubMchid != nil { toSerialize["sub_mchid"] = o.SubMchid } if o.Description == nil { return nil, fmt.Errorf("field `Description` is required and must be specified in TransactionsEntity") } toSerialize["description"] = o.Description if o.CreateTime == nil { return nil, fmt.Errorf("field `CreateTime` is required and must be specified in TransactionsEntity") } toSerialize["create_time"] = o.CreateTime if o.OutTradeNo == nil { return nil, fmt.Errorf("field `OutTradeNo` is required and must be specified in TransactionsEntity") } toSerialize["out_trade_no"] = o.OutTradeNo if o.TransactionId != nil { toSerialize["transaction_id"] = o.TransactionId } if o.TradeState == nil { return nil, fmt.Errorf("field `TradeState` is required and must be specified in TransactionsEntity") } toSerialize["trade_state"] = o.TradeState if o.TradeStateDescription != nil { toSerialize["trade_state_description"] = o.TradeStateDescription } if o.SuccessTime != nil { toSerialize["success_time"] = o.SuccessTime } if o.BankType != nil { toSerialize["bank_type"] = o.BankType } if o.UserRepayState != nil { toSerialize["user_repay_state"] = o.UserRepayState } if o.RepayTransactionId != nil { toSerialize["repay_transaction_id"] = o.RepayTransactionId } if o.RepayTime != nil { toSerialize["repay_time"] = o.RepayTime } if o.Attach != nil { toSerialize["attach"] = o.Attach } if o.ContractId != nil { toSerialize["contract_id"] = o.ContractId } if o.TradeScene == nil { return nil, fmt.Errorf("field `TradeScene` is required and must be specified in TransactionsEntity") } toSerialize["trade_scene"] = o.TradeScene if o.BusInfo != nil { toSerialize["bus_info"] = o.BusInfo } if o.MetroInfo != nil { toSerialize["metro_info"] = o.MetroInfo } if o.Amount == nil { return nil, fmt.Errorf("field `Amount` is required and must be specified in TransactionsEntity") } toSerialize["amount"] = o.Amount if o.PromotionDetail != nil { toSerialize["promotion_detail"] = o.PromotionDetail } return json.Marshal(toSerialize) } func (o TransactionsEntity) String() string { var ret string if o.Appid == nil { ret += "Appid:, " } else { ret += fmt.Sprintf("Appid:%v, ", *o.Appid) } if o.SubAppid == nil { ret += "SubAppid:, " } else { ret += fmt.Sprintf("SubAppid:%v, ", *o.SubAppid) } if o.SpMchid == nil { ret += "SpMchid:, " } else { ret += fmt.Sprintf("SpMchid:%v, ", *o.SpMchid) } if o.SubMchid == nil { ret += "SubMchid:, " } else { ret += fmt.Sprintf("SubMchid:%v, ", *o.SubMchid) } if o.Description == nil { ret += "Description:, " } else { ret += fmt.Sprintf("Description:%v, ", *o.Description) } if o.CreateTime == nil { ret += "CreateTime:, " } else { ret += fmt.Sprintf("CreateTime:%v, ", *o.CreateTime) } if o.OutTradeNo == nil { ret += "OutTradeNo:, " } else { ret += fmt.Sprintf("OutTradeNo:%v, ", *o.OutTradeNo) } if o.TransactionId == nil { ret += "TransactionId:, " } else { ret += fmt.Sprintf("TransactionId:%v, ", *o.TransactionId) } if o.TradeState == nil { ret += "TradeState:, " } else { ret += fmt.Sprintf("TradeState:%v, ", *o.TradeState) } if o.TradeStateDescription == nil { ret += "TradeStateDescription:, " } else { ret += fmt.Sprintf("TradeStateDescription:%v, ", *o.TradeStateDescription) } if o.SuccessTime == nil { ret += "SuccessTime:, " } else { ret += fmt.Sprintf("SuccessTime:%v, ", *o.SuccessTime) } if o.BankType == nil { ret += "BankType:, " } else { ret += fmt.Sprintf("BankType:%v, ", *o.BankType) } if o.UserRepayState == nil { ret += "UserRepayState:, " } else { ret += fmt.Sprintf("UserRepayState:%v, ", *o.UserRepayState) } if o.RepayTransactionId == nil { ret += "RepayTransactionId:, " } else { ret += fmt.Sprintf("RepayTransactionId:%v, ", *o.RepayTransactionId) } if o.RepayTime == nil { ret += "RepayTime:, " } else { ret += fmt.Sprintf("RepayTime:%v, ", *o.RepayTime) } if o.Attach == nil { ret += "Attach:, " } else { ret += fmt.Sprintf("Attach:%v, ", *o.Attach) } if o.ContractId == nil { ret += "ContractId:, " } else { ret += fmt.Sprintf("ContractId:%v, ", *o.ContractId) } if o.TradeScene == nil { ret += "TradeScene:, " } else { ret += fmt.Sprintf("TradeScene:%v, ", *o.TradeScene) } ret += fmt.Sprintf("BusInfo:%v, ", o.BusInfo) ret += fmt.Sprintf("MetroInfo:%v, ", o.MetroInfo) ret += fmt.Sprintf("Amount:%v, ", o.Amount) ret += fmt.Sprintf("PromotionDetail:%v", o.PromotionDetail) return fmt.Sprintf("TransactionsEntity{%s}", ret) } func (o TransactionsEntity) Clone() *TransactionsEntity { ret := TransactionsEntity{} if o.Appid != nil { ret.Appid = new(string) *ret.Appid = *o.Appid } if o.SubAppid != nil { ret.SubAppid = new(string) *ret.SubAppid = *o.SubAppid } if o.SpMchid != nil { ret.SpMchid = new(string) *ret.SpMchid = *o.SpMchid } if o.SubMchid != nil { ret.SubMchid = new(string) *ret.SubMchid = *o.SubMchid } if o.Description != nil { ret.Description = new(string) *ret.Description = *o.Description } if o.CreateTime != nil { ret.CreateTime = new(string) *ret.CreateTime = *o.CreateTime } if o.OutTradeNo != nil { ret.OutTradeNo = new(string) *ret.OutTradeNo = *o.OutTradeNo } if o.TransactionId != nil { ret.TransactionId = new(string) *ret.TransactionId = *o.TransactionId } if o.TradeState != nil { ret.TradeState = new(TradeState) *ret.TradeState = *o.TradeState } if o.TradeStateDescription != nil { ret.TradeStateDescription = new(string) *ret.TradeStateDescription = *o.TradeStateDescription } if o.SuccessTime != nil { ret.SuccessTime = new(string) *ret.SuccessTime = *o.SuccessTime } if o.BankType != nil { ret.BankType = new(string) *ret.BankType = *o.BankType } if o.UserRepayState != nil { ret.UserRepayState = new(UserRepayState) *ret.UserRepayState = *o.UserRepayState } if o.RepayTransactionId != nil { ret.RepayTransactionId = new(string) *ret.RepayTransactionId = *o.RepayTransactionId } if o.RepayTime != nil { ret.RepayTime = new(string) *ret.RepayTime = *o.RepayTime } if o.Attach != nil { ret.Attach = new(string) *ret.Attach = *o.Attach } if o.ContractId != nil { ret.ContractId = new(string) *ret.ContractId = *o.ContractId } if o.TradeScene != nil { ret.TradeScene = new(TradeScene) *ret.TradeScene = *o.TradeScene } if o.BusInfo != nil { ret.BusInfo = o.BusInfo.Clone() } if o.MetroInfo != nil { ret.MetroInfo = o.MetroInfo.Clone() } if o.Amount != nil { ret.Amount = o.Amount.Clone() } if o.PromotionDetail != nil { ret.PromotionDetail = make([]PromotionDetail, len(o.PromotionDetail)) for i, item := range o.PromotionDetail { ret.PromotionDetail[i] = *item.Clone() } } return &ret } // UserRepayState type UserRepayState string func (e UserRepayState) Ptr() *UserRepayState { return &e } // Enums of UserRepayState const ( USERREPAYSTATE_NOT_REPAY UserRepayState = "NOT_REPAY" USERREPAYSTATE_REPAID UserRepayState = "REPAID" USERREPAYSTATE_ALL_REFUND UserRepayState = "ALL_REFUND" ) // UserServiceEntity type UserServiceEntity struct { // 签约成功后,微信返回代扣签约ID ContractId *string `json:"contract_id"` // 用户服务可用状态,枚举值有: UserServiceState *UserServiceStateEnum `json:"user_service_state"` // blocked服务状态描述,返回用户状态为BLOCKED,会返回该字段,具体描述的枚举值如下: BlockReason *BlockReasonEnum `json:"block_reason,omitempty"` } func (o UserServiceEntity) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} if o.ContractId == nil { return nil, fmt.Errorf("field `ContractId` is required and must be specified in UserServiceEntity") } toSerialize["contract_id"] = o.ContractId if o.UserServiceState == nil { return nil, fmt.Errorf("field `UserServiceState` is required and must be specified in UserServiceEntity") } toSerialize["user_service_state"] = o.UserServiceState if o.BlockReason != nil { toSerialize["block_reason"] = o.BlockReason } return json.Marshal(toSerialize) } func (o UserServiceEntity) String() string { var ret string if o.ContractId == nil { ret += "ContractId:, " } else { ret += fmt.Sprintf("ContractId:%v, ", *o.ContractId) } if o.UserServiceState == nil { ret += "UserServiceState:, " } else { ret += fmt.Sprintf("UserServiceState:%v, ", *o.UserServiceState) } if o.BlockReason == nil { ret += "BlockReason:" } else { ret += fmt.Sprintf("BlockReason:%v", *o.BlockReason) } return fmt.Sprintf("UserServiceEntity{%s}", ret) } func (o UserServiceEntity) Clone() *UserServiceEntity { ret := UserServiceEntity{} if o.ContractId != nil { ret.ContractId = new(string) *ret.ContractId = *o.ContractId } if o.UserServiceState != nil { ret.UserServiceState = new(UserServiceStateEnum) *ret.UserServiceState = *o.UserServiceState } if o.BlockReason != nil { ret.BlockReason = new(BlockReasonEnum) *ret.BlockReason = *o.BlockReason } return &ret } // UserServiceStateEnum type UserServiceStateEnum string func (e UserServiceStateEnum) Ptr() *UserServiceStateEnum { return &e } // Enums of UserServiceStateEnum const ( USERSERVICESTATEENUM_NORMAL UserServiceStateEnum = "NORMAL" USERSERVICESTATEENUM_BLOCKED UserServiceStateEnum = "BLOCKED" )