diff --git a/src/api/v1/donate.go b/src/api/v1/donate.go index 9c71c42..31ab342 100644 --- a/src/api/v1/donate.go +++ b/src/api/v1/donate.go @@ -5,6 +5,7 @@ import ( "encoding/json" "github.com/ImpactDevelopment/ImpactServer/src/database" "github.com/ImpactDevelopment/ImpactServer/src/discord" + "github.com/ImpactDevelopment/ImpactServer/src/recaptcha" "github.com/ImpactDevelopment/ImpactServer/src/stripe" "github.com/ImpactDevelopment/ImpactServer/src/util" "github.com/google/uuid" @@ -102,6 +103,12 @@ func createStripePayment(c echo.Context) error { return echo.NewHTTPError(http.StatusForbidden) } + // Only check recaptcha after we've verified that the address is allowed + err = recaptcha.Verify(c) + if err != nil { + return err + } + payment, err := stripe.CreatePayment(body.Amount, body.Currency, "Donation", body.Email) if err != nil { return err diff --git a/static/donate.html b/static/donate.html index eacb8d7..912e6bf 100644 --- a/static/donate.html +++ b/static/donate.html @@ -13,6 +13,7 @@ + @@ -129,7 +130,8 @@