From ace8f8a3d7b454040c1d88bbcfa7732f777a0518 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=AE=B8=E6=B0=B8=E6=81=92?= Date: Wed, 12 Mar 2025 15:12:38 -0400 Subject: [PATCH] fix: use subscription Id to fetch the current active subscription from stripe (#1770) --- packages/stripe/src/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/stripe/src/index.ts b/packages/stripe/src/index.ts index 4e5f2793fd..b0901b95a1 100644 --- a/packages/stripe/src/index.ts +++ b/packages/stripe/src/index.ts @@ -240,7 +240,7 @@ export const stripe = (options: O) => { customer: customerId, status: "active", }) - .then((res) => res.data[0]) + .then((res) => res.data.find(subscription => subscription.id === ctx.body.subscriptionId)) .catch((e) => null) : null;