A self-hostable bookmark-everything app (links, notes and images) with AI-based automatic tagging and full text search
feat(cloud): switch to managed payments
Mohamed Bassemb2849d869e7b
diff --git a/apps/web/components/settings/SubscriptionSettings.tsx b/apps/web/components/settings/SubscriptionSettings.tsxindex 48ab1258..12797aac 100644--- a/apps/web/components/settings/SubscriptionSettings.tsx+++ b/apps/web/components/settings/SubscriptionSettings.tsx@@ -183,10 +183,15 @@ export default function SubscriptionSettings() {{t("settings.subscription.unlock_bigger_quota")}</p>{subscriptionPrice && subscriptionPrice.amount ? (- <p className="mt-2 text-lg font-bold uppercase">- {subscriptionPrice.amount / 100}{" "}- {subscriptionPrice.currency}- </p>+ <span className="flex items-baseline gap-2">+ <p className="mt-2 text-lg font-bold uppercase">+ {subscriptionPrice.amount / 100}{" "}+ {subscriptionPrice.currency}+ </p>+ <span className="text-xs italic text-muted-foreground">+ (excl. VAT)+ </span>+ </span>) : (<Skeleton className="h-4 w-24" />)}diff --git a/packages/trpc/package.json b/packages/trpc/package.jsonindex d50a2174..4b52def8 100644--- a/packages/trpc/package.json+++ b/packages/trpc/package.json@@ -23,7 +23,7 @@"drizzle-orm": "^0.44.2","nodemailer": "^7.0.4","prom-client": "^15.1.3",- "stripe": "^18.3.0",+ "stripe": "^20.3.1","superjson": "^2.2.1","tiny-invariant": "^1.3.3","zod": "^3.24.2"diff --git a/packages/trpc/routers/subscriptions.test.ts b/packages/trpc/routers/subscriptions.test.tsindex 65c519e5..6e3b63ee 100644--- a/packages/trpc/routers/subscriptions.test.ts+++ b/packages/trpc/routers/subscriptions.test.ts@@ -189,7 +189,6 @@ describe("Subscription Routes", () => {expect(mockCheckoutSessionsCreate).toHaveBeenCalledWith({customer: "cus_new123",- payment_method_types: ["card"],line_items: [{price: "price_123",@@ -211,6 +210,9 @@ describe("Subscription Routes", () => {address: "auto",},allow_promotion_codes: true,+ managed_payments: {+ enabled: true,+ },});});diff --git a/packages/trpc/routers/subscriptions.ts b/packages/trpc/routers/subscriptions.tsindex 7b90d4bb..fa76e619 100644--- a/packages/trpc/routers/subscriptions.ts+++ b/packages/trpc/routers/subscriptions.ts@@ -12,7 +12,8 @@ import { authedProcedure, Context, publicProcedure, router } from "../index";const stripe = serverConfig.stripe.secretKey? new Stripe(serverConfig.stripe.secretKey, {- apiVersion: "2025-06-30.basil",+ // @ts-expect-error overrides the pinned API version+ apiVersion: "2025-06-30.basil; managed_payments_preview=v1",}): null;@@ -281,9 +282,9 @@ export const subscriptionsRouter = router({}}+ // @ts-expect-error managed_payments is a Stripe preview feature not yet in the SDK typesconst session = await stripe.checkout.sessions.create({customer: customerId,- payment_method_types: ["card"],line_items: [{price: priceId,@@ -296,13 +297,13 @@ export const subscriptionsRouter = router({metadata: {userId: ctx.user.id,},- automatic_tax: {- enabled: true,- },customer_update: {address: "auto",},allow_promotion_codes: true,+ managed_payments: {+ enabled: true,+ },});return {diff --git a/pnpm-lock.yaml b/pnpm-lock.yamlindex e6e5c338..967209ad 100644--- a/pnpm-lock.yaml+++ b/pnpm-lock.yaml@@ -500,7 +500,7 @@ importers:version: 19.2.5ajv:specifier: latest- version: 8.17.1+ version: 8.18.0prettier:specifier: ^3.4.2version: 3.4.2@@ -1484,8 +1484,8 @@ importers:specifier: ^15.1.3version: 15.1.3stripe:- specifier: ^18.3.0- version: 18.3.0(@types/[email protected])+ specifier: ^20.3.1+ version: 20.3.1(@types/[email protected])superjson:specifier: ^2.2.1version: 2.2.1@@ -6782,8 +6782,8 @@ packages:resolution: {integrity: sha512-PRA911Blj99jR5RMeTunVbNXMF6Lp4vZXnk5GQjcnUWUTsrXtekg/pnmFFI2u/I36Y/2bITGS30GZCXei6uNkA==}- resolution: {integrity: sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g==}+ resolution: {integrity: sha512-PlXPeEWMXMZ7sPYOHqmDyCJzcfNrUr3fGNKtezX14ykXOEIvyK81d+qydx89KY5O71FKMPaQ2vBfBFI5NHR63A==}resolution: {integrity: sha512-vQoK43U6HXA9/euCqLjvyNdM4G2Fiu/VFp4ae0Gau9sZeIKBPvUPnXfLYAe65Bg7PFuw03coeu5K6lTPSXRObw==}@@ -14270,11 +14270,11 @@ packages:resolution: {integrity: sha512-TcccoMhJOM3OebGhSBEmp3UZ2SfDMZUEBdRA/9ynfLi8yYajyWX3JiXArcJt4Umh4vISpspkQIY8ZZoCqjbviA==}- resolution: {integrity: sha512-FkxrTUUcWB4CVN2yzgsfF/YHD6WgYHduaa7VmokCy5TLCgl5UNJkwortxcedrxSavQ8Qfa4Ir4JxcbIYiBsyLg==}- engines: {node: '>=12.*'}+ resolution: {integrity: sha512-k990yOT5G5rhX3XluRPw5Y8RLdJDW4dzQ29wWT66piHrbnM2KyamJ1dKgPsw4HzGHRWjDiSSdcI2WdxQUPV3aQ==}+ engines: {node: '>=16'}peerDependencies:- '@types/node': '>=12.x.x'+ '@types/node': '>=16'peerDependenciesMeta:'@types/node':optional: true@@ -14412,12 +14412,12 @@ packages:resolution: {integrity: sha512-5S7Va8hKfV7W5U6g3aYxXmlPoZVAwUMy9AOKyF2fVuZa2UD3qZjg578OrLRt8PcNN1PleVaL/5/yYATNL0ICUw==}engines: {node: '>=18'}- deprecated: Old versions of tar are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting [email protected]+ deprecated: Old versions of tar are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exhorbitant rates) by contacting [email protected]resolution: {integrity: sha512-ENg5JUHUm2rDD7IvKNFGzyElLXNjachNLp6RaGf4+JOgxXHkqA+gq81ZAMCUmtMtqBsoU62lcp6S27g1LCYGGQ==}engines: {node: '>=18'}- deprecated: Old versions of tar are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting [email protected]+ deprecated: Old versions of tar are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exhorbitant rates) by contacting [email protected]resolution: {integrity: sha512-+G0LLgjjo9BZX2MfdvPfH+MKLCrxlXSYec5DaPYP1fe6Iyhf0/fSmJ0bFiZ1F8BT6cGXl2LpltQptzjXKWEkKA==}@@ -15754,9 +15754,9 @@ snapshots:'@jridgewell/gen-mapping': 0.3.8'@jridgewell/trace-mapping': 0.3.25- '@apideck/[email protected]([email protected])':+ '@apideck/[email protected]([email protected])':dependencies:- ajv: 8.17.1+ ajv: 8.18.0json-schema: 0.4.0jsonpointer: 5.0.1leven: 3.1.0@@ -22928,9 +22928,9 @@ snapshots:optionalDependencies:ajv: 8.11.0optionalDependencies:- ajv: 8.17.1+ ajv: 8.18.0optionalDependencies:@@ -22940,9 +22940,9 @@ snapshots:dependencies:ajv: 6.12.6dependencies:- ajv: 8.17.1+ ajv: 8.18.0fast-deep-equal: 3.1.3@@ -22973,7 +22973,7 @@ snapshots:require-from-string: 2.0.2uri-js: 4.4.1dependencies:fast-deep-equal: 3.1.3fast-uri: 3.0.6@@ -25102,7 +25102,7 @@ snapshots:dependencies:- ajv: 8.17.1+ ajv: 8.18.0expo: 54.0.31(@babel/[email protected])(@expo/[email protected])([email protected])([email protected]([email protected](@babel/[email protected])(@types/[email protected])([email protected]))([email protected]))([email protected](@babel/[email protected])(@types/[email protected])([email protected]))([email protected])semver: 7.7.3@@ -25139,7 +25139,7 @@ snapshots:dependencies:- ajv: 8.17.1+ ajv: 8.18.0expo: 54.0.31(@babel/[email protected])(@expo/[email protected])([email protected])([email protected]([email protected](@babel/[email protected])(@types/[email protected])([email protected]))([email protected]))([email protected](@babel/[email protected])(@types/[email protected])([email protected]))([email protected])expo-dev-menu: 7.0.18([email protected])expo-manifests: 1.0.10([email protected])@@ -31600,9 +31600,9 @@ snapshots:dependencies:'@types/json-schema': 7.0.15- ajv: 8.17.1- ajv-formats: 2.1.1([email protected])- ajv-keywords: 5.1.0([email protected])+ ajv: 8.18.0+ ajv-formats: 2.1.1([email protected])+ ajv-keywords: 5.1.0([email protected])@@ -32256,9 +32256,7 @@ snapshots:dependencies:js-tokens: 9.0.1- [email protected](@types/[email protected]):- dependencies:- qs: 6.14.0+ [email protected](@types/[email protected]):optionalDependencies:'@types/node': 24.10.3@@ -33629,7 +33627,7 @@ snapshots:[email protected](@types/[email protected]):dependencies:- '@apideck/better-ajv-errors': 0.3.6([email protected])+ '@apideck/better-ajv-errors': 0.3.6([email protected])'@babel/core': 7.26.0'@babel/preset-env': 7.27.2(@babel/[email protected])'@babel/runtime': 7.28.4@@ -33637,7 +33635,7 @@ snapshots:'@rollup/plugin-node-resolve': 11.2.1([email protected])'@rollup/plugin-replace': 2.4.2([email protected])'@surma/rollup-plugin-off-main-thread': 2.2.3- ajv: 8.17.1+ ajv: 8.18.0common-tags: 1.8.2fast-json-stable-stringify: 2.1.0fs-extra: 9.1.0