mirror of
https://github.com/Wei-Shaw/sub2api.git
synced 2026-10-24 23:43:46 +08:00
fix(payment): critical fixes from agent audit
- Fix CreateOrderResult field names (snake_case → camelCase to match backend) - Fix MethodLimits JSON tags to consistent snake_case - Fix Stripe webhook header case sensitivity (lowercase keys for map lookup) - Fix MaxAmount=0 backend validation (0 = no limit, not reject all) - Fix structured error for INVALID_AMOUNT per CLAUDE.md spec
This commit is contained in:
@@ -4,6 +4,7 @@ import (
|
||||
"io"
|
||||
"log/slog"
|
||||
"net/http"
|
||||
"strings"
|
||||
|
||||
"github.com/Wei-Shaw/sub2api/internal/payment"
|
||||
"github.com/Wei-Shaw/sub2api/internal/service"
|
||||
@@ -70,7 +71,7 @@ func (h *PaymentWebhookHandler) handleNotify(c *gin.Context, providerKey string)
|
||||
|
||||
headers := make(map[string]string)
|
||||
for k := range c.Request.Header {
|
||||
headers[k] = c.GetHeader(k)
|
||||
headers[strings.ToLower(k)] = c.GetHeader(k)
|
||||
}
|
||||
|
||||
notification, err := provider.VerifyNotification(c.Request.Context(), string(body), headers)
|
||||
|
||||
Reference in New Issue
Block a user