/** * PayPal Server SDKLib * * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). */ import { lazy, object, optional, Schema } from '../schema.js'; import { NetworkTransaction, networkTransactionSchema, } from './networkTransaction.js'; import { PaymentInitiator, paymentInitiatorSchema, } from './paymentInitiator.js'; import { StoredPaymentSourcePaymentType, storedPaymentSourcePaymentTypeSchema, } from './storedPaymentSourcePaymentType.js'; import { StoredPaymentSourceUsageType, storedPaymentSourceUsageTypeSchema, } from './storedPaymentSourceUsageType.js'; /** Provides additional details to process a payment using a `card` that has been stored or is intended to be stored (also referred to as stored_credential or card-on-file). Parameter compatibility: `payment_type=ONE_TIME` is compatible only with `payment_initiator=CUSTOMER`. `usage=FIRST` is compatible only with `payment_initiator=CUSTOMER`. `previous_transaction_reference` or `previous_network_transaction_reference` is compatible only with `payment_initiator=MERCHANT`. Only one of the parameters - `previous_transaction_reference` and `previous_network_transaction_reference` - can be present in the request. */ export interface CardStoredCredential { /** The person or party who initiated or triggered the payment. */ paymentInitiator: PaymentInitiator; /** Indicates the type of the stored payment_source payment. */ paymentType: StoredPaymentSourcePaymentType; /** Indicates if this is a `first` or `subsequent` payment using a stored payment source (also referred to as stored credential or card on file). */ usage?: StoredPaymentSourceUsageType; /** Reference values used by the card network to identify a transaction. */ previousNetworkTransactionReference?: NetworkTransaction; } export const cardStoredCredentialSchema: Schema = lazy( () => object({ paymentInitiator: ['payment_initiator', paymentInitiatorSchema], paymentType: ['payment_type', storedPaymentSourcePaymentTypeSchema], usage: ['usage', optional(storedPaymentSourceUsageTypeSchema)], previousNetworkTransactionReference: [ 'previous_network_transaction_reference', optional(networkTransactionSchema), ], }) );