diff --git a/business/jxstore/cms/order.go b/business/jxstore/cms/order.go index c176f5487..5111dea5d 100644 --- a/business/jxstore/cms/order.go +++ b/business/jxstore/cms/order.go @@ -124,7 +124,7 @@ var ( ) //余额支付 微信补差值 -func PayByBalance(ctx *jxcontext.Context, orderID string, restPrice, payType int, vendorPayType, appID string) (errMsg string, wxPayParam *financial.WxPayParam, err error) { +func PayByBalance(ctx *jxcontext.Context, orderID string, restPrice, payType int, vendorPayType, appID string) (errMsg string, err error) { var ( db = dao.GetDB() //wxPayParam *financial.WxPayParam @@ -133,13 +133,13 @@ func PayByBalance(ctx *jxcontext.Context, orderID string, restPrice, payType int globals.SugarLogger.Debug("begin get order+info") orderInfo, err := dao.GetOrderByID(db, orderID) if err != nil { - return "获取订单信息失败", nil, err + return "获取订单信息失败", err } //获取用户 会员账户信息 globals.SugarLogger.Debug("开始获取会员信息") userBill, err := dao.GetUserBill(db, orderInfo.UserID, "") if err != nil { - return "获取用户会员账户余额失败", nil, err + return "获取用户会员账户余额失败", err } txDB, _ := dao.Begin(db) defer func() { @@ -156,7 +156,7 @@ func PayByBalance(ctx *jxcontext.Context, orderID string, restPrice, payType int if userBill.AccountBalance > orderInfo.PayPrice && userBill.AccountBalance-orderInfo.PayPrice > 0 { if err = financial.AddExpendUpdateAccount(txDB, userBill, model.BillTypePayByAccountBalance, orderInfo.PayPrice, 0); err != nil { dao.Rollback(db, txDB) - return "使用余额支付失败:", nil, err + return "使用余额支付失败:", err } orderInfo.Status = AlreadyPay } else { @@ -164,28 +164,28 @@ func PayByBalance(ctx *jxcontext.Context, orderID string, restPrice, payType int //restPrice := orderInfo.PayPrice - userBill.AccountBalance globals.SugarLogger.Debug("进入混合支付部分") orderInfo.PayPrice = restPrice - wxPayParam, err := Pay(ctx, orderInfo.OrderID, payType, vendorPayType, appID) + _, err := Pay(ctx, orderInfo.OrderID, payType, vendorPayType, appID) if err != nil { - return "微信支付失败:", nil, err + return "微信支付失败:", err } //支付成功后修改余额为0 if err := dao.UpdateUserBill(orderInfo.UserID, 0); err != nil { globals.SugarLogger.Debug("支付后修改余额失败") dao.Rollback(db, txDB) - return "余额修改失败:", nil, err + return "余额修改失败:", err } //增加一条用户账单 if err = financial.AddBillExpend(txDB, userBill.BillID, model.BillTypePayByAccountBalance, orderInfo.PayPrice, 0); err != nil { globals.SugarLogger.Debug("创建账单失败") dao.Rollback(db, txDB) - return "创建账单失败", nil, err + return "创建账单失败", err } - return "混合支付成功", wxPayParam, err + return "混合支付成功", err } } dao.Commit(db, txDB) } - return "", nil, err + return "", err } func Cash(ctx *jxcontext.Context, orderID string, payType int, vendorPayType string) (errCode string, err error) {