/**
 * PayPal Server SDKLib
 *
 * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
 */

import { object, optional, Schema } from '../schema';
import {
  PayeePaymentMethodPreference,
  payeePaymentMethodPreferenceSchema,
} from './payeePaymentMethodPreference';
import {
  StandardEntryClassCode,
  standardEntryClassCodeSchema,
} from './standardEntryClassCode';

/** The customer and merchant payment preferences. */
export interface PaymentMethodPreference {
  /** The merchant-preferred payment methods. */
  payeePreferred?: PayeePaymentMethodPreference;
  /** NACHA (the regulatory body governing the ACH network) requires that API callers (merchants, partners) obtain the consumer’s explicit authorization before initiating a transaction. To stay compliant, you’ll need to make sure that you retain a compliant authorization for each transaction that you originate to the ACH Network using this API. ACH transactions are categorized (using SEC codes) by how you capture authorization from the Receiver (the person whose bank account is being debited or credited). PayPal supports the following SEC codes. */
  standardEntryClassCode?: StandardEntryClassCode;
}

export const paymentMethodPreferenceSchema: Schema<PaymentMethodPreference> = object(
  {
    payeePreferred: [
      'payee_preferred',
      optional(payeePaymentMethodPreferenceSchema),
    ],
    standardEntryClassCode: [
      'standard_entry_class_code',
      optional(standardEntryClassCodeSchema),
    ],
  }
);
