cash finish

This commit is contained in:
苏尹岚
2020-10-20 13:51:30 +08:00
parent 29946b79d9
commit 150ec0701c
4 changed files with 51 additions and 6 deletions

View File

@@ -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
}