/* * 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 { CardType, CardType$outboundSchema } from "./cardtype.js"; export type CardPaymentMethodCreate = { /** * The expiration date of the card, formatted `MM/YY`. */ expirationDate: string; /** * The 13-19 digit number for this card. */ number: string; /** * The external identifier of the buyer to attach the method to. */ buyerExternalIdentifier?: string | null | undefined; /** * The ID of the buyer to attach the method to. */ buyerId?: string | null | undefined; /** * The merchant reference for this payment method. */ externalIdentifier?: string | null | undefined; /** * The type of the card used */ cardType?: CardType | null | undefined; /** * Always `card` */ method?: "card" | undefined; /** * The 3 or 4 digit security code often found on the card. This often referred to as the CVV or CVD. */ securityCode?: string | null | undefined; }; /** @internal */ export type CardPaymentMethodCreate$Outbound = { expiration_date: string; number: string; buyer_external_identifier?: string | null | undefined; buyer_id?: string | null | undefined; external_identifier?: string | null | undefined; card_type?: string | null | undefined; method: "card"; security_code?: string | null | undefined; }; /** @internal */ export const CardPaymentMethodCreate$outboundSchema: z.ZodType< CardPaymentMethodCreate$Outbound, z.ZodTypeDef, CardPaymentMethodCreate > = z.object({ expirationDate: z.string(), number: z.string(), buyerExternalIdentifier: z.nullable(z.string()).optional(), buyerId: z.nullable(z.string()).optional(), externalIdentifier: z.nullable(z.string()).optional(), cardType: z.nullable(CardType$outboundSchema).optional(), method: z.literal("card").default("card" as const), securityCode: z.nullable(z.string()).optional(), }).transform((v) => { return remap$(v, { expirationDate: "expiration_date", buyerExternalIdentifier: "buyer_external_identifier", buyerId: "buyer_id", externalIdentifier: "external_identifier", cardType: "card_type", securityCode: "security_code", }); }); export function cardPaymentMethodCreateToJSON( cardPaymentMethodCreate: CardPaymentMethodCreate, ): string { return JSON.stringify( CardPaymentMethodCreate$outboundSchema.parse(cardPaymentMethodCreate), ); }