feat: add online payment management and checkout
Co-Authored-By: Craft Agent <agents-noreply@craft.do>
This commit is contained in:
@@ -38,6 +38,10 @@ func NewOperations(logger *slog.Logger) *Operations {
|
||||
}
|
||||
func operation(path string) string {
|
||||
switch path {
|
||||
case "/api/v1/payments/checkout":
|
||||
return "payment_checkout"
|
||||
case "/api/v1/payments/:channel/notify":
|
||||
return "payment_notify"
|
||||
case "/api/v1/portal/snapshot":
|
||||
return "login"
|
||||
case "/api/v1/auth/login":
|
||||
@@ -117,8 +121,11 @@ func (o *Operations) Middleware() gin.HandlerFunc {
|
||||
c.Abort()
|
||||
}
|
||||
}()
|
||||
if op == "login" || op == "activation" || op == "heartbeat" || op == "download" {
|
||||
if op == "login" || op == "activation" || op == "heartbeat" || op == "download" || op == "payment_checkout" || op == "payment_notify" {
|
||||
limit := 60
|
||||
if op == "payment_notify" {
|
||||
limit = 600
|
||||
}
|
||||
if op == "login" {
|
||||
limit = 10
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user