/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { remap as remap$ } from "../../lib/primitives.js"; import { CardScheme, CardScheme$outboundSchema } from "./cardscheme.js"; export type PaymentMethodCard = { /** * Set to `card` to use a new card. */ method?: "card" | undefined; /** * The 13-19 digit number for this card as it can be found on the front of the card. */ number: string; /** * The expiration date of the card, formatted `MM/YY`. */ expirationDate: string; /** * The optional card's network scheme. */ cardScheme?: CardScheme | null | undefined; /** * The merchant identifier for this card. */ externalIdentifier?: string | null | undefined; }; /** @internal */ export type PaymentMethodCard$Outbound = { method: "card"; number: string; expiration_date: string; card_scheme?: string | null | undefined; external_identifier?: string | null | undefined; }; /** @internal */ export const PaymentMethodCard$outboundSchema: z.ZodType< PaymentMethodCard$Outbound, z.ZodTypeDef, PaymentMethodCard > = z.object({ method: z.literal("card").default("card" as const), number: z.string(), expirationDate: z.string(), cardScheme: z.nullable(CardScheme$outboundSchema).optional(), externalIdentifier: z.nullable(z.string()).optional(), }).transform((v) => { return remap$(v, { expirationDate: "expiration_date", cardScheme: "card_scheme", externalIdentifier: "external_identifier", }); }); export function paymentMethodCardToJSON( paymentMethodCard: PaymentMethodCard, ): string { return JSON.stringify( PaymentMethodCard$outboundSchema.parse(paymentMethodCard), ); }