/* * 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"; /** * Create a Click to Pay payment with an FPAN or virtual PAN */ export type ClickToPayFPANPaymentMethodCreate = { /** * 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; /** * Aways `click-to-pay`. */ method: "click-to-pay"; /** * The URL to redirect a user back to after the complete 3DS in browser. */ redirectUrl?: string | null | undefined; /** * The 3 or 4 digit security code often found on the card. This often referred to as the CVV or CVD. */ securityCode?: any | null | undefined; }; /** @internal */ export type ClickToPayFPANPaymentMethodCreate$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: "click-to-pay"; redirect_url?: string | null | undefined; security_code?: any | null | undefined; }; /** @internal */ export const ClickToPayFPANPaymentMethodCreate$outboundSchema: z.ZodType< ClickToPayFPANPaymentMethodCreate$Outbound, z.ZodTypeDef, ClickToPayFPANPaymentMethodCreate > = 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("click-to-pay"), redirectUrl: z.nullable(z.string()).optional(), securityCode: z.nullable(z.any()).optional(), }).transform((v) => { return remap$(v, { expirationDate: "expiration_date", buyerExternalIdentifier: "buyer_external_identifier", buyerId: "buyer_id", externalIdentifier: "external_identifier", cardType: "card_type", redirectUrl: "redirect_url", securityCode: "security_code", }); }); export function clickToPayFPANPaymentMethodCreateToJSON( clickToPayFPANPaymentMethodCreate: ClickToPayFPANPaymentMethodCreate, ): string { return JSON.stringify( ClickToPayFPANPaymentMethodCreate$outboundSchema.parse( clickToPayFPANPaymentMethodCreate, ), ); }