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:
Shawn Wang
2026-08-14 17:01:32 +08:00
committed by GitHub
parent e5efc73cdb
commit 2a0ce3475c
6 changed files with 251 additions and 0 deletions
+6
View File
@@ -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)