@better-auth/stripe 1.5.0-beta.9 → 1.5.0
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/README.md +17 -0
- package/dist/client.d.mts +52 -171
- package/dist/client.mjs +3 -2
- package/dist/client.mjs.map +1 -0
- package/dist/{error-codes-Clj-xYDP.mjs → error-codes-CCosYkXx.mjs} +4 -1
- package/dist/error-codes-CCosYkXx.mjs.map +1 -0
- package/dist/index.d.mts +519 -2
- package/dist/index.mjs +586 -232
- package/dist/index.mjs.map +1 -0
- package/dist/types-OT6L84x4.d.mts +480 -0
- package/package.json +28 -22
- package/.turbo/turbo-build.log +0 -17
- package/CHANGELOG.md +0 -24
- package/dist/index-BqGWQFAv.d.mts +0 -1015
- package/src/client.ts +0 -38
- package/src/error-codes.ts +0 -30
- package/src/hooks.ts +0 -435
- package/src/index.ts +0 -314
- package/src/middleware.ts +0 -104
- package/src/routes.ts +0 -1684
- package/src/schema.ts +0 -128
- package/src/types.ts +0 -449
- package/src/utils.ts +0 -70
- package/test/stripe-organization.test.ts +0 -1993
- package/test/stripe.test.ts +0 -4873
- package/tsconfig.json +0 -14
- package/tsdown.config.ts +0 -8
- package/vitest.config.ts +0 -8
package/README.md
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# Better Auth Stripe Plugin
|
|
2
|
+
|
|
3
|
+
Stripe plugin for [Better Auth](https://www.better-auth.com) — integrate Stripe billing with your authentication system.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @better-auth/stripe
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Documentation
|
|
12
|
+
|
|
13
|
+
For full documentation, visit [better-auth.com/docs/plugins/stripe](https://www.better-auth.com/docs/plugins/stripe).
|
|
14
|
+
|
|
15
|
+
## License
|
|
16
|
+
|
|
17
|
+
MIT
|
package/dist/client.d.mts
CHANGED
|
@@ -1,91 +1,32 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a as StripePlan } from "./types-OT6L84x4.mjs";
|
|
2
|
+
import { stripe } from "./index.mjs";
|
|
3
|
+
import * as better_auth0 from "better-auth";
|
|
2
4
|
|
|
3
5
|
//#region src/error-codes.d.ts
|
|
4
6
|
declare const STRIPE_ERROR_CODES: {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
};
|
|
29
|
-
readonly CUSTOMER_NOT_FOUND: {
|
|
30
|
-
code: "CUSTOMER_NOT_FOUND";
|
|
31
|
-
message: "Stripe customer not found for this user";
|
|
32
|
-
};
|
|
33
|
-
readonly UNABLE_TO_CREATE_CUSTOMER: {
|
|
34
|
-
code: "UNABLE_TO_CREATE_CUSTOMER";
|
|
35
|
-
message: "Unable to create customer";
|
|
36
|
-
};
|
|
37
|
-
readonly UNABLE_TO_CREATE_BILLING_PORTAL: {
|
|
38
|
-
code: "UNABLE_TO_CREATE_BILLING_PORTAL";
|
|
39
|
-
message: "Unable to create billing portal session";
|
|
40
|
-
};
|
|
41
|
-
readonly STRIPE_SIGNATURE_NOT_FOUND: {
|
|
42
|
-
code: "STRIPE_SIGNATURE_NOT_FOUND";
|
|
43
|
-
message: "Stripe signature not found";
|
|
44
|
-
};
|
|
45
|
-
readonly STRIPE_WEBHOOK_SECRET_NOT_FOUND: {
|
|
46
|
-
code: "STRIPE_WEBHOOK_SECRET_NOT_FOUND";
|
|
47
|
-
message: "Stripe webhook secret not found";
|
|
48
|
-
};
|
|
49
|
-
readonly STRIPE_WEBHOOK_ERROR: {
|
|
50
|
-
code: "STRIPE_WEBHOOK_ERROR";
|
|
51
|
-
message: "Stripe webhook error";
|
|
52
|
-
};
|
|
53
|
-
readonly FAILED_TO_CONSTRUCT_STRIPE_EVENT: {
|
|
54
|
-
code: "FAILED_TO_CONSTRUCT_STRIPE_EVENT";
|
|
55
|
-
message: "Failed to construct Stripe event";
|
|
56
|
-
};
|
|
57
|
-
readonly FAILED_TO_FETCH_PLANS: {
|
|
58
|
-
code: "FAILED_TO_FETCH_PLANS";
|
|
59
|
-
message: "Failed to fetch plans";
|
|
60
|
-
};
|
|
61
|
-
readonly EMAIL_VERIFICATION_REQUIRED: {
|
|
62
|
-
code: "EMAIL_VERIFICATION_REQUIRED";
|
|
63
|
-
message: "Email verification is required before you can subscribe to a plan";
|
|
64
|
-
};
|
|
65
|
-
readonly SUBSCRIPTION_NOT_ACTIVE: {
|
|
66
|
-
code: "SUBSCRIPTION_NOT_ACTIVE";
|
|
67
|
-
message: "Subscription is not active";
|
|
68
|
-
};
|
|
69
|
-
readonly SUBSCRIPTION_NOT_SCHEDULED_FOR_CANCELLATION: {
|
|
70
|
-
code: "SUBSCRIPTION_NOT_SCHEDULED_FOR_CANCELLATION";
|
|
71
|
-
message: "Subscription is not scheduled for cancellation";
|
|
72
|
-
};
|
|
73
|
-
readonly ORGANIZATION_NOT_FOUND: {
|
|
74
|
-
code: "ORGANIZATION_NOT_FOUND";
|
|
75
|
-
message: "Organization not found";
|
|
76
|
-
};
|
|
77
|
-
readonly ORGANIZATION_SUBSCRIPTION_NOT_ENABLED: {
|
|
78
|
-
code: "ORGANIZATION_SUBSCRIPTION_NOT_ENABLED";
|
|
79
|
-
message: "Organization subscription is not enabled";
|
|
80
|
-
};
|
|
81
|
-
readonly ORGANIZATION_HAS_ACTIVE_SUBSCRIPTION: {
|
|
82
|
-
code: "ORGANIZATION_HAS_ACTIVE_SUBSCRIPTION";
|
|
83
|
-
message: "Cannot delete organization with active subscription";
|
|
84
|
-
};
|
|
85
|
-
readonly ORGANIZATION_REFERENCE_ID_REQUIRED: {
|
|
86
|
-
code: "ORGANIZATION_REFERENCE_ID_REQUIRED";
|
|
87
|
-
message: "Reference ID is required. Provide referenceId or set activeOrganizationId in session";
|
|
88
|
-
};
|
|
7
|
+
UNAUTHORIZED: better_auth0.RawError<"UNAUTHORIZED">;
|
|
8
|
+
INVALID_REQUEST_BODY: better_auth0.RawError<"INVALID_REQUEST_BODY">;
|
|
9
|
+
SUBSCRIPTION_NOT_FOUND: better_auth0.RawError<"SUBSCRIPTION_NOT_FOUND">;
|
|
10
|
+
SUBSCRIPTION_PLAN_NOT_FOUND: better_auth0.RawError<"SUBSCRIPTION_PLAN_NOT_FOUND">;
|
|
11
|
+
ALREADY_SUBSCRIBED_PLAN: better_auth0.RawError<"ALREADY_SUBSCRIBED_PLAN">;
|
|
12
|
+
REFERENCE_ID_NOT_ALLOWED: better_auth0.RawError<"REFERENCE_ID_NOT_ALLOWED">;
|
|
13
|
+
CUSTOMER_NOT_FOUND: better_auth0.RawError<"CUSTOMER_NOT_FOUND">;
|
|
14
|
+
UNABLE_TO_CREATE_CUSTOMER: better_auth0.RawError<"UNABLE_TO_CREATE_CUSTOMER">;
|
|
15
|
+
UNABLE_TO_CREATE_BILLING_PORTAL: better_auth0.RawError<"UNABLE_TO_CREATE_BILLING_PORTAL">;
|
|
16
|
+
STRIPE_SIGNATURE_NOT_FOUND: better_auth0.RawError<"STRIPE_SIGNATURE_NOT_FOUND">;
|
|
17
|
+
STRIPE_WEBHOOK_SECRET_NOT_FOUND: better_auth0.RawError<"STRIPE_WEBHOOK_SECRET_NOT_FOUND">;
|
|
18
|
+
STRIPE_WEBHOOK_ERROR: better_auth0.RawError<"STRIPE_WEBHOOK_ERROR">;
|
|
19
|
+
FAILED_TO_CONSTRUCT_STRIPE_EVENT: better_auth0.RawError<"FAILED_TO_CONSTRUCT_STRIPE_EVENT">;
|
|
20
|
+
FAILED_TO_FETCH_PLANS: better_auth0.RawError<"FAILED_TO_FETCH_PLANS">;
|
|
21
|
+
EMAIL_VERIFICATION_REQUIRED: better_auth0.RawError<"EMAIL_VERIFICATION_REQUIRED">;
|
|
22
|
+
SUBSCRIPTION_NOT_ACTIVE: better_auth0.RawError<"SUBSCRIPTION_NOT_ACTIVE">;
|
|
23
|
+
SUBSCRIPTION_NOT_SCHEDULED_FOR_CANCELLATION: better_auth0.RawError<"SUBSCRIPTION_NOT_SCHEDULED_FOR_CANCELLATION">;
|
|
24
|
+
SUBSCRIPTION_NOT_PENDING_CHANGE: better_auth0.RawError<"SUBSCRIPTION_NOT_PENDING_CHANGE">;
|
|
25
|
+
ORGANIZATION_NOT_FOUND: better_auth0.RawError<"ORGANIZATION_NOT_FOUND">;
|
|
26
|
+
ORGANIZATION_SUBSCRIPTION_NOT_ENABLED: better_auth0.RawError<"ORGANIZATION_SUBSCRIPTION_NOT_ENABLED">;
|
|
27
|
+
AUTHORIZE_REFERENCE_REQUIRED: better_auth0.RawError<"AUTHORIZE_REFERENCE_REQUIRED">;
|
|
28
|
+
ORGANIZATION_HAS_ACTIVE_SUBSCRIPTION: better_auth0.RawError<"ORGANIZATION_HAS_ACTIVE_SUBSCRIPTION">;
|
|
29
|
+
ORGANIZATION_REFERENCE_ID_REQUIRED: better_auth0.RawError<"ORGANIZATION_REFERENCE_ID_REQUIRED">;
|
|
89
30
|
};
|
|
90
31
|
//#endregion
|
|
91
32
|
//#region src/client.d.ts
|
|
@@ -98,7 +39,7 @@ declare const stripeClient: <O extends {
|
|
|
98
39
|
stripeWebhookSecret: string;
|
|
99
40
|
subscription: {
|
|
100
41
|
enabled: true;
|
|
101
|
-
plans: [];
|
|
42
|
+
plans: StripePlan[];
|
|
102
43
|
};
|
|
103
44
|
} : {
|
|
104
45
|
stripeClient: any;
|
|
@@ -109,91 +50,31 @@ declare const stripeClient: <O extends {
|
|
|
109
50
|
"/subscription/restore": "POST";
|
|
110
51
|
};
|
|
111
52
|
$ERROR_CODES: {
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
};
|
|
136
|
-
readonly CUSTOMER_NOT_FOUND: {
|
|
137
|
-
code: "CUSTOMER_NOT_FOUND";
|
|
138
|
-
message: "Stripe customer not found for this user";
|
|
139
|
-
};
|
|
140
|
-
readonly UNABLE_TO_CREATE_CUSTOMER: {
|
|
141
|
-
code: "UNABLE_TO_CREATE_CUSTOMER";
|
|
142
|
-
message: "Unable to create customer";
|
|
143
|
-
};
|
|
144
|
-
readonly UNABLE_TO_CREATE_BILLING_PORTAL: {
|
|
145
|
-
code: "UNABLE_TO_CREATE_BILLING_PORTAL";
|
|
146
|
-
message: "Unable to create billing portal session";
|
|
147
|
-
};
|
|
148
|
-
readonly STRIPE_SIGNATURE_NOT_FOUND: {
|
|
149
|
-
code: "STRIPE_SIGNATURE_NOT_FOUND";
|
|
150
|
-
message: "Stripe signature not found";
|
|
151
|
-
};
|
|
152
|
-
readonly STRIPE_WEBHOOK_SECRET_NOT_FOUND: {
|
|
153
|
-
code: "STRIPE_WEBHOOK_SECRET_NOT_FOUND";
|
|
154
|
-
message: "Stripe webhook secret not found";
|
|
155
|
-
};
|
|
156
|
-
readonly STRIPE_WEBHOOK_ERROR: {
|
|
157
|
-
code: "STRIPE_WEBHOOK_ERROR";
|
|
158
|
-
message: "Stripe webhook error";
|
|
159
|
-
};
|
|
160
|
-
readonly FAILED_TO_CONSTRUCT_STRIPE_EVENT: {
|
|
161
|
-
code: "FAILED_TO_CONSTRUCT_STRIPE_EVENT";
|
|
162
|
-
message: "Failed to construct Stripe event";
|
|
163
|
-
};
|
|
164
|
-
readonly FAILED_TO_FETCH_PLANS: {
|
|
165
|
-
code: "FAILED_TO_FETCH_PLANS";
|
|
166
|
-
message: "Failed to fetch plans";
|
|
167
|
-
};
|
|
168
|
-
readonly EMAIL_VERIFICATION_REQUIRED: {
|
|
169
|
-
code: "EMAIL_VERIFICATION_REQUIRED";
|
|
170
|
-
message: "Email verification is required before you can subscribe to a plan";
|
|
171
|
-
};
|
|
172
|
-
readonly SUBSCRIPTION_NOT_ACTIVE: {
|
|
173
|
-
code: "SUBSCRIPTION_NOT_ACTIVE";
|
|
174
|
-
message: "Subscription is not active";
|
|
175
|
-
};
|
|
176
|
-
readonly SUBSCRIPTION_NOT_SCHEDULED_FOR_CANCELLATION: {
|
|
177
|
-
code: "SUBSCRIPTION_NOT_SCHEDULED_FOR_CANCELLATION";
|
|
178
|
-
message: "Subscription is not scheduled for cancellation";
|
|
179
|
-
};
|
|
180
|
-
readonly ORGANIZATION_NOT_FOUND: {
|
|
181
|
-
code: "ORGANIZATION_NOT_FOUND";
|
|
182
|
-
message: "Organization not found";
|
|
183
|
-
};
|
|
184
|
-
readonly ORGANIZATION_SUBSCRIPTION_NOT_ENABLED: {
|
|
185
|
-
code: "ORGANIZATION_SUBSCRIPTION_NOT_ENABLED";
|
|
186
|
-
message: "Organization subscription is not enabled";
|
|
187
|
-
};
|
|
188
|
-
readonly ORGANIZATION_HAS_ACTIVE_SUBSCRIPTION: {
|
|
189
|
-
code: "ORGANIZATION_HAS_ACTIVE_SUBSCRIPTION";
|
|
190
|
-
message: "Cannot delete organization with active subscription";
|
|
191
|
-
};
|
|
192
|
-
readonly ORGANIZATION_REFERENCE_ID_REQUIRED: {
|
|
193
|
-
code: "ORGANIZATION_REFERENCE_ID_REQUIRED";
|
|
194
|
-
message: "Reference ID is required. Provide referenceId or set activeOrganizationId in session";
|
|
195
|
-
};
|
|
53
|
+
UNAUTHORIZED: better_auth0.RawError<"UNAUTHORIZED">;
|
|
54
|
+
INVALID_REQUEST_BODY: better_auth0.RawError<"INVALID_REQUEST_BODY">;
|
|
55
|
+
SUBSCRIPTION_NOT_FOUND: better_auth0.RawError<"SUBSCRIPTION_NOT_FOUND">;
|
|
56
|
+
SUBSCRIPTION_PLAN_NOT_FOUND: better_auth0.RawError<"SUBSCRIPTION_PLAN_NOT_FOUND">;
|
|
57
|
+
ALREADY_SUBSCRIBED_PLAN: better_auth0.RawError<"ALREADY_SUBSCRIBED_PLAN">;
|
|
58
|
+
REFERENCE_ID_NOT_ALLOWED: better_auth0.RawError<"REFERENCE_ID_NOT_ALLOWED">;
|
|
59
|
+
CUSTOMER_NOT_FOUND: better_auth0.RawError<"CUSTOMER_NOT_FOUND">;
|
|
60
|
+
UNABLE_TO_CREATE_CUSTOMER: better_auth0.RawError<"UNABLE_TO_CREATE_CUSTOMER">;
|
|
61
|
+
UNABLE_TO_CREATE_BILLING_PORTAL: better_auth0.RawError<"UNABLE_TO_CREATE_BILLING_PORTAL">;
|
|
62
|
+
STRIPE_SIGNATURE_NOT_FOUND: better_auth0.RawError<"STRIPE_SIGNATURE_NOT_FOUND">;
|
|
63
|
+
STRIPE_WEBHOOK_SECRET_NOT_FOUND: better_auth0.RawError<"STRIPE_WEBHOOK_SECRET_NOT_FOUND">;
|
|
64
|
+
STRIPE_WEBHOOK_ERROR: better_auth0.RawError<"STRIPE_WEBHOOK_ERROR">;
|
|
65
|
+
FAILED_TO_CONSTRUCT_STRIPE_EVENT: better_auth0.RawError<"FAILED_TO_CONSTRUCT_STRIPE_EVENT">;
|
|
66
|
+
FAILED_TO_FETCH_PLANS: better_auth0.RawError<"FAILED_TO_FETCH_PLANS">;
|
|
67
|
+
EMAIL_VERIFICATION_REQUIRED: better_auth0.RawError<"EMAIL_VERIFICATION_REQUIRED">;
|
|
68
|
+
SUBSCRIPTION_NOT_ACTIVE: better_auth0.RawError<"SUBSCRIPTION_NOT_ACTIVE">;
|
|
69
|
+
SUBSCRIPTION_NOT_SCHEDULED_FOR_CANCELLATION: better_auth0.RawError<"SUBSCRIPTION_NOT_SCHEDULED_FOR_CANCELLATION">;
|
|
70
|
+
SUBSCRIPTION_NOT_PENDING_CHANGE: better_auth0.RawError<"SUBSCRIPTION_NOT_PENDING_CHANGE">;
|
|
71
|
+
ORGANIZATION_NOT_FOUND: better_auth0.RawError<"ORGANIZATION_NOT_FOUND">;
|
|
72
|
+
ORGANIZATION_SUBSCRIPTION_NOT_ENABLED: better_auth0.RawError<"ORGANIZATION_SUBSCRIPTION_NOT_ENABLED">;
|
|
73
|
+
AUTHORIZE_REFERENCE_REQUIRED: better_auth0.RawError<"AUTHORIZE_REFERENCE_REQUIRED">;
|
|
74
|
+
ORGANIZATION_HAS_ACTIVE_SUBSCRIPTION: better_auth0.RawError<"ORGANIZATION_HAS_ACTIVE_SUBSCRIPTION">;
|
|
75
|
+
ORGANIZATION_REFERENCE_ID_REQUIRED: better_auth0.RawError<"ORGANIZATION_REFERENCE_ID_REQUIRED">;
|
|
196
76
|
};
|
|
197
77
|
};
|
|
198
78
|
//#endregion
|
|
199
|
-
export { STRIPE_ERROR_CODES, stripeClient };
|
|
79
|
+
export { STRIPE_ERROR_CODES, stripeClient };
|
|
80
|
+
//# sourceMappingURL=client.d.mts.map
|
package/dist/client.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as STRIPE_ERROR_CODES } from "./error-codes-
|
|
1
|
+
import { t as STRIPE_ERROR_CODES } from "./error-codes-CCosYkXx.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/client.ts
|
|
4
4
|
const stripeClient = (options) => {
|
|
@@ -14,4 +14,5 @@ const stripeClient = (options) => {
|
|
|
14
14
|
};
|
|
15
15
|
|
|
16
16
|
//#endregion
|
|
17
|
-
export { STRIPE_ERROR_CODES, stripeClient };
|
|
17
|
+
export { STRIPE_ERROR_CODES, stripeClient };
|
|
18
|
+
//# sourceMappingURL=client.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.mjs","names":[],"sources":["../src/client.ts"],"sourcesContent":["import type { BetterAuthClientPlugin } from \"better-auth/client\";\nimport { STRIPE_ERROR_CODES } from \"./error-codes\";\nimport type { StripePlan, stripe } from \"./index\";\nexport const stripeClient = <\n\tO extends {\n\t\tsubscription: boolean;\n\t},\n>(\n\toptions?: O | undefined,\n) => {\n\treturn {\n\t\tid: \"stripe-client\",\n\t\t$InferServerPlugin: {} as ReturnType<\n\t\t\ttypeof stripe<\n\t\t\t\tO[\"subscription\"] extends true\n\t\t\t\t\t? {\n\t\t\t\t\t\t\tstripeClient: any;\n\t\t\t\t\t\t\tstripeWebhookSecret: string;\n\t\t\t\t\t\t\tsubscription: {\n\t\t\t\t\t\t\t\tenabled: true;\n\t\t\t\t\t\t\t\tplans: StripePlan[];\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t}\n\t\t\t\t\t: {\n\t\t\t\t\t\t\tstripeClient: any;\n\t\t\t\t\t\t\tstripeWebhookSecret: string;\n\t\t\t\t\t\t}\n\t\t\t>\n\t\t>,\n\t\tpathMethods: {\n\t\t\t\"/subscription/billing-portal\": \"POST\",\n\t\t\t\"/subscription/restore\": \"POST\",\n\t\t},\n\t\t$ERROR_CODES: STRIPE_ERROR_CODES,\n\t} satisfies BetterAuthClientPlugin;\n};\nexport * from \"./error-codes\";\n"],"mappings":";;;AAGA,MAAa,gBAKZ,YACI;AACJ,QAAO;EACN,IAAI;EACJ,oBAAoB,EAAE;EAiBtB,aAAa;GACZ,gCAAgC;GAChC,yBAAyB;GACzB;EACD,cAAc;EACd"}
|
|
@@ -19,11 +19,14 @@ const STRIPE_ERROR_CODES = defineErrorCodes({
|
|
|
19
19
|
EMAIL_VERIFICATION_REQUIRED: "Email verification is required before you can subscribe to a plan",
|
|
20
20
|
SUBSCRIPTION_NOT_ACTIVE: "Subscription is not active",
|
|
21
21
|
SUBSCRIPTION_NOT_SCHEDULED_FOR_CANCELLATION: "Subscription is not scheduled for cancellation",
|
|
22
|
+
SUBSCRIPTION_NOT_PENDING_CHANGE: "Subscription has no pending cancellation or scheduled plan change",
|
|
22
23
|
ORGANIZATION_NOT_FOUND: "Organization not found",
|
|
23
24
|
ORGANIZATION_SUBSCRIPTION_NOT_ENABLED: "Organization subscription is not enabled",
|
|
25
|
+
AUTHORIZE_REFERENCE_REQUIRED: "Organization subscriptions require authorizeReference callback to be configured",
|
|
24
26
|
ORGANIZATION_HAS_ACTIVE_SUBSCRIPTION: "Cannot delete organization with active subscription",
|
|
25
27
|
ORGANIZATION_REFERENCE_ID_REQUIRED: "Reference ID is required. Provide referenceId or set activeOrganizationId in session"
|
|
26
28
|
});
|
|
27
29
|
|
|
28
30
|
//#endregion
|
|
29
|
-
export { STRIPE_ERROR_CODES as t };
|
|
31
|
+
export { STRIPE_ERROR_CODES as t };
|
|
32
|
+
//# sourceMappingURL=error-codes-CCosYkXx.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error-codes-CCosYkXx.mjs","names":[],"sources":["../src/error-codes.ts"],"sourcesContent":["import { defineErrorCodes } from \"@better-auth/core/utils/error-codes\";\n\nexport const STRIPE_ERROR_CODES = defineErrorCodes({\n\tUNAUTHORIZED: \"Unauthorized access\",\n\tINVALID_REQUEST_BODY: \"Invalid request body\",\n\tSUBSCRIPTION_NOT_FOUND: \"Subscription not found\",\n\tSUBSCRIPTION_PLAN_NOT_FOUND: \"Subscription plan not found\",\n\tALREADY_SUBSCRIBED_PLAN: \"You're already subscribed to this plan\",\n\tREFERENCE_ID_NOT_ALLOWED: \"Reference id is not allowed\",\n\tCUSTOMER_NOT_FOUND: \"Stripe customer not found for this user\",\n\tUNABLE_TO_CREATE_CUSTOMER: \"Unable to create customer\",\n\tUNABLE_TO_CREATE_BILLING_PORTAL: \"Unable to create billing portal session\",\n\tSTRIPE_SIGNATURE_NOT_FOUND: \"Stripe signature not found\",\n\tSTRIPE_WEBHOOK_SECRET_NOT_FOUND: \"Stripe webhook secret not found\",\n\tSTRIPE_WEBHOOK_ERROR: \"Stripe webhook error\",\n\tFAILED_TO_CONSTRUCT_STRIPE_EVENT: \"Failed to construct Stripe event\",\n\tFAILED_TO_FETCH_PLANS: \"Failed to fetch plans\",\n\tEMAIL_VERIFICATION_REQUIRED:\n\t\t\"Email verification is required before you can subscribe to a plan\",\n\tSUBSCRIPTION_NOT_ACTIVE: \"Subscription is not active\",\n\t/**\n\t * @deprecated Use `SUBSCRIPTION_NOT_PENDING_CHANGE` instead.\n\t */\n\tSUBSCRIPTION_NOT_SCHEDULED_FOR_CANCELLATION:\n\t\t\"Subscription is not scheduled for cancellation\",\n\tSUBSCRIPTION_NOT_PENDING_CHANGE:\n\t\t\"Subscription has no pending cancellation or scheduled plan change\",\n\tORGANIZATION_NOT_FOUND: \"Organization not found\",\n\tORGANIZATION_SUBSCRIPTION_NOT_ENABLED:\n\t\t\"Organization subscription is not enabled\",\n\tAUTHORIZE_REFERENCE_REQUIRED:\n\t\t\"Organization subscriptions require authorizeReference callback to be configured\",\n\tORGANIZATION_HAS_ACTIVE_SUBSCRIPTION:\n\t\t\"Cannot delete organization with active subscription\",\n\tORGANIZATION_REFERENCE_ID_REQUIRED:\n\t\t\"Reference ID is required. Provide referenceId or set activeOrganizationId in session\",\n});\n"],"mappings":";;;AAEA,MAAa,qBAAqB,iBAAiB;CAClD,cAAc;CACd,sBAAsB;CACtB,wBAAwB;CACxB,6BAA6B;CAC7B,yBAAyB;CACzB,0BAA0B;CAC1B,oBAAoB;CACpB,2BAA2B;CAC3B,iCAAiC;CACjC,4BAA4B;CAC5B,iCAAiC;CACjC,sBAAsB;CACtB,kCAAkC;CAClC,uBAAuB;CACvB,6BACC;CACD,yBAAyB;CAIzB,6CACC;CACD,iCACC;CACD,wBAAwB;CACxB,uCACC;CACD,8BACC;CACD,sCACC;CACD,oCACC;CACD,CAAC"}
|