@better-auth/stripe 1.3.11 → 1.3.13
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 +2 -2
- package/dist/index.cjs +11 -12
- package/dist/index.d.cts +3 -1
- package/dist/index.d.mts +3 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.mjs +11 -12
- package/package.json +3 -3
- package/src/index.ts +12 -14
- package/src/types.ts +1 -1
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
|
|
2
|
-
> @better-auth/stripe@1.3.
|
|
2
|
+
> @better-auth/stripe@1.3.13 build /home/runner/work/better-auth/better-auth/packages/stripe
|
|
3
3
|
> unbuild
|
|
4
4
|
|
|
5
5
|
[info] Automatically detected entries: src/index, src/client [esm] [cjs] [dts]
|
|
6
6
|
[info] Building stripe
|
|
7
7
|
[success] Build succeeded for stripe
|
|
8
|
-
[log] dist/index.cjs (total size: 45.
|
|
8
|
+
[log] dist/index.cjs (total size: 45.3 kB, chunk size: 45.3 kB, exports: stripe)
|
|
9
9
|
|
|
10
10
|
[log] dist/client.cjs (total size: 270 B, chunk size: 270 B, exports: stripeClient)
|
|
11
11
|
|
package/dist/index.cjs
CHANGED
|
@@ -1321,20 +1321,19 @@ const stripe = (options) => {
|
|
|
1321
1321
|
userId: user.id
|
|
1322
1322
|
}
|
|
1323
1323
|
});
|
|
1324
|
-
|
|
1324
|
+
await ctx2.context.internalAdapter.updateUser(user.id, {
|
|
1325
1325
|
stripeCustomerId: stripeCustomer.id
|
|
1326
1326
|
});
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
stripeCustomer
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
}
|
|
1327
|
+
await options.onCustomerCreate?.(
|
|
1328
|
+
{
|
|
1329
|
+
stripeCustomer,
|
|
1330
|
+
user: {
|
|
1331
|
+
...user,
|
|
1332
|
+
stripeCustomerId: stripeCustomer.id
|
|
1333
|
+
}
|
|
1334
|
+
},
|
|
1335
|
+
ctx2
|
|
1336
|
+
);
|
|
1338
1337
|
}
|
|
1339
1338
|
}
|
|
1340
1339
|
}
|
package/dist/index.d.cts
CHANGED
|
@@ -230,7 +230,9 @@ interface StripeOptions {
|
|
|
230
230
|
*/
|
|
231
231
|
onCustomerCreate?: (data: {
|
|
232
232
|
stripeCustomer: Stripe.Customer;
|
|
233
|
-
user: User
|
|
233
|
+
user: User & {
|
|
234
|
+
stripeCustomerId: string;
|
|
235
|
+
};
|
|
234
236
|
}, ctx: GenericEndpointContext) => Promise<void>;
|
|
235
237
|
/**
|
|
236
238
|
* A custom function to get the customer create
|
package/dist/index.d.mts
CHANGED
|
@@ -230,7 +230,9 @@ interface StripeOptions {
|
|
|
230
230
|
*/
|
|
231
231
|
onCustomerCreate?: (data: {
|
|
232
232
|
stripeCustomer: Stripe.Customer;
|
|
233
|
-
user: User
|
|
233
|
+
user: User & {
|
|
234
|
+
stripeCustomerId: string;
|
|
235
|
+
};
|
|
234
236
|
}, ctx: GenericEndpointContext) => Promise<void>;
|
|
235
237
|
/**
|
|
236
238
|
* A custom function to get the customer create
|
package/dist/index.d.ts
CHANGED
|
@@ -230,7 +230,9 @@ interface StripeOptions {
|
|
|
230
230
|
*/
|
|
231
231
|
onCustomerCreate?: (data: {
|
|
232
232
|
stripeCustomer: Stripe.Customer;
|
|
233
|
-
user: User
|
|
233
|
+
user: User & {
|
|
234
|
+
stripeCustomerId: string;
|
|
235
|
+
};
|
|
234
236
|
}, ctx: GenericEndpointContext) => Promise<void>;
|
|
235
237
|
/**
|
|
236
238
|
* A custom function to get the customer create
|
package/dist/index.mjs
CHANGED
|
@@ -1305,20 +1305,19 @@ const stripe = (options) => {
|
|
|
1305
1305
|
userId: user.id
|
|
1306
1306
|
}
|
|
1307
1307
|
});
|
|
1308
|
-
|
|
1308
|
+
await ctx2.context.internalAdapter.updateUser(user.id, {
|
|
1309
1309
|
stripeCustomerId: stripeCustomer.id
|
|
1310
1310
|
});
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
stripeCustomer
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
}
|
|
1311
|
+
await options.onCustomerCreate?.(
|
|
1312
|
+
{
|
|
1313
|
+
stripeCustomer,
|
|
1314
|
+
user: {
|
|
1315
|
+
...user,
|
|
1316
|
+
stripeCustomerId: stripeCustomer.id
|
|
1317
|
+
}
|
|
1318
|
+
},
|
|
1319
|
+
ctx2
|
|
1320
|
+
);
|
|
1322
1321
|
}
|
|
1323
1322
|
}
|
|
1324
1323
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@better-auth/stripe",
|
|
3
3
|
"author": "Bereket Engida",
|
|
4
|
-
"version": "1.3.
|
|
4
|
+
"version": "1.3.13",
|
|
5
5
|
"main": "dist/index.cjs",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"keywords": [
|
|
@@ -41,13 +41,13 @@
|
|
|
41
41
|
},
|
|
42
42
|
"peerDependencies": {
|
|
43
43
|
"stripe": "^18",
|
|
44
|
-
"better-auth": "1.3.
|
|
44
|
+
"better-auth": "1.3.13"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"better-call": "1.0.19",
|
|
48
48
|
"stripe": "^18.5.0",
|
|
49
49
|
"unbuild": "3.6.1",
|
|
50
|
-
"better-auth": "1.3.
|
|
50
|
+
"better-auth": "1.3.13"
|
|
51
51
|
},
|
|
52
52
|
"scripts": {
|
|
53
53
|
"test": "vitest",
|
package/src/index.ts
CHANGED
|
@@ -1242,21 +1242,19 @@ export const stripe = <O extends StripeOptions>(options: O) => {
|
|
|
1242
1242
|
userId: user.id,
|
|
1243
1243
|
},
|
|
1244
1244
|
});
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
stripeCustomer,
|
|
1255
|
-
user,
|
|
1245
|
+
await ctx.context.internalAdapter.updateUser(user.id, {
|
|
1246
|
+
stripeCustomerId: stripeCustomer.id,
|
|
1247
|
+
});
|
|
1248
|
+
await options.onCustomerCreate?.(
|
|
1249
|
+
{
|
|
1250
|
+
stripeCustomer,
|
|
1251
|
+
user: {
|
|
1252
|
+
...user,
|
|
1253
|
+
stripeCustomerId: stripeCustomer.id,
|
|
1256
1254
|
},
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1255
|
+
},
|
|
1256
|
+
ctx,
|
|
1257
|
+
);
|
|
1260
1258
|
}
|
|
1261
1259
|
},
|
|
1262
1260
|
},
|
package/src/types.ts
CHANGED