Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

Fix Stripe webhook mode handling for live mode installations receiving test events (#2999)

Kiran Kf553bc7127e0
diff --git a/apps/web/app/(ee)/api/stripe/integration/webhook/route.ts b/apps/web/app/(ee)/api/stripe/integration/webhook/route.ts
index 190ea45bfa..3246e81fc8 100644
--- a/apps/web/app/(ee)/api/stripe/integration/webhook/route.ts
+++ b/apps/web/app/(ee)/api/stripe/integration/webhook/route.ts
@@ -67,6 +67,16 @@ export const POST = withAxiom(async (req: Request) => {
});
}
+ // When an app is installed in both live & test mode,
+ // test mode events are sent to both the test mode and live mode endpoints,
+ // and live mode events are sent to the live mode endpoint.
+ // See: https://docs.stripe.com/stripe-apps/build-backend#event-behavior-depends-on-install-mode
+ if (!event.livemode && mode === "live") {
+ return logAndRespond(
+ `Received a test webhook event (${event.type}) on our live webhook receiver endpoint, skipping...`,
+ );
+ }
+
let response = "OK";
switch (event.type) {
diff --git a/apps/web/app/(ee)/partners.dub.co/(dashboard)/profile/profile-details-form.tsx b/apps/web/app/(ee)/partners.dub.co/(dashboard)/profile/profile-details-form.tsx
index 964584b6a0..8970ec6d66 100644
--- a/apps/web/app/(ee)/partners.dub.co/(dashboard)/profile/profile-details-form.tsx
+++ b/apps/web/app/(ee)/partners.dub.co/(dashboard)/profile/profile-details-form.tsx
@@ -309,7 +309,6 @@ function BasicInfoForm({
<CountryCombobox
value={field.value || ""}
onChange={field.onChange}
- error={errors.country ? true : false}
disabledTooltip="Your country cannot be changed once set. If you need to update your country, please contact support."
/>
)}