/* * 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 ThreeDSecureDataV2 = { /** * The cardholder authentication value or AAV. */ cavv: string; /** * The ecommerce indicator for the 3DS transaction. */ eci: string; /** * The version of 3-D Secure that was used. */ version: string; /** * For 3-D Secure version 1, the enrolment response. For 3-D Secure version 2 and above, the transaction status from the `ARes`. */ directoryResponse: string; /** * The scheme/brand of the card that is used for 3-D Secure. */ scheme?: CardScheme | null | undefined; /** * The transaction status after a the 3DS challenge. This will be null in case of a frictionless 3DS flow. */ authenticationResponse?: string | null | undefined; /** * The transaction identifier. */ directoryTransactionId: string; }; /** @internal */ export type ThreeDSecureDataV2$Outbound = { cavv: string; eci: string; version: string; directory_response: string; scheme?: string | null | undefined; authentication_response?: string | null | undefined; directory_transaction_id: string; }; /** @internal */ export const ThreeDSecureDataV2$outboundSchema: z.ZodType< ThreeDSecureDataV2$Outbound, z.ZodTypeDef, ThreeDSecureDataV2 > = z.object({ cavv: z.string(), eci: z.string(), version: z.string(), directoryResponse: z.string(), scheme: z.nullable(CardScheme$outboundSchema).optional(), authenticationResponse: z.nullable(z.string()).optional(), directoryTransactionId: z.string(), }).transform((v) => { return remap$(v, { directoryResponse: "directory_response", authenticationResponse: "authentication_response", directoryTransactionId: "directory_transaction_id", }); }); export function threeDSecureDataV2ToJSON( threeDSecureDataV2: ThreeDSecureDataV2, ): string { return JSON.stringify( ThreeDSecureDataV2$outboundSchema.parse(threeDSecureDataV2), ); }