@better-auth/stripe 1.4.13 → 1.4.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
> @better-auth/stripe@1.4.
|
|
2
|
+
> @better-auth/stripe@1.4.14 build /home/runner/work/better-auth/better-auth/packages/stripe
|
|
3
3
|
> tsdown
|
|
4
4
|
|
|
5
5
|
[34mℹ[39m tsdown [2mv0.17.2[22m powered by rolldown [2mv1.0.0-beta.53[22m
|
|
@@ -7,10 +7,10 @@
|
|
|
7
7
|
[34mℹ[39m entry: [34msrc/index.ts, src/client.ts[39m
|
|
8
8
|
[34mℹ[39m tsconfig: [34mtsconfig.json[39m
|
|
9
9
|
[34mℹ[39m Build start
|
|
10
|
-
[34mℹ[39m [2mdist/[22m[1mindex.mjs[22m [
|
|
10
|
+
[34mℹ[39m [2mdist/[22m[1mindex.mjs[22m [2m58.15 kB[22m [2m│ gzip: 10.60 kB[22m
|
|
11
11
|
[34mℹ[39m [2mdist/[22m[1mclient.mjs[22m [2m 0.26 kB[22m [2m│ gzip: 0.20 kB[22m
|
|
12
|
-
[34mℹ[39m [2mdist/[22m[32m[1mclient.d.mts[22m[39m [2m 0.62 kB[22m [2m│ gzip: 0.
|
|
12
|
+
[34mℹ[39m [2mdist/[22m[32m[1mclient.d.mts[22m[39m [2m 0.62 kB[22m [2m│ gzip: 0.34 kB[22m
|
|
13
13
|
[34mℹ[39m [2mdist/[22m[32m[1mindex.d.mts[22m[39m [2m 0.21 kB[22m [2m│ gzip: 0.14 kB[22m
|
|
14
|
-
[34mℹ[39m [2mdist/[22m[32mindex-
|
|
15
|
-
[34mℹ[39m 5 files, total: 89.
|
|
16
|
-
[32m✔[39m Build complete in [
|
|
14
|
+
[34mℹ[39m [2mdist/[22m[32mindex-BTvn0abC.d.mts[39m [2m30.34 kB[22m [2m│ gzip: 5.18 kB[22m
|
|
15
|
+
[34mℹ[39m 5 files, total: 89.58 kB
|
|
16
|
+
[32m✔[39m Build complete in [32m23099ms[39m
|
package/dist/client.d.mts
CHANGED
|
@@ -476,6 +476,7 @@ declare const stripe: <O extends StripeOptions>(options: O) => {
|
|
|
476
476
|
}>>;
|
|
477
477
|
metadata: zod0.ZodOptional<zod0.ZodRecord<zod0.ZodString, zod0.ZodAny>>;
|
|
478
478
|
seats: zod0.ZodOptional<zod0.ZodNumber>;
|
|
479
|
+
locale: zod0.ZodOptional<zod0.ZodCustom<Stripe.Checkout.Session.Locale, Stripe.Checkout.Session.Locale>>;
|
|
479
480
|
successUrl: zod0.ZodDefault<zod0.ZodString>;
|
|
480
481
|
cancelUrl: zod0.ZodDefault<zod0.ZodString>;
|
|
481
482
|
returnUrl: zod0.ZodOptional<zod0.ZodString>;
|
package/dist/index.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as SubscriptionOptions, i as Subscription, n as stripe, r as StripePlan, t as StripePlugin } from "./index-
|
|
1
|
+
import { a as SubscriptionOptions, i as Subscription, n as stripe, r as StripePlan, t as StripePlugin } from "./index-BTvn0abC.mjs";
|
|
2
2
|
export { StripePlan, StripePlugin, Subscription, SubscriptionOptions, stripe };
|
package/dist/index.mjs
CHANGED
|
@@ -449,6 +449,9 @@ const upgradeSubscriptionBodySchema = z.object({
|
|
|
449
449
|
customerType: z.enum(["user", "organization"]).meta({ description: "Customer type for the subscription. Eg: \"user\" or \"organization\"" }).optional(),
|
|
450
450
|
metadata: z.record(z.string(), z.any()).optional(),
|
|
451
451
|
seats: z.number().meta({ description: "Number of seats to upgrade to (if applicable). Eg: 1" }).optional(),
|
|
452
|
+
locale: z.custom((localization) => {
|
|
453
|
+
return typeof localization === "string";
|
|
454
|
+
}).meta({ description: "The locale to display Checkout in. Eg: 'en', 'ko'. If not provided or set to `auto`, the browser's locale is used." }).optional(),
|
|
452
455
|
successUrl: z.string().meta({ description: "Callback URL to redirect back after successful subscription. Eg: \"https://example.com/success\"" }).default("/"),
|
|
453
456
|
cancelUrl: z.string().meta({ description: "If set, checkout shows a back button and customers will be directed here if they cancel payment. Eg: \"https://example.com/pricing\"" }).default("/"),
|
|
454
457
|
returnUrl: z.string().meta({ description: "URL to take customers to when they click on the billing portal’s link to return to your website. Eg: \"https://example.com/dashboard\"" }).optional(),
|
|
@@ -720,6 +723,7 @@ const upgradeSubscription = (options) => {
|
|
|
720
723
|
address: "auto"
|
|
721
724
|
}
|
|
722
725
|
} : { customer_email: user$1.email },
|
|
726
|
+
locale: ctx.body.locale,
|
|
723
727
|
success_url: getUrl(ctx, `${ctx.context.baseURL}/subscription/success?callbackURL=${encodeURIComponent(ctx.body.successUrl)}&subscriptionId=${encodeURIComponent(subscription.id)}`),
|
|
724
728
|
cancel_url: getUrl(ctx, ctx.body.cancelUrl),
|
|
725
729
|
line_items: [{
|
|
@@ -1105,7 +1109,7 @@ const subscriptionSuccess = (options) => {
|
|
|
1105
1109
|
const createBillingPortalBodySchema = z.object({
|
|
1106
1110
|
locale: z.custom((localization) => {
|
|
1107
1111
|
return typeof localization === "string";
|
|
1108
|
-
}).optional(),
|
|
1112
|
+
}).meta({ description: "The IETF language tag of the locale Customer Portal is displayed in. Eg: 'en', 'ko'. If not provided or set to `auto`, the browser's locale is used." }).optional(),
|
|
1109
1113
|
referenceId: z.string().optional(),
|
|
1110
1114
|
customerType: z.enum(["user", "organization"]).meta({ description: "Customer type for the subscription. Eg: \"user\" or \"organization\"" }).optional(),
|
|
1111
1115
|
returnUrl: z.string().default("/"),
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@better-auth/stripe",
|
|
3
3
|
"author": "Bereket Engida",
|
|
4
|
-
"version": "1.4.
|
|
4
|
+
"version": "1.4.14",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.mjs",
|
|
7
7
|
"types": "dist/index.d.mts",
|
|
@@ -50,15 +50,15 @@
|
|
|
50
50
|
},
|
|
51
51
|
"peerDependencies": {
|
|
52
52
|
"stripe": "^18 || ^19 || ^20",
|
|
53
|
-
"@better-auth/core": "1.4.
|
|
54
|
-
"better-auth": "1.4.
|
|
53
|
+
"@better-auth/core": "1.4.14",
|
|
54
|
+
"better-auth": "1.4.14"
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
57
|
-
"better-call": "1.1.
|
|
57
|
+
"better-call": "1.1.8",
|
|
58
58
|
"stripe": "^20.0.0",
|
|
59
59
|
"tsdown": "^0.17.2",
|
|
60
|
-
"@better-auth/core": "1.4.
|
|
61
|
-
"better-auth": "1.4.
|
|
60
|
+
"@better-auth/core": "1.4.14",
|
|
61
|
+
"better-auth": "1.4.14"
|
|
62
62
|
},
|
|
63
63
|
"scripts": {
|
|
64
64
|
"test": "vitest",
|
package/src/routes.ts
CHANGED
|
@@ -158,6 +158,19 @@ const upgradeSubscriptionBodySchema = z.object({
|
|
|
158
158
|
description: "Number of seats to upgrade to (if applicable). Eg: 1",
|
|
159
159
|
})
|
|
160
160
|
.optional(),
|
|
161
|
+
/**
|
|
162
|
+
* The IETF language tag of the locale Checkout is displayed in.
|
|
163
|
+
* If not provided or set to `auto`, the browser's locale is used.
|
|
164
|
+
*/
|
|
165
|
+
locale: z
|
|
166
|
+
.custom<StripeType.Checkout.Session.Locale>((localization) => {
|
|
167
|
+
return typeof localization === "string";
|
|
168
|
+
})
|
|
169
|
+
.meta({
|
|
170
|
+
description:
|
|
171
|
+
"The locale to display Checkout in. Eg: 'en', 'ko'. If not provided or set to `auto`, the browser's locale is used.",
|
|
172
|
+
})
|
|
173
|
+
.optional(),
|
|
161
174
|
/**
|
|
162
175
|
* The URL to which Stripe should send customers when payment or setup is complete.
|
|
163
176
|
*/
|
|
@@ -691,6 +704,7 @@ export const upgradeSubscription = (options: StripeOptions) => {
|
|
|
691
704
|
: {
|
|
692
705
|
customer_email: user.email,
|
|
693
706
|
}),
|
|
707
|
+
locale: ctx.body.locale,
|
|
694
708
|
success_url: getUrl(
|
|
695
709
|
ctx,
|
|
696
710
|
`${
|
|
@@ -1412,10 +1426,18 @@ export const subscriptionSuccess = (options: StripeOptions) => {
|
|
|
1412
1426
|
};
|
|
1413
1427
|
|
|
1414
1428
|
const createBillingPortalBodySchema = z.object({
|
|
1429
|
+
/**
|
|
1430
|
+
* The IETF language tag of the locale Customer Portal is displayed in.
|
|
1431
|
+
* If not provided or set to `auto`, the browser's locale is used.
|
|
1432
|
+
*/
|
|
1415
1433
|
locale: z
|
|
1416
1434
|
.custom<StripeType.Checkout.Session.Locale>((localization) => {
|
|
1417
1435
|
return typeof localization === "string";
|
|
1418
1436
|
})
|
|
1437
|
+
.meta({
|
|
1438
|
+
description:
|
|
1439
|
+
"The IETF language tag of the locale Customer Portal is displayed in. Eg: 'en', 'ko'. If not provided or set to `auto`, the browser's locale is used.",
|
|
1440
|
+
})
|
|
1419
1441
|
.optional(),
|
|
1420
1442
|
referenceId: z.string().optional(),
|
|
1421
1443
|
/**
|