add pay
This commit is contained in:
@@ -81,10 +81,15 @@ func CreateOrder(ctx *jxcontext.Context, type1, orderType int, way string, price
|
|||||||
}
|
}
|
||||||
|
|
||||||
func Pay(ctx *jxcontext.Context, orderID string, payType int, vendorPayType, appId string, payPrice int) (result *financial.WxPayParam, err error) {
|
func Pay(ctx *jxcontext.Context, orderID string, payType int, vendorPayType, appId string, payPrice int) (result *financial.WxPayParam, err error) {
|
||||||
|
orderInfo, err := dao.GetOrderByID(dao.GetDB(), orderID)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
var (
|
var (
|
||||||
db = dao.GetDB()
|
db = dao.GetDB()
|
||||||
order = &model.Order{
|
order = &model.Order{
|
||||||
OrderID: orderID,
|
OrderID: orderID,
|
||||||
|
PayPrice: orderInfo.PayPrice,
|
||||||
}
|
}
|
||||||
payHandler = &financial.PayHandler{
|
payHandler = &financial.PayHandler{
|
||||||
PayType: payType,
|
PayType: payType,
|
||||||
@@ -93,10 +98,7 @@ func Pay(ctx *jxcontext.Context, orderID string, payType int, vendorPayType, app
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
globals.SugarLogger.Debug("payPrice before1111=========================", payPrice)
|
globals.SugarLogger.Debug("payPrice before1111=========================", payPrice)
|
||||||
orderInfo, err := dao.GetOrderByID(db, orderID)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
//支付金额<原金额
|
//支付金额<原金额
|
||||||
globals.SugarLogger.Debug("order.PayPrice=========================", order.PayPrice)
|
globals.SugarLogger.Debug("order.PayPrice=========================", order.PayPrice)
|
||||||
if payPrice < order.PayPrice {
|
if payPrice < order.PayPrice {
|
||||||
|
|||||||
Reference in New Issue
Block a user