UNPKG

fullcart

Version:

Add stripe checkout to any website

34 lines (30 loc) 887 B
import { z } from 'astro/zod' import { errorMap } from 'zod-validation-error' import { productSchema } from './productSchema' z.setErrorMap(errorMap as any) export const configSchema = z.object({ account: z.string(), url: z.string().url(), successUrl: z.string().url(), cancelUrl: z.string().url(), currency: z.string().default('USD'), shippingAdressCollection: z .object({ allowedCountries: z.array(z.string()), }) .optional(), shippingOptions: z .object({ shippingRate: z.string(), }) .optional(), invoiceCreation: z .object({ enabled: z.boolean(), }) .optional(), customerCreation: z.enum(['allways', 'if_required']).default('allways'), submitType: z.enum(['auto', 'book', 'donate', 'pay']).default('auto'), products: productSchema.array().nonempty(), }) export type Config = z.infer<typeof configSchema>