/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; /** * Processing and pass-through costs that add up to the moovFee. */ export type MoovFeeDetails = { /** * Card scheme fees accrued during authorization and settlement. String type represents dollars with up to 9 decimal place precision. */ cardScheme?: string | undefined; /** * Network interchange fee for Visa, Mastercard, or Discover. String type represents dollars with up to 9 decimal place precision. */ interchange?: string | undefined; /** * Network discount fee for American Express. String type represents dollars with up to 9 decimal place precision. */ discount?: string | undefined; /** * Moov processing fee. String type represents dollars with up to 9 decimal place precision. */ moovProcessing: string; }; /** @internal */ export const MoovFeeDetails$inboundSchema: z.ZodType< MoovFeeDetails, z.ZodTypeDef, unknown > = z.object({ cardScheme: z.string().optional(), interchange: z.string().optional(), discount: z.string().optional(), moovProcessing: z.string(), }); /** @internal */ export type MoovFeeDetails$Outbound = { cardScheme?: string | undefined; interchange?: string | undefined; discount?: string | undefined; moovProcessing: string; }; /** @internal */ export const MoovFeeDetails$outboundSchema: z.ZodType< MoovFeeDetails$Outbound, z.ZodTypeDef, MoovFeeDetails > = z.object({ cardScheme: z.string().optional(), interchange: z.string().optional(), discount: z.string().optional(), moovProcessing: z.string(), }); export function moovFeeDetailsToJSON(moovFeeDetails: MoovFeeDetails): string { return JSON.stringify(MoovFeeDetails$outboundSchema.parse(moovFeeDetails)); } export function moovFeeDetailsFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => MoovFeeDetails$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'MoovFeeDetails' from JSON`, ); }