feat(merchant): 新增微信实名认证结果查询功能
- 在 consts/url.go 中新增微信实名认证结果查询接口地址常量 - 在 lklsdk/merchant.go 中实现 WechatRealNameQuery 方法,用于发送实名认证查询请求 - 在 lklsdk/sdk.go 中暴露 WechatRealNameQuery 接口方法,方便外部调用 - 新增 model/wechatRealNameQuery.go 文件,定义微信实名认证查询相关的请求与响应结构体 - 实现 SuccessOrFail 方法判断微信实名认证查询是否成功main v1.0.31
parent
0b902def62
commit
deb2985747
|
|
@ -58,6 +58,8 @@ const (
|
||||||
LKL_EC_APPLY_MANUAL = "/v3/mms/open_api/ec/apply_manual"
|
LKL_EC_APPLY_MANUAL = "/v3/mms/open_api/ec/apply_manual"
|
||||||
// LKL_EC_QMA_STATUS 拉卡拉商户电子合同人工复核结果查询
|
// LKL_EC_QMA_STATUS 拉卡拉商户电子合同人工复核结果查询
|
||||||
LKL_EC_QMA_STATUS = "/v3/mms/open_api/ec/qma_status"
|
LKL_EC_QMA_STATUS = "/v3/mms/open_api/ec/qma_status"
|
||||||
|
// LKL_WECHAT_REAL_NAME_QUERY 拉卡拉微信实名认证结果查询
|
||||||
|
LKL_WECHAT_REAL_NAME_QUERY = "/v2/mms/openApi/wechatRealNameQuery"
|
||||||
)
|
)
|
||||||
|
|
||||||
// unifiedReturn 统一退货API地址
|
// unifiedReturn 统一退货API地址
|
||||||
|
|
|
||||||
|
|
@ -205,3 +205,26 @@ func (t *MerService[T]) ReconsiderSubmitTest(req *model.ReConfSubmitRequestData)
|
||||||
}
|
}
|
||||||
return respBody, nil
|
return respBody, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (t *MerService[T]) WechatRealNameQuery(req *model.WechatRealNameQueryReqData) (*T, error) {
|
||||||
|
// 构建请求参数
|
||||||
|
url := consts.BASE_URL + consts.LKL_WECHAT_REAL_NAME_QUERY
|
||||||
|
md5, err := gmd5.Encrypt(gconv.String(time.Now().Unix()))
|
||||||
|
if err != nil {
|
||||||
|
return nil, fmt.Errorf("创建ReqId失败")
|
||||||
|
}
|
||||||
|
// 构建BaseModel请求
|
||||||
|
baseReq := model.WechatRealNameQueryRequest{
|
||||||
|
ReqData: req,
|
||||||
|
ReqId: md5,
|
||||||
|
Timestamp: time.Now().Unix(),
|
||||||
|
Ver: "1.0",
|
||||||
|
}
|
||||||
|
|
||||||
|
// 发送请求
|
||||||
|
respBody, err := t.client.DoRequest(url, baseReq)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return respBody, nil
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -247,3 +247,7 @@ func (s *SDK[T]) ECQmaStatus(req *ecQmaStatus.ECQmaStatusRequestData) (*ecQmaSta
|
||||||
func (s *SDK[T]) ECQmaStatusTest(req *ecQmaStatus.ECQmaStatusRequestData) (*ecQmaStatus.ECQmaStatusResponse, error) {
|
func (s *SDK[T]) ECQmaStatusTest(req *ecQmaStatus.ECQmaStatusRequestData) (*ecQmaStatus.ECQmaStatusResponse, error) {
|
||||||
return s.ECPeQmaStatus.ECQmaStatusTest(req)
|
return s.ECPeQmaStatus.ECQmaStatusTest(req)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (s *SDK[T]) WechatRealNameQuery(req *model.WechatRealNameQueryReqData) (*T, error) {
|
||||||
|
return s.Merchant.WechatRealNameQuery(req)
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,46 @@
|
||||||
|
package model
|
||||||
|
|
||||||
|
type WechatRealNameQueryRequest struct {
|
||||||
|
// 请求业务数据
|
||||||
|
ReqData *WechatRealNameQueryReqData `json:"reqData"`
|
||||||
|
// 接口版本号
|
||||||
|
Ver string `json:"ver"`
|
||||||
|
// 请求时间,格式为yyyyMMddHHmmss
|
||||||
|
Timestamp int64 `json:"timestamp"`
|
||||||
|
ReqId string `json:"reqId"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type WechatRealNameQueryReqData struct {
|
||||||
|
Version string `json:"version" dc:"接口版本号"`
|
||||||
|
OrderNo string `json:"orderNo" dc:"订单编号 14位年月日时(24小时制)分秒+8位的随机数(不重复)如:2021020112000012345678"`
|
||||||
|
OrgCode string `json:"orgCode" dc:"机构代码"`
|
||||||
|
MerInnerNo string `json:"merInnerNo" dc:"拉卡拉内部商户号"`
|
||||||
|
SubMchId string `json:"subMchId" dc:"子商户号"`
|
||||||
|
ChannelId string `json:"channelId" dc:"渠道号 (建议传入,能具体定位用的渠道,仅支持拉卡拉渠道查询)"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type WechatRealNameQueryResponse struct {
|
||||||
|
// 响应状态码,000000表示成功
|
||||||
|
RetCode string `json:"retCode"`
|
||||||
|
// 响应消息
|
||||||
|
RetMsg string `json:"retMsg"`
|
||||||
|
// 响应业务数据,当code为000000时返回
|
||||||
|
RespData *WechatRealNameQueryRespData `json:"respData"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type WechatRealNameQueryRespData struct {
|
||||||
|
MerInnerNo string `json:"merInnerNo" dc:"拉卡拉内部商户号"`
|
||||||
|
SubMchId string `json:"subMchId" dc:"账户端子商户号 "`
|
||||||
|
ChannelId string `json:"channelId" dc:"渠道号"`
|
||||||
|
ReceOrgNo string `json:"receOrgNo" dc:"从业机构号"`
|
||||||
|
ApplymentId string `json:"applymentId" dc:"申请编号"`
|
||||||
|
ApplymentState string `json:"applymentState" dc:"申请状态"`
|
||||||
|
AuthorizeState string `json:"authorizeState" dc:"认证状态"`
|
||||||
|
QrcodeData string `json:"qrcodeData" dc:" 小程序码图片"`
|
||||||
|
RejectParameter string `json:"rejectParameter" dc:"驳回参数"`
|
||||||
|
RejectReason string `json:"rejectReason" dc:"驳回原因"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (resp *WechatRealNameQueryResponse) SuccessOrFail() bool {
|
||||||
|
return resp.RetCode == "000000"
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue