Add Lemon Squeezy Billing System
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
import { z } from 'zod';
|
||||
|
||||
export const StripeClientEnvSchema = z
|
||||
.object({
|
||||
publishableKey: z.string().min(1),
|
||||
})
|
||||
.refine(
|
||||
(schema) => {
|
||||
return schema.publishableKey.startsWith('pk_');
|
||||
},
|
||||
{
|
||||
path: ['publishableKey'],
|
||||
message: `Stripe publishable key must start with 'pk_'`,
|
||||
},
|
||||
);
|
||||
@@ -0,0 +1,25 @@
|
||||
import { z } from 'zod';
|
||||
|
||||
export const StripeServerEnvSchema = z
|
||||
.object({
|
||||
secretKey: z.string().min(1),
|
||||
webhooksSecret: z.string().min(1),
|
||||
})
|
||||
.refine(
|
||||
(schema) => {
|
||||
return schema.secretKey.startsWith('sk_');
|
||||
},
|
||||
{
|
||||
path: ['STRIPE_SECRET_KEY'],
|
||||
message: `Stripe secret key must start with 'sk_'`,
|
||||
},
|
||||
)
|
||||
.refine(
|
||||
(schema) => {
|
||||
return schema.webhooksSecret.startsWith('whsec_');
|
||||
},
|
||||
{
|
||||
path: ['STRIPE_WEBHOOK_SECRET'],
|
||||
message: `Stripe webhook secret must start with 'whsec_'`,
|
||||
},
|
||||
);
|
||||
Reference in New Issue
Block a user