feat: add online payment management and checkout
Some checks failed
Check / delivery-static (push) Has been cancelled
Check / api (push) Has been cancelled
Check / web (push) Has been cancelled

Co-Authored-By: Craft Agent <agents-noreply@craft.do>
This commit is contained in:
2026-10-15 09:26:40 +08:00
parent 5353a4a128
commit dc2efcde08
41 changed files with 4855 additions and 21 deletions

View File

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