pay
This commit is contained in:
@@ -110,43 +110,19 @@ func Pay(ctx *jxcontext.Context, orderID string, payType int, vendorPayType, app
|
|||||||
if payPrice < order.PayPrice {
|
if payPrice < order.PayPrice {
|
||||||
temp_PayPrice = payPrice
|
temp_PayPrice = payPrice
|
||||||
temp_PayMethod = 5
|
temp_PayMethod = 5
|
||||||
//order = &model.Order{
|
|
||||||
// OrderID: orderID,
|
|
||||||
// PayPrice: payPrice,
|
|
||||||
// UserID: orderInfo.UserID,
|
|
||||||
// PayMethod: 5, //混合支付
|
|
||||||
//}
|
|
||||||
} else {
|
} else {
|
||||||
temp_PayPrice = orderInfo.PayPrice
|
temp_PayPrice = orderInfo.PayPrice
|
||||||
temp_PayMethod = 2
|
temp_PayMethod = 2
|
||||||
//order = &model.Order{
|
|
||||||
// OrderID: orderID,
|
|
||||||
// PayPrice: orderInfo.PayPrice,
|
|
||||||
// UserID: orderInfo.UserID,
|
|
||||||
// PayMethod: 2, //微信支付
|
|
||||||
//}
|
|
||||||
}
|
}
|
||||||
globals.SugarLogger.Debug("检验初始数据情况", order.OrderID, order.PayMethod)
|
globals.SugarLogger.Debug("检验初始数据情况", order.OrderID, order.PayMethod)
|
||||||
globals.SugarLogger.Debug("检验初始数据情况", order.PayPrice)
|
globals.SugarLogger.Debug("检验初始数据情况", order.PayPrice)
|
||||||
//txDB, _ := dao.Begin(db)
|
|
||||||
//defer func() {
|
|
||||||
// if r := recover(); r != nil {
|
|
||||||
// panic(r)
|
|
||||||
// }
|
|
||||||
//}()
|
|
||||||
//微信支付实际金额更新到数据库
|
//微信支付实际金额更新到数据库
|
||||||
if _, err := dao.SetOrderStatus(temp_PayPrice, temp_PayMethod, orderID); err != nil {
|
if _, err := dao.SetOrderStatus(temp_PayPrice, temp_PayMethod, orderID); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
if _, err := dao.UpdateEntityTx(txDB, order); err != nil {
|
if _, err := dao.UpdateEntityTx(txDB, order); err != nil {
|
||||||
//dao.Rollback(db, txDB)
|
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
//if _, err := dao.UpdateEntityTx(txDB, &order, "PayMethod"); err != nil {
|
|
||||||
// dao.Rollback(db, txDB)
|
|
||||||
// return nil, err
|
|
||||||
//}
|
|
||||||
//dao.Commit(db, txDB)
|
|
||||||
globals.SugarLogger.Debug("经过更新操作后的数据after=========================", order.OrderID, order.PayPrice, order.PayMethod)
|
globals.SugarLogger.Debug("经过更新操作后的数据after=========================", order.OrderID, order.PayPrice, order.PayMethod)
|
||||||
globals.SugarLogger.Debug("经过更新操作后的数据after=========================", order.PayPrice)
|
globals.SugarLogger.Debug("经过更新操作后的数据after=========================", order.PayPrice)
|
||||||
globals.SugarLogger.Debugf("pay begin……")
|
globals.SugarLogger.Debugf("pay begin……")
|
||||||
|
|||||||
@@ -250,10 +250,12 @@ func CancelWayOrder(ctx *jxcontext.Context, userId string, param *bida.CancelOrd
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return FailCode, err
|
return FailCode, err
|
||||||
}
|
}
|
||||||
|
globals.SugarLogger.Debug("回调获取order详情", orderWay)
|
||||||
userBill, err := dao.GetUserBill(db, orderWay.UserID, "")
|
userBill, err := dao.GetUserBill(db, orderWay.UserID, "")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return FailCode, err
|
return FailCode, err
|
||||||
}
|
}
|
||||||
|
globals.SugarLogger.Debug("回调获取user_bill详情", userBill)
|
||||||
if orderWay.Status == 110 {
|
if orderWay.Status == 110 {
|
||||||
if orderWay.PayMethod == 1 { // 余额支付
|
if orderWay.PayMethod == 1 { // 余额支付
|
||||||
txDB, _ := dao.Begin(db)
|
txDB, _ := dao.Begin(db)
|
||||||
@@ -294,7 +296,7 @@ func CancelWayOrder(ctx *jxcontext.Context, userId string, param *bida.CancelOrd
|
|||||||
}
|
}
|
||||||
|
|
||||||
//更新mixPay 状态
|
//更新mixPay 状态
|
||||||
mixPayInfo[0].Status = model.BillMixPayRefund1 //退款状态
|
mixPayInfo[0].Status = -1 //model.BillMixPayRefund1 //退款状态
|
||||||
if _, err := dao.UpdateEntityTx(txDB, &mixPayInfo, "Status"); err != nil {
|
if _, err := dao.UpdateEntityTx(txDB, &mixPayInfo, "Status"); err != nil {
|
||||||
return FailCode, err
|
return FailCode, err
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user