Skip to content

Commit ed91c56

Browse files
committed
update stripe webhook
1 parent 64ec447 commit ed91c56

File tree

6 files changed

+23
-7
lines changed

6 files changed

+23
-7
lines changed

.github/workflows/api_cd.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
steps:
2828
- uses: actions/checkout@v4
2929
- uses: superfly/flyctl-actions/setup-flyctl@master
30-
- run: flyctl deploy --config apps/api/fly.toml --remote-only -e APP_VERSION=${{ needs.compute-version.outputs.version }}
30+
- run: flyctl deploy --config apps/api/fly.toml --dockerfile apps/api/Dockerfile --remote-only -e APP_VERSION=${{ needs.compute-version.outputs.version }}
3131
env:
3232
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
3333

apps/api/src/integration/stripe-sync.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
import { StripeSync } from "@supabase/stripe-sync-engine";
22

33
import { env } from "../env";
4-
5-
export const STRIPE_API_VERSION = "2023-10-16";
4+
import { STRIPE_API_VERSION } from "./stripe";
65

76
export const stripeSync = new StripeSync({
87
schema: "stripe",

apps/api/src/integration/stripe.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ import Stripe from "stripe";
22

33
import { env } from "../env";
44

5+
export const STRIPE_API_VERSION = "2025-10-29.clover";
6+
57
export const stripe = new Stripe(env.STRIPE_SECRET_KEY, {
6-
apiVersion: "2025-10-29.clover",
8+
apiVersion: STRIPE_API_VERSION,
79
});

apps/api/src/routes/webhook.ts

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,13 +58,28 @@ webhook.post(
5858
error instanceof Error &&
5959
error.message === "Unhandled webhook event"
6060
) {
61-
// stripe-sync-engine doesn't support this event type, skip silently
61+
Sentry.captureMessage(
62+
`Unhandled Stripe webhook event: ${stripeEvent.type}`,
63+
{
64+
level: "warning",
65+
tags: {
66+
webhook: "stripe",
67+
event_type: stripeEvent.type,
68+
},
69+
extra: {
70+
api_version: stripeEvent.api_version,
71+
},
72+
},
73+
);
6274
} else {
6375
Sentry.captureException(error, {
6476
tags: {
6577
webhook: "stripe",
6678
event_type: stripeEvent.type,
6779
},
80+
extra: {
81+
api_version: stripeEvent.api_version,
82+
},
6883
});
6984
return c.json({ error: "stripe_sync_failed" }, 500);
7085
}

apps/api/src/scripts/stripe-backfill.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { StripeSync } from "@supabase/stripe-sync-engine";
22
import { parseArgs } from "util";
33

4-
import { STRIPE_API_VERSION } from "../integration/stripe-sync";
4+
import { STRIPE_API_VERSION } from "../integration/stripe";
55

66
const { DATABASE_URL, STRIPE_SECRET_KEY, STRIPE_WEBHOOK_SECRET } = Bun.env;
77

supabase/.temp/cli-latest

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v2.65.5
1+
v2.67.1

0 commit comments

Comments
 (0)