From 53e934be3bf0bbd74df7bc0fe53f2b9e0532ee46 Mon Sep 17 00:00:00 2001 From: marcus06 Date: Sun, 7 Jun 2026 23:47:43 +0200 Subject: [PATCH] chore(cap): raise per-order spend cap default from 200 to 500 (#39) --- pkg/config/config.go | 10 ++++++---- pkg/config/config_test.go | 10 +++++----- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/pkg/config/config.go b/pkg/config/config.go index 57f4b3a..3408faa 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -137,11 +137,13 @@ func getEnvOrDefault(key, defaultValue string) string { return defaultValue } -// loadMaxOrderCents reads MAX_ORDER_CENTS. Default $200. Explicit 0 disables -// the cap. Garbage or negative values fall back to the default with a warning -// so an operator typo cannot silently disable a fraud control. +// loadMaxOrderCents reads MAX_ORDER_CENTS. Default $500 — aligns with the +// PSD2 TRA exemption ceiling (above this, Stripe always requests SCA, so the +// cap is only meaningful below it). Explicit 0 disables the cap. Garbage or +// negative values fall back to the default with a warning so an operator +// typo cannot silently disable a fraud control. func loadMaxOrderCents() int { - const defaultCap = 20000 + const defaultCap = 50000 raw := os.Getenv("MAX_ORDER_CENTS") if raw == "" { return defaultCap diff --git a/pkg/config/config_test.go b/pkg/config/config_test.go index f6ad27f..a6b64c2 100644 --- a/pkg/config/config_test.go +++ b/pkg/config/config_test.go @@ -24,12 +24,12 @@ func TestLoadMaxOrderCents(t *testing.T) { env string // "" means unset want int }{ - {"empty falls back to default", "", 20000}, + {"empty falls back to default", "", 50000}, {"explicit zero disables", "0", 0}, - {"valid override", "50000", 50000}, - {"negative falls back to default", "-1", 20000}, - {"garbage falls back to default", "two hundred", 20000}, - {"empty after trim falls back to default", "", 20000}, + {"valid override", "30000", 30000}, + {"negative falls back to default", "-1", 50000}, + {"garbage falls back to default", "two hundred", 50000}, + {"empty after trim falls back to default", "", 50000}, } for _, tc := range cases {