feat: publish sanitized custom.97 source

This commit is contained in:
cneicy committed 2026-10-27 20:43:39 +08:00
1 parent 8e6ed0317b
commit 86c0276156
1022 files changed
+69903 -19207

No files matched your search

+10 -10
View File
@@ -28,7 +28,7 @@ func SubscriptionRequestEpay(c *gin.Context) {
var req SubscriptionEpayPayRequest
if err := c.ShouldBindJSON(&req); err != nil || req.PlanId <= 0 {
common.ApiErrorMsg(c, "参数错误")
common.ApiErrorT(c, "Invalid parameters")
return
}
@@ -38,15 +38,15 @@ func SubscriptionRequestEpay(c *gin.Context) {
return
}
if !plan.Enabled {
common.ApiErrorMsg(c, "套餐未启用")
common.ApiErrorT(c, "Subscription plan is not enabled")
return
}
if plan.PriceAmount < 0.01 {
common.ApiErrorMsg(c, "套餐金额过低")
common.ApiErrorT(c, "Plan amount is too low")
return
}
if !operation_setting.ContainsPayMethod(req.PaymentMethod) {
common.ApiErrorMsg(c, "支付方式不存在")
common.ApiErrorT(c, "Payment method does not exist")
return
}
@@ -58,7 +58,7 @@ func SubscriptionRequestEpay(c *gin.Context) {
return
}
if count >= int64(plan.MaxPurchasePerUser) {
common.ApiErrorMsg(c, "已达到该套餐购买上限")
common.ApiErrorT(c, "Purchase limit for this plan has been reached")
return
}
}
@@ -66,12 +66,12 @@ func SubscriptionRequestEpay(c *gin.Context) {
callBackAddress := service.GetCallbackAddress()
returnUrl, err := url.Parse(callBackAddress + "/api/subscription/epay/return")
if err != nil {
common.ApiErrorMsg(c, "回调地址配置错误")
common.ApiErrorT(c, "Callback URL configuration error")
return
}
notifyUrl, err := url.Parse(callBackAddress + "/api/subscription/epay/notify")
if err != nil {
common.ApiErrorMsg(c, "回调地址配置错误")
common.ApiErrorT(c, "Callback URL configuration error")
return
}
@@ -80,7 +80,7 @@ func SubscriptionRequestEpay(c *gin.Context) {
client := GetEpayClient()
if client == nil {
common.ApiErrorMsg(c, "当前管理员未配置支付信息")
common.ApiErrorT(c, "Payment information has not been configured by administrator")
return
}
@@ -95,7 +95,7 @@ func SubscriptionRequestEpay(c *gin.Context) {
Status: common.TopUpStatusPending,
}
if err := order.Insert(); err != nil {
common.ApiErrorMsg(c, "创建订单失败")
common.ApiErrorT(c, "Failed to create order")
return
}
uri, params, err := client.Purchase(&epay.PurchaseArgs{
@@ -109,7 +109,7 @@ func SubscriptionRequestEpay(c *gin.Context) {
})
if err != nil {
_ = model.ExpireSubscriptionOrder(tradeNo, model.PaymentProviderEpay)
common.ApiErrorMsg(c, "拉起支付失败")
common.ApiErrorT(c, "Failed to start payment")
return
}
c.JSON(http.StatusOK, gin.H{"message": "success", "data": params, "url": uri})