/* * 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 { MerchantProfileScheme, MerchantProfileScheme$Outbound, MerchantProfileScheme$outboundSchema, } from "./merchantprofilescheme.js"; import { VoidableField, VoidableField$Outbound, VoidableField$outboundSchema, } from "./voidablefield.js"; /** * Request body for updating a Payment Service */ export type PaymentServiceUpdate = { /** * The display name for the payment service. */ displayName?: string | null | undefined; /** * The non-secret credential fields that have been configured for this payment service. Any secret fields are omitted. */ fields?: Array | null | undefined; /** * The non-secret reporting fields that have been configured for this payment service. Any secret fields are omitted. */ reportingFields?: Array | null | undefined; /** * Deprecated field used to define the order in which to process payment services */ position?: number | null | undefined; /** * A list of currencies for which this service is enabled, in ISO 4217 three-letter code format. */ acceptedCurrencies?: Array | null | undefined; /** * A list of countries for which this service is enabled, in ISO two-letter code format. */ acceptedCountries?: Array | null | undefined; /** * Defines if this payment service is currently active. */ active?: boolean | null | undefined; /** * Defines if this payment service has 3DS enabled. */ threeDSecureEnabled?: boolean | null | undefined; /** * An object containing a key for each supported card schemes, and for each key an object with the 3DS profile for this service for that scheme. */ merchantProfile?: | { [k: string]: MerchantProfileScheme | null } | null | undefined; /** * Defines if this payment service support payment method tokenization. */ paymentMethodTokenizationEnabled?: boolean | null | undefined; /** * Defines if this payment service supports network tokens. */ networkTokensEnabled?: boolean | null | undefined; /** * Defines if this payment service is open loop. */ openLoop?: boolean | null | undefined; /** * Defines if this payment service has settlement reporting enabled. */ settlementReportingEnabled?: boolean | undefined; }; /** @internal */ export type PaymentServiceUpdate$Outbound = { display_name?: string | null | undefined; fields?: Array | null | undefined; reporting_fields?: Array | null | undefined; position?: number | null | undefined; accepted_currencies?: Array | null | undefined; accepted_countries?: Array | null | undefined; active?: boolean | null | undefined; three_d_secure_enabled?: boolean | null | undefined; merchant_profile?: | { [k: string]: MerchantProfileScheme$Outbound | null } | null | undefined; payment_method_tokenization_enabled?: boolean | null | undefined; network_tokens_enabled?: boolean | null | undefined; open_loop?: boolean | null | undefined; settlement_reporting_enabled: boolean; }; /** @internal */ export const PaymentServiceUpdate$outboundSchema: z.ZodType< PaymentServiceUpdate$Outbound, z.ZodTypeDef, PaymentServiceUpdate > = z.object({ displayName: z.nullable(z.string()).optional(), fields: z.nullable(z.array(VoidableField$outboundSchema)).optional(), reportingFields: z.nullable(z.array(VoidableField$outboundSchema)).optional(), position: z.nullable(z.number().int()).optional(), acceptedCurrencies: z.nullable(z.array(z.string())).optional(), acceptedCountries: z.nullable(z.array(z.string())).optional(), active: z.nullable(z.boolean()).optional(), threeDSecureEnabled: z.nullable(z.boolean()).optional(), merchantProfile: z.nullable( z.record(z.nullable(MerchantProfileScheme$outboundSchema)), ).optional(), paymentMethodTokenizationEnabled: z.nullable(z.boolean()).optional(), networkTokensEnabled: z.nullable(z.boolean()).optional(), openLoop: z.nullable(z.boolean()).optional(), settlementReportingEnabled: z.boolean().default(false), }).transform((v) => { return remap$(v, { displayName: "display_name", reportingFields: "reporting_fields", acceptedCurrencies: "accepted_currencies", acceptedCountries: "accepted_countries", threeDSecureEnabled: "three_d_secure_enabled", merchantProfile: "merchant_profile", paymentMethodTokenizationEnabled: "payment_method_tokenization_enabled", networkTokensEnabled: "network_tokens_enabled", openLoop: "open_loop", settlementReportingEnabled: "settlement_reporting_enabled", }); }); export function paymentServiceUpdateToJSON( paymentServiceUpdate: PaymentServiceUpdate, ): string { return JSON.stringify( PaymentServiceUpdate$outboundSchema.parse(paymentServiceUpdate), ); }