fix:支付

This commit is contained in:
momo 2023-09-26 18:20:48 +08:00
parent 1203c087d8
commit 9c08acc97a

View File

@ -714,16 +714,18 @@ func (d *defaultOrder) Detail(ctx context.Context, in *DetailReq) (res *DetailRe
} }
// 是否超时支付 // 是否超时支付
ctime := *order.Ctime if *order.Status == int64(constants.ORDERSTATUSUNPAIDDEPOSIT) {
ctimeTimeOut := ctime.Add(30 * time.Minute).UTC().Unix() ctime := *order.Ctime
ntimeTimeOut := time.Now().UTC().Unix() ctimeTimeOut := ctime.Add(30 * time.Minute).UTC().Unix()
if ctimeTimeOut < ntimeTimeOut { ntimeTimeOut := time.Now().UTC().Unix()
errorCode = *basic.CodeErrOrderCreatePrePaymentTimeout if ctimeTimeOut < ntimeTimeOut {
err = errors.New("order pay timeout") errorCode = *basic.CodeErrOrderCreatePrePaymentTimeout
logx.Errorf("order detail failed, err: %v", err) err = errors.New("order pay timeout")
return &DetailRes{ logx.Errorf("order detail failed, err: %v", err)
ErrorCode: errorCode, return &DetailRes{
}, err ErrorCode: errorCode,
}, err
}
} }
ress, err := d.OrderDetailHandler(ctx, &order, 1) ress, err := d.OrderDetailHandler(ctx, &order, 1)