add pay
This commit is contained in:
@@ -92,6 +92,10 @@ func Pay(ctx *jxcontext.Context, orderID string, payType int, vendorPayType, app
|
||||
VendorPayType: vendorPayType,
|
||||
}
|
||||
)
|
||||
orderInfo, err := dao.GetOrderByID(db, orderID)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
//支付金额<原金额
|
||||
globals.SugarLogger.Debug("order.PayPrice=========================", order.PayPrice)
|
||||
if payPrice < order.PayPrice {
|
||||
@@ -103,6 +107,7 @@ func Pay(ctx *jxcontext.Context, orderID string, payType int, vendorPayType, app
|
||||
} else {
|
||||
order = &model.Order{
|
||||
OrderID: orderID,
|
||||
PayPrice: orderInfo.PayPrice,
|
||||
PayMethod: 2, //微信支付
|
||||
}
|
||||
}
|
||||
@@ -212,6 +217,7 @@ func PayByBalance(ctx *jxcontext.Context, orderID string, isChoose, payType int,
|
||||
globals.SugarLogger.Debug("进入混合支付部分")
|
||||
//orderInfo.PayMethod = 5 //混合支付状态
|
||||
needPay := totalPrice - userBill.AccountBalance //需支付金额
|
||||
globals.SugarLogger.Debug("needPay=================", needPay)
|
||||
globals.SugarLogger.Debug("orderInfo.PayPrice=================", orderInfo.PayPrice)
|
||||
globals.SugarLogger.Debug("orderInfo.OrderID=================", orderInfo.OrderID)
|
||||
WxPayParam, err := Pay(ctx, orderInfo.OrderID, payType, vendorPayType, appID, needPay)
|
||||
|
||||
Reference in New Issue
Block a user