/* * 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 { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type ThreeDSecureV2 = { version: string; authenticationResponse?: string | null | undefined; directoryResponse?: string | null | undefined; directoryTransactionId?: string | null | undefined; transactionReason?: string | null | undefined; cavv?: string | null | undefined; eci?: string | null | undefined; cardholderInfo?: string | null | undefined; }; /** @internal */ export const ThreeDSecureV2$inboundSchema: z.ZodType< ThreeDSecureV2, z.ZodTypeDef, unknown > = z.object({ version: z.string(), authentication_response: z.nullable(z.string()).optional(), directory_response: z.nullable(z.string()).optional(), directory_transaction_id: z.nullable(z.string()).optional(), transaction_reason: z.nullable(z.string()).optional(), cavv: z.nullable(z.string()).optional(), eci: z.nullable(z.string()).optional(), cardholder_info: z.nullable(z.string()).optional(), }).transform((v) => { return remap$(v, { "authentication_response": "authenticationResponse", "directory_response": "directoryResponse", "directory_transaction_id": "directoryTransactionId", "transaction_reason": "transactionReason", "cardholder_info": "cardholderInfo", }); }); export function threeDSecureV2FromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ThreeDSecureV2$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ThreeDSecureV2' from JSON`, ); }