cash finish
This commit is contained in:
@@ -60,7 +60,7 @@ func Pay(ctx *jxcontext.Context, orderID, payType int, vendorPayType string) (er
|
||||
return err
|
||||
}
|
||||
|
||||
func Cash(ctx *jxcontext.Context, orderID, payType int, vendorPayType string) (err error) {
|
||||
func Cash(ctx *jxcontext.Context, orderID, payType int, vendorPayType string) (errCode string, err error) {
|
||||
var (
|
||||
db = dao.GetDB()
|
||||
order = &model.Order{
|
||||
@@ -79,6 +79,9 @@ func Cash(ctx *jxcontext.Context, orderID, payType int, vendorPayType string) (e
|
||||
if userBill == nil {
|
||||
err = financial.AddUserBill(db, jxutils.GenBillID(), order.UserID)
|
||||
}
|
||||
if userBill.AccountBalance < order.PayPrice {
|
||||
return model.ErrCodeAccountBalanceNotEnough, err
|
||||
}
|
||||
err = payHandler.CreateRefund()
|
||||
return err
|
||||
return errCode, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user