/* * 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"; import { BillingCountAndAmount, BillingCountAndAmount$inboundSchema, BillingCountAndAmount$Outbound, BillingCountAndAmount$outboundSchema, } from "./billingcountandamount.js"; /** * A detailed breakdown of instant payment fees. */ export type InstantPaymentFees = { /** * Fees for RTP credit transactions. */ rtpCreditTransaction: BillingCountAndAmount; /** * Fees for RTP declines. */ rtpDecline?: BillingCountAndAmount | undefined; /** * Fees for push-to-card transactions. */ pushToCardTransaction: BillingCountAndAmount; /** * Fees for push-to-card declines. */ pushToCardDecline?: BillingCountAndAmount | undefined; /** * Fees for pull-from-card transactions. */ pullFromCardTransaction: BillingCountAndAmount; /** * Fees for pull-from-card declines. */ pullFromCardDecline?: BillingCountAndAmount | undefined; /** * Fees for pull-from-card refunds. */ pullFromCardRefund?: BillingCountAndAmount | undefined; /** * Fees for instant payment verifications. */ instantVerification: BillingCountAndAmount; /** * Total instant payment fees. */ total: BillingCountAndAmount; }; /** @internal */ export const InstantPaymentFees$inboundSchema: z.ZodType< InstantPaymentFees, z.ZodTypeDef, unknown > = z.object({ rtpCreditTransaction: BillingCountAndAmount$inboundSchema, rtpDecline: BillingCountAndAmount$inboundSchema.optional(), pushToCardTransaction: BillingCountAndAmount$inboundSchema, pushToCardDecline: BillingCountAndAmount$inboundSchema.optional(), pullFromCardTransaction: BillingCountAndAmount$inboundSchema, pullFromCardDecline: BillingCountAndAmount$inboundSchema.optional(), pullFromCardRefund: BillingCountAndAmount$inboundSchema.optional(), instantVerification: BillingCountAndAmount$inboundSchema, total: BillingCountAndAmount$inboundSchema, }); /** @internal */ export type InstantPaymentFees$Outbound = { rtpCreditTransaction: BillingCountAndAmount$Outbound; rtpDecline?: BillingCountAndAmount$Outbound | undefined; pushToCardTransaction: BillingCountAndAmount$Outbound; pushToCardDecline?: BillingCountAndAmount$Outbound | undefined; pullFromCardTransaction: BillingCountAndAmount$Outbound; pullFromCardDecline?: BillingCountAndAmount$Outbound | undefined; pullFromCardRefund?: BillingCountAndAmount$Outbound | undefined; instantVerification: BillingCountAndAmount$Outbound; total: BillingCountAndAmount$Outbound; }; /** @internal */ export const InstantPaymentFees$outboundSchema: z.ZodType< InstantPaymentFees$Outbound, z.ZodTypeDef, InstantPaymentFees > = z.object({ rtpCreditTransaction: BillingCountAndAmount$outboundSchema, rtpDecline: BillingCountAndAmount$outboundSchema.optional(), pushToCardTransaction: BillingCountAndAmount$outboundSchema, pushToCardDecline: BillingCountAndAmount$outboundSchema.optional(), pullFromCardTransaction: BillingCountAndAmount$outboundSchema, pullFromCardDecline: BillingCountAndAmount$outboundSchema.optional(), pullFromCardRefund: BillingCountAndAmount$outboundSchema.optional(), instantVerification: BillingCountAndAmount$outboundSchema, total: BillingCountAndAmount$outboundSchema, }); export function instantPaymentFeesToJSON( instantPaymentFees: InstantPaymentFees, ): string { return JSON.stringify( InstantPaymentFees$outboundSchema.parse(instantPaymentFees), ); } export function instantPaymentFeesFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => InstantPaymentFees$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'InstantPaymentFees' from JSON`, ); }