/* * 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 { CardType, CardType$inboundSchema } from "./cardtype.js"; export type CheckoutSessionPaymentMethodDetails = { /** * The first 6 digit of the card. */ bin?: string | null | undefined; /** * The country of the card issuer. */ cardCountry?: string | null | undefined; /** * The payment scheme of the card. */ cardType?: CardType | null | undefined; /** * The card issuer. */ cardIssuerName?: string | null | undefined; }; /** @internal */ export const CheckoutSessionPaymentMethodDetails$inboundSchema: z.ZodType< CheckoutSessionPaymentMethodDetails, z.ZodTypeDef, unknown > = z.object({ bin: z.nullable(z.string()).optional(), card_country: z.nullable(z.string()).optional(), card_type: z.nullable(CardType$inboundSchema).optional(), card_issuer_name: z.nullable(z.string()).optional(), }).transform((v) => { return remap$(v, { "card_country": "cardCountry", "card_type": "cardType", "card_issuer_name": "cardIssuerName", }); }); export function checkoutSessionPaymentMethodDetailsFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => CheckoutSessionPaymentMethodDetails$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CheckoutSessionPaymentMethodDetails' from JSON`, ); }