/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { remap as remap$ } from "../../lib/primitives.js"; /** * Create a payment with a checkout session ID (and an optional URL for 3DS). */ export type CheckoutSessionWithUrlPaymentMethodCreate = { /** * 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; /** * The URL to redirect a user back to after the complete 3DS in browser. */ redirectUrl?: string | null | undefined; }; /** @internal */ export type CheckoutSessionWithUrlPaymentMethodCreate$Outbound = { method: "checkout-session"; id: string; external_identifier?: string | null | undefined; buyer_id?: string | null | undefined; buyer_external_identifier?: string | null | undefined; redirect_url?: string | null | undefined; }; /** @internal */ export const CheckoutSessionWithUrlPaymentMethodCreate$outboundSchema: z.ZodType< CheckoutSessionWithUrlPaymentMethodCreate$Outbound, z.ZodTypeDef, CheckoutSessionWithUrlPaymentMethodCreate > = 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(), redirectUrl: z.nullable(z.string()).optional(), }).transform((v) => { return remap$(v, { externalIdentifier: "external_identifier", buyerId: "buyer_id", buyerExternalIdentifier: "buyer_external_identifier", redirectUrl: "redirect_url", }); }); export function checkoutSessionWithUrlPaymentMethodCreateToJSON( checkoutSessionWithUrlPaymentMethodCreate: CheckoutSessionWithUrlPaymentMethodCreate, ): string { return JSON.stringify( CheckoutSessionWithUrlPaymentMethodCreate$outboundSchema.parse( checkoutSessionWithUrlPaymentMethodCreate, ), ); }