/* * 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 { AdyenCardAutoRescueScenariosEnum, AdyenCardAutoRescueScenariosEnum$outboundSchema, } from "./adyencardautorescuescenariosenum.js"; import { AdyenSplitsOptions, AdyenSplitsOptions$Outbound, AdyenSplitsOptions$outboundSchema, } from "./adyensplitsoptions.js"; export type AdyenCardOptions = { /** * Set to `true` to enable Auto Rescue for a transaction. Use the `maxDaysToRescue` to specify a rescue window. */ autoRescue?: boolean | null | undefined; /** * The rescue window for a transaction, in days, when `autoRescue` is set to `true`. You can specify a value between 1 and 48. For cards, the default is one calendar month. For SEPA, the default is 42 days. */ maxDaysToRescue?: number | null | undefined; /** * Passes additional data to the Adyen API when creating a transaction. */ additionalData?: { [k: string]: string } | null | undefined; /** * The rescue scenario to simulate for a transaction, when `autoRescue` is set to `true`. */ autoRescueScenario?: AdyenCardAutoRescueScenariosEnum | null | undefined; /** * The origin of the window where the payment is initiated, used for 3D Secure authentication. */ windowOrigin?: string | null | undefined; /** * Passes information of splitting payment amounts to the Adyen API. */ splits?: AdyenSplitsOptions | null | undefined; /** * Passes `merchantRiskIndicator` data to Adyen. */ merchantRiskIndicator?: { [k: string]: any } | null | undefined; /** * Passes `accountInfo` data to Adyen. */ accountInfo?: { [k: string]: any } | null | undefined; /** * Passes `riskData.customFields` to Adyen. */ riskData?: { [k: string]: any } | null | undefined; /** * Passes `threeDS2RequestData.threeDSRequestorChallengeInd` to Adyen. */ threeDSRequestorChallengeInd?: string | null | undefined; /** * Passes `authenticationData.attemptAuthentication` to Adyen. */ attemptAuthentication?: string | null | undefined; }; /** @internal */ export type AdyenCardOptions$Outbound = { autoRescue?: boolean | null | undefined; maxDaysToRescue?: number | null | undefined; additionalData?: { [k: string]: string } | null | undefined; autoRescueScenario?: string | null | undefined; window_origin?: string | null | undefined; splits?: AdyenSplitsOptions$Outbound | null | undefined; merchantRiskIndicator?: { [k: string]: any } | null | undefined; accountInfo?: { [k: string]: any } | null | undefined; riskData?: { [k: string]: any } | null | undefined; threeDSRequestorChallengeInd?: string | null | undefined; attemptAuthentication?: string | null | undefined; }; /** @internal */ export const AdyenCardOptions$outboundSchema: z.ZodType< AdyenCardOptions$Outbound, z.ZodTypeDef, AdyenCardOptions > = z.object({ autoRescue: z.nullable(z.boolean()).optional(), maxDaysToRescue: z.nullable(z.number().int()).optional(), additionalData: z.nullable(z.record(z.string())).optional(), autoRescueScenario: z.nullable( AdyenCardAutoRescueScenariosEnum$outboundSchema, ).optional(), windowOrigin: z.nullable(z.string()).optional(), splits: z.nullable(AdyenSplitsOptions$outboundSchema).optional(), merchantRiskIndicator: z.nullable(z.record(z.any())).optional(), accountInfo: z.nullable(z.record(z.any())).optional(), riskData: z.nullable(z.record(z.any())).optional(), threeDSRequestorChallengeInd: z.nullable(z.string()).optional(), attemptAuthentication: z.nullable(z.string()).optional(), }).transform((v) => { return remap$(v, { windowOrigin: "window_origin", }); }); export function adyenCardOptionsToJSON( adyenCardOptions: AdyenCardOptions, ): string { return JSON.stringify( AdyenCardOptions$outboundSchema.parse(adyenCardOptions), ); }