/* * 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 Google Pay payment with an FPAN. */ export type GooglePayFPANPaymentMethodCreate = { /** * 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 `googlepay_pan_only`. */ method: "googlepay_pan_only"; /** * 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; /** * Expiry of the Google Pay token the PAN was decrypted from, as milliseconds since the epoch. */ messageExpiration?: string | null | undefined; }; /** @internal */ export type GooglePayFPANPaymentMethodCreate$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: "googlepay_pan_only"; redirect_url?: string | null | undefined; security_code?: any | null | undefined; message_expiration?: string | null | undefined; }; /** @internal */ export const GooglePayFPANPaymentMethodCreate$outboundSchema: z.ZodType< GooglePayFPANPaymentMethodCreate$Outbound, z.ZodTypeDef, GooglePayFPANPaymentMethodCreate > = 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("googlepay_pan_only"), redirectUrl: z.nullable(z.string()).optional(), securityCode: z.nullable(z.any()).optional(), messageExpiration: 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", redirectUrl: "redirect_url", securityCode: "security_code", messageExpiration: "message_expiration", }); }); export function googlePayFPANPaymentMethodCreateToJSON( googlePayFPANPaymentMethodCreate: GooglePayFPANPaymentMethodCreate, ): string { return JSON.stringify( GooglePayFPANPaymentMethodCreate$outboundSchema.parse( googlePayFPANPaymentMethodCreate, ), ); }