Updated dependencies, Added Hosted mode for Stripe checkout
* chore: bump version to 3.1.0 and update dependencies in package.json, pnpm-lock.yaml, and pnpm-workspace.yaml; enhance billing services with support for hosted checkout page in Stripe integration * Enhance error handling in billing services to log error messages instead of objects; update documentation for Stripe integration to clarify publishable key requirements based on UI mode.
This commit is contained in:
committed by
GitHub
parent
9d7c7f8030
commit
6268d1bab0
@@ -1,11 +1,19 @@
|
||||
import * as z from 'zod';
|
||||
|
||||
const isHostedMode = process.env.STRIPE_UI_MODE === 'hosted_page';
|
||||
|
||||
export const StripeClientEnvSchema = z
|
||||
.object({
|
||||
publishableKey: z.string().min(1),
|
||||
publishableKey: isHostedMode
|
||||
? z.string().optional()
|
||||
: z.string().min(1),
|
||||
})
|
||||
.refine(
|
||||
(schema) => {
|
||||
if (isHostedMode || !schema.publishableKey) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return schema.publishableKey.startsWith('pk_');
|
||||
},
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user