Skip to content

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.tsx
index 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.json
index 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.ts
index 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.ts
index 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 types
const 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.yaml
index e6e5c338..967209ad 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -500,7 +500,7 @@ importers:
version: 19.2.5
ajv:
specifier: latest
- version: 8.17.1
+ version: 8.18.0
prettier:
specifier: ^3.4.2
version: 3.4.2
@@ -1484,8 +1484,8 @@ importers:
specifier: ^15.1.3
version: 15.1.3
stripe:
- 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.1
version: 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
dependencies:
- ajv: 8.17.1
+ ajv: 8.18.0
json-schema: 0.4.0
jsonpointer: 5.0.1
leven: 3.1.0
@@ -22928,9 +22928,9 @@ snapshots:
optionalDependencies:
ajv: 8.11.0
optionalDependencies:
- ajv: 8.17.1
+ ajv: 8.18.0
optionalDependencies:
@@ -22940,9 +22940,9 @@ snapshots:
dependencies:
ajv: 6.12.6
dependencies:
- ajv: 8.17.1
+ ajv: 8.18.0
fast-deep-equal: 3.1.3
@@ -22973,7 +22973,7 @@ snapshots:
require-from-string: 2.0.2
uri-js: 4.4.1
dependencies:
fast-deep-equal: 3.1.3
fast-uri: 3.0.6
@@ -25102,7 +25102,7 @@ snapshots:
dependencies:
- ajv: 8.17.1
+ ajv: 8.18.0
semver: 7.7.3
@@ -25139,7 +25139,7 @@ snapshots:
dependencies:
- ajv: 8.17.1
+ ajv: 8.18.0
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
- dependencies:
- qs: 6.14.0
optionalDependencies:
'@types/node': 24.10.3
@@ -33629,7 +33627,7 @@ snapshots:
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.0
common-tags: 1.8.2
fast-json-stable-stringify: 2.1.0
fs-extra: 9.1.0