add 查询回调地址接口,设置回调通知i接口
This commit is contained in:
parent
0597083258
commit
c3c8389737
|
|
@ -62,7 +62,7 @@ func (c *CpnRepoImpl) Order(ctx context.Context, order *bo.OrderBo) (string, err
|
||||||
return "", err
|
return "", err
|
||||||
}
|
}
|
||||||
|
|
||||||
log.Errorf("请求微信返回错误=%s", string(bodyBytes))
|
log.Errorf("请求微信返回错误:%s", string(bodyBytes))
|
||||||
|
|
||||||
if err = json.Unmarshal(bodyBytes, &ErrBody); err != nil {
|
if err = json.Unmarshal(bodyBytes, &ErrBody); err != nil {
|
||||||
return "", err
|
return "", err
|
||||||
|
|
@ -107,13 +107,11 @@ func (c *CpnRepoImpl) Query(ctx context.Context, orderWechat *bo.OrderBo) (vo.Or
|
||||||
return 0, err
|
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 {
|
if result.Response.StatusCode != CodeSuccess {
|
||||||
return 0, fmt.Errorf("请求错误")
|
return 0, fmt.Errorf("微信返回错误 Response StatusCode[%s]", result.Response.StatusCode)
|
||||||
}
|
}
|
||||||
|
|
||||||
return CpnStatus(*resp.Status).GetStatus()
|
return CpnStatus(*resp.Status).GetStatus()
|
||||||
|
|
@ -143,12 +141,11 @@ func (c *CpnRepoImpl) QueryProduct(ctx context.Context, stockCreatorMchId, stock
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil, fmt.Errorf("微信返回错误=%s", ErrBody.Message)
|
return nil, fmt.Errorf("微信返回错误:%s", ErrBody.Message)
|
||||||
}
|
}
|
||||||
|
|
||||||
if result.Response.StatusCode != CodeSuccess {
|
if result.Response.StatusCode != CodeSuccess {
|
||||||
err = fmt.Errorf("查询活动微信返回错误tatus[%s]", result.Response.Status)
|
return nil, fmt.Errorf("查询活动微信返回错误 Response StatusCode[%s]", result.Response.StatusCode)
|
||||||
return nil, err
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return response, nil
|
return response, nil
|
||||||
|
|
@ -178,6 +175,8 @@ func (c *CpnRepoImpl) QueryCallback(ctx context.Context, mchId, mchCertNo string
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
||||||
|
log.Errorf("请求微信返回错误:%s", err.Error())
|
||||||
|
|
||||||
bodyBytes, err := io.ReadAll(result.Response.Body)
|
bodyBytes, err := io.ReadAll(result.Response.Body)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
|
|
||||||
|
|
@ -58,6 +58,8 @@ func (s *VoucherService) cmbOrder(ctx http.Context) (string, error) {
|
||||||
return "", err
|
return "", err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
log.Warnf("cmbOrder req: %v", string(bodyBytes))
|
||||||
|
|
||||||
var req *v1.CmbRequest
|
var req *v1.CmbRequest
|
||||||
if err = json.Unmarshal(bodyBytes, &req); err != nil {
|
if err = json.Unmarshal(bodyBytes, &req); err != nil {
|
||||||
return "", err
|
return "", err
|
||||||
|
|
@ -130,6 +132,8 @@ func (s *VoucherService) cmbQuery(ctx http.Context) (*v1.CmbQueryReply, error) {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
log.Warnf("cmbQuery req: %v", string(bodyBytes))
|
||||||
|
|
||||||
var req *v1.CmbRequest
|
var req *v1.CmbRequest
|
||||||
if err = json.Unmarshal(bodyBytes, &req); err != nil {
|
if err = json.Unmarshal(bodyBytes, &req); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue