fix(topup): reject uncreditable orders before payment (#6845)
* fix(topup): reject uncreditable orders before payment * fix(topup): align zero-ratio Stripe validation * fix(topup): mirror settlement conversions in validation
This commit is contained in:
@@ -123,6 +123,9 @@ func RequestWaffoAmount(c *gin.Context) {
|
||||
c.JSON(http.StatusOK, gin.H{"message": "error", "data": fmt.Sprintf("充值数量不能小于 %d", waffoMinTopup)})
|
||||
return
|
||||
}
|
||||
if rejectInvalidTopUpQuota(c, req.Amount) {
|
||||
return
|
||||
}
|
||||
|
||||
id := c.GetInt("id")
|
||||
group, err := model.GetUserGroup(id, true)
|
||||
@@ -157,6 +160,9 @@ func RequestWaffoPay(c *gin.Context) {
|
||||
c.JSON(http.StatusOK, gin.H{"message": "error", "data": fmt.Sprintf("充值数量不能小于 %d", waffoMinTopup)})
|
||||
return
|
||||
}
|
||||
if rejectInvalidTopUpQuota(c, req.Amount) {
|
||||
return
|
||||
}
|
||||
|
||||
id := c.GetInt("id")
|
||||
user, err := model.GetUserById(id, false)
|
||||
|
||||
Reference in New Issue
Block a user