/** * PayPal Server SDKLib * * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). */ import { boolean, lazy, number, object, optional, Schema } from '../schema.js'; import { Money, moneySchema } from './money.js'; import { SetupFeeFailureAction, setupFeeFailureActionSchema, } from './setupFeeFailureAction.js'; /** The payment preferences for a subscription. */ export interface PaymentPreferences { /** Indicates whether to automatically bill the outstanding amount in the next billing cycle. */ autoBillOutstanding?: boolean; /** The currency and amount for a financial transaction, such as a balance or payment due. */ setupFee?: Money; /** The action to take on the subscription if the initial payment for the setup fails. */ setupFeeFailureAction?: SetupFeeFailureAction; /** The maximum number of payment failures before a subscription is suspended. For example, if `payment_failure_threshold` is `2`, the subscription automatically updates to the `SUSPEND` state if two consecutive payments fail. */ paymentFailureThreshold?: number; } export const paymentPreferencesSchema: Schema = lazy(() => object({ autoBillOutstanding: ['auto_bill_outstanding', optional(boolean())], setupFee: ['setup_fee', optional(moneySchema)], setupFeeFailureAction: [ 'setup_fee_failure_action', optional(setupFeeFailureActionSchema), ], paymentFailureThreshold: ['payment_failure_threshold', optional(number())], }) );