/* * 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"; import { CardScheme, CardScheme$inboundSchema } from "./cardscheme.js"; export type MerchantAccountThreeDSConfiguration = { /** * Acquirer BIN to use when calling 3DS through this scheme. */ merchantAcquirerBin: string; /** * Merchant ID to use when calling 3DS through this scheme. */ merchantAcquirerId: string; merchantName: string; /** * The merchant's ISO 3166-1 numeric country code. */ merchantCountryCode: string; /** * Merchant category code to use when calling 3DS through this scheme. */ merchantCategoryCode: string; /** * URL to send when calling 3DS through this scheme. */ merchantUrl: string; /** * Always `merchant-account.three-ds-configuration`. */ type: "merchant-account.three-ds-configuration"; /** * Unique identifier for the 3DS configuration */ id: string; /** * ID of the associated merchant account */ merchantAccountId: string; /** * The date and time when this 3DS configuration was first created in our system. */ createdAt: Date; /** * The date and time when this 3DS configuration was last updated in our system. */ updatedAt: Date; scheme: CardScheme; /** * ISO 4217 currency code (3 characters). If null, the configuration applies to all currencies. */ currency: string | null; /** * Additional information about the 3DS configuration, stored as key-value pairs. */ metadata: { [k: string]: string }; }; /** @internal */ export const MerchantAccountThreeDSConfiguration$inboundSchema: z.ZodType< MerchantAccountThreeDSConfiguration, z.ZodTypeDef, unknown > = z.object({ merchant_acquirer_bin: z.string(), merchant_acquirer_id: z.string(), merchant_name: z.string(), merchant_country_code: z.string(), merchant_category_code: z.string(), merchant_url: z.string(), type: z.literal("merchant-account.three-ds-configuration").default( "merchant-account.three-ds-configuration", ), id: z.string(), merchant_account_id: z.string(), created_at: z.string().datetime({ offset: true }).transform(v => new Date(v)), updated_at: z.string().datetime({ offset: true }).transform(v => new Date(v)), scheme: CardScheme$inboundSchema, currency: z.nullable(z.string()), metadata: z.record(z.string()), }).transform((v) => { return remap$(v, { "merchant_acquirer_bin": "merchantAcquirerBin", "merchant_acquirer_id": "merchantAcquirerId", "merchant_name": "merchantName", "merchant_country_code": "merchantCountryCode", "merchant_category_code": "merchantCategoryCode", "merchant_url": "merchantUrl", "merchant_account_id": "merchantAccountId", "created_at": "createdAt", "updated_at": "updatedAt", }); }); export function merchantAccountThreeDSConfigurationFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => MerchantAccountThreeDSConfiguration$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'MerchantAccountThreeDSConfiguration' from JSON`, ); }