add 查询回调地址接口,设置回调通知i接口

This commit is contained in:
李子铭 2025-03-13 17:29:00 +08:00
parent 0597083258
commit c3c8389737
2 changed files with 11 additions and 8 deletions

View File

@ -62,7 +62,7 @@ func (c *CpnRepoImpl) Order(ctx context.Context, order *bo.OrderBo) (string, err
return "", err
}
log.Errorf("请求微信返回错误=%s", string(bodyBytes))
log.Errorf("请求微信返回错误:%s", string(bodyBytes))
if err = json.Unmarshal(bodyBytes, &ErrBody); err != nil {
return "", err
@ -107,13 +107,11 @@ func (c *CpnRepoImpl) Query(ctx context.Context, orderWechat *bo.OrderBo) (vo.Or
return 0, err
}
err = fmt.Errorf(ErrBody.Message)
return 0, fmt.Errorf("微信返回错误=%s", ErrBody.Message)
return 0, fmt.Errorf("微信返回错误:%s", ErrBody.Message)
}
if result.Response.StatusCode != CodeSuccess {
return 0, fmt.Errorf("请求错误")
return 0, fmt.Errorf("微信返回错误 Response StatusCode[%s]", result.Response.StatusCode)
}
return CpnStatus(*resp.Status).GetStatus()
@ -143,12 +141,11 @@ func (c *CpnRepoImpl) QueryProduct(ctx context.Context, stockCreatorMchId, stock
return nil, err
}
return nil, fmt.Errorf("微信返回错误=%s", ErrBody.Message)
return nil, fmt.Errorf("微信返回错误:%s", ErrBody.Message)
}
if result.Response.StatusCode != CodeSuccess {
err = fmt.Errorf("查询活动微信返回错误tatus[%s]", result.Response.Status)
return nil, err
return nil, fmt.Errorf("查询活动微信返回错误 Response StatusCode[%s]", result.Response.StatusCode)
}
return response, nil
@ -178,6 +175,8 @@ func (c *CpnRepoImpl) QueryCallback(ctx context.Context, mchId, mchCertNo string
if err != nil {
log.Errorf("请求微信返回错误:%s", err.Error())
bodyBytes, err := io.ReadAll(result.Response.Body)
if err != nil {
return nil, err

View File

@ -58,6 +58,8 @@ func (s *VoucherService) cmbOrder(ctx http.Context) (string, error) {
return "", err
}
log.Warnf("cmbOrder req: %v", string(bodyBytes))
var req *v1.CmbRequest
if err = json.Unmarshal(bodyBytes, &req); err != nil {
return "", err
@ -130,6 +132,8 @@ func (s *VoucherService) cmbQuery(ctx http.Context) (*v1.CmbQueryReply, error) {
return nil, err
}
log.Warnf("cmbQuery req: %v", string(bodyBytes))
var req *v1.CmbRequest
if err = json.Unmarshal(bodyBytes, &req); err != nil {
return nil, err