From 87ef0a55506bbeafdb2a61d84ba43a6548b9a3c2 Mon Sep 17 00:00:00 2001 From: Ian Gulliver Date: Tue, 30 Dec 2025 11:52:52 -0800 Subject: [PATCH] Ignore Stripe API version mismatch in webhook --- main.go | 2 +- static/afac26.html | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/main.go b/main.go index d0acdcb..33af4d2 100644 --- a/main.go +++ b/main.go @@ -374,7 +374,7 @@ func handleStripeWebhook(w http.ResponseWriter, r *http.Request) { return } - event, err := webhook.ConstructEvent(body, r.Header.Get("Stripe-Signature"), os.Getenv("STRIPE_WEBHOOK_SECRET")) + event, err := webhook.ConstructEventWithOptions(body, r.Header.Get("Stripe-Signature"), os.Getenv("STRIPE_WEBHOOK_SECRET"), webhook.ConstructEventOptions{IgnoreAPIVersionMismatch: true}) if err != nil { log.Println("[ERROR] failed to verify webhook:", err) http.Error(w, "invalid signature", http.StatusBadRequest) diff --git a/static/afac26.html b/static/afac26.html index b69c95e..faca58a 100644 --- a/static/afac26.html +++ b/static/afac26.html @@ -140,7 +140,7 @@ Switch User
@@ -150,6 +150,7 @@
+ RSVP now!
Number of people:
@@ -310,6 +311,13 @@ } else { document.getElementById('rsvp-prompt').style.display = 'block'; document.getElementById('rsvp-status').style.display = 'none'; + const promptDonation = document.getElementById('prompt-donation-status'); + if (data.donation > 0) { + promptDonation.textContent = `You've donated $${data.donation.toFixed(2)}. Thank you!`; + promptDonation.style.display = 'block'; + } else { + promptDonation.style.display = 'none'; + } } }