Compare commits

...
2 Commits
Author SHA1 Message Date
maguodong 0aa9bc80ec refactor(model):优化分账相关模型结构体字段类型
- 将 ApplyBindReqData 中 Attachments 字段类型改为 []*ApplyBindAttachment- 新增 ApplyBindAttachment 结构体统一附件信息定义
- 将 ApplyLedgerMerReqData 中 Attachments 字段类型改为 []*ApplyBindAttachment- 将 ApplyLedgerReceiver 中 AttachList 字段类型改为 []*ApplyBindAttachment- 将 PreorderResponse 中 ReqData 字段指针化避免拷贝
- 将 ReqData 中 AccRespFields 字段指针化提升性能
- 将 QueryLedgerMerResponse 中 BindRelations 字段类型改为 []*BindRelation
- 调整字段注释格式增强可读性- 统一结构体字段命名风格提高一致性
2025-10-09 17:56:31 +08:00
maguodong 1e5214abfb fix(trade):修复查询请求中的应用ID字段
- 将 OutOrgCode 字段从 AppID 更正为 AppId
- 保持与配置结构体字段命名一致
- 避免因字段名不匹配导致的查询错误
2025-10-09 17:06:52 +08:00
6 changed files with 48 additions and 58 deletions
+1 -1
View File
@@ -28,7 +28,7 @@ func (t *TradeService[T]) TradeQuery(req *model.TradeQueryReqData) (*T, error) {
baseReq := model.TradeQuery{
ReqTime: time.Now().Format("20060102150405"),
Version: "3.0",
OutOrgCode: t.client.config.AppID,
OutOrgCode: t.client.config.AppId,
ReqData: req,
}
+4 -2
View File
@@ -24,11 +24,13 @@ type ApplyBindReqData struct {
EntrustFileName string `json:"entrustFileName"` // 合作协议附件名称,必传,长度32
EntrustFilePath string `json:"entrustFilePath"` // 合作协议附件路径,必传,长度32,通过调用附件上传接口获取
RetUrl string `json:"retUrl"` // 回调通知地址,必传,长度128,审核通过后通知地址
Attachments []struct {
Attachments []*ApplyBindAttachment `json:"attachments,omitempty"` // 附加资料,可选,集合类型,其他附加资料文件信息
}
type ApplyBindAttachment struct {
AttachType string `json:"attachType"` // 附件类型编码,必传,长度32
AttachName string `json:"attachName"` // 附件名称,必传,长度32
AttachStorePath string `json:"attachStorePath"` // 附件路径,必传,长度128,通过调用附件上传接口获取
} `json:"attachments,omitempty"` // 附加资料,可选,集合类型,其他附加资料文件信息
}
// ApplyBindResponse 分账关系绑定响应结构体
+1 -5
View File
@@ -26,11 +26,7 @@ type ApplyLedgerMerReqData struct {
SettleType string `json:"settleType"` // 结算类型,非必传,长度32,取值说明:01-主扫现结,02-复扫现结,03-交易自动结算
SplitRuleSource string `json:"splitRuleSource"` // 分账规则来源,条件必传,长度32,取值说明:MER-商户自定规则,PLATFORM-平台分润规则(分润规则必传)
RetUrl string `json:"retUrl"` // 回调通知地址,必传,长度128,分账申请结果以异步消息或同步返回的方式通知,如需无线路由处理,也可以通过第三方商户信息查询接口确定结算结果
Attachments []struct {
AttachType string `json:"attachType"` // 附件类型编码,必传,长度32
AttachName string `json:"attachName"` // 附件名称,必传,长度32
AttachStorePath string `json:"attachStorePath"` // 附件路径,必传,长度128,调用附件上传接口获取
} `json:"attachments,omitempty"` // 附加资料,可选,集合,其他需附加的文件信息
Attachments []*ApplyBindAttachment `json:"attachments,omitempty"` // 附加资料,可选,集合,其他需附加的文件信息
}
// ApplyLedgerMerResponse 商户分账业务开通申请响应结构体
+1 -8
View File
@@ -55,14 +55,7 @@ type ApplyLedgerReceiverReqData struct {
// 收款账户清算行行号,必传,长度32,取值说明:参照FBI.N信息查询,仅支持对私结算账户
AcctClearBankCode string `json:"acctClearBankCode"`
// 接收方附件资料,可选,集合
AttachList []struct {
// 附件名称,可选,长度32
AttachName string `json:"attachName"`
// 附件路径,可选,长度32,取值说明:(调用进件附件上传接口获取到附件路径)
AttachStorePath string `json:"attachStorePath"`
// 附件类型编码,可选,长度32
AttachType string `json:"attachType"`
} `json:"attachList"`
AttachList []*ApplyBindAttachment `json:"attachList"`
// 提款类型,可选,长度32,取值说明:01:主动提款,03:交易自动结算,不填默认01
SettleType string `json:"settleType"`
}
+2 -3
View File
@@ -37,7 +37,7 @@ func NewPreorder(param *PreorderReqData) *Preorder {
type PreorderResponse struct {
Code string `json:"code"` // 响应码,BBS00000表示成功
Msg string `json:"msg"` // 响应信息,对响应码的文字描述
ReqData ReqData `json:"resp_data"` // 响应业务数据
ReqData *ReqData `json:"resp_data"` // 响应业务数据
RespTime string `json:"resp_time"` // 响应时间
}
@@ -49,8 +49,7 @@ type ReqData struct {
LogNo string `json:"log_no"` // 拉卡拉对账单流水号
SettleMerchantNo string `json:"settle_merchant_no"` // 结算商户号
SettleTermNo string `json:"settle_term_no"` // 结算终端号
AccRespFields WxPreorderResponse `json:"acc_resp_fields"` // 支付通道返回的具体信息
AccRespFields *WxPreorderResponse `json:"acc_resp_fields"` // 支付通道返回的具体信息
}
// WxPreorderResponse 支付通道返回的具体信息
+1 -1
View File
@@ -66,7 +66,7 @@ type QueryLedgerMerRespData struct {
// 分账规则来源,取值说明:MER:商户分账规则,PLATFORM:平台分账规则
SplitRuleSource string `json:"split_rule_source"`
// 已绑定接收方列表
BindRelations []BindRelation `json:"bind_relations"`
BindRelations []*BindRelation `json:"bind_relations"`
}
// BindRelation 已绑定接收方信息结构体