/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { remap as remap$ } from "../../lib/primitives.js"; export type CheckoutSessionPaymentMethodCreate = { /** * Always `checkout-session` */ method?: "checkout-session" | undefined; /** * The ID for the checkout session. */ id: string; /** * The merchant reference that can be used to match the payment method against your own records. */ externalIdentifier?: string | null | undefined; /** * The `id` of a stored buyer to use Use this instead of the `buyer_external_identifier`. */ buyerId?: string | null | undefined; /** * The `external_identifier` of a stored buyer to use. Use this instead of the `buyer_id`. */ buyerExternalIdentifier?: string | null | undefined; }; /** @internal */ export type CheckoutSessionPaymentMethodCreate$Outbound = { method: "checkout-session"; id: string; external_identifier?: string | null | undefined; buyer_id?: string | null | undefined; buyer_external_identifier?: string | null | undefined; }; /** @internal */ export const CheckoutSessionPaymentMethodCreate$outboundSchema: z.ZodType< CheckoutSessionPaymentMethodCreate$Outbound, z.ZodTypeDef, CheckoutSessionPaymentMethodCreate > = z.object({ method: z.literal("checkout-session").default("checkout-session" as const), id: z.string(), externalIdentifier: z.nullable(z.string()).optional(), buyerId: z.nullable(z.string()).optional(), buyerExternalIdentifier: z.nullable(z.string()).optional(), }).transform((v) => { return remap$(v, { externalIdentifier: "external_identifier", buyerId: "buyer_id", buyerExternalIdentifier: "buyer_external_identifier", }); }); export function checkoutSessionPaymentMethodCreateToJSON( checkoutSessionPaymentMethodCreate: CheckoutSessionPaymentMethodCreate, ): string { return JSON.stringify( CheckoutSessionPaymentMethodCreate$outboundSchema.parse( checkoutSessionPaymentMethodCreate, ), ); }