/** * PayPal Server SDKLib * * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). */ import { array, lazy, object, optional, Schema } from '../schema.js'; import { AuthorizationWithAdditionalData, authorizationWithAdditionalDataSchema, } from './authorizationWithAdditionalData.js'; import { OrdersCapture, ordersCaptureSchema } from './ordersCapture.js'; import { Refund, refundSchema } from './refund.js'; /** The collection of payments, or transactions, for a purchase unit in an order. For example, authorized payments, captured payments, and refunds. */ export interface PaymentCollection { /** An array of authorized payments for a purchase unit. A purchase unit can have zero or more authorized payments. */ authorizations?: AuthorizationWithAdditionalData[]; /** An array of captured payments for a purchase unit. A purchase unit can have zero or more captured payments. */ captures?: OrdersCapture[]; /** An array of refunds for a purchase unit. A purchase unit can have zero or more refunds. */ refunds?: Refund[]; } export const paymentCollectionSchema: Schema = lazy(() => object({ authorizations: [ 'authorizations', optional(array(authorizationWithAdditionalDataSchema)), ], captures: ['captures', optional(array(ordersCaptureSchema))], refunds: ['refunds', optional(array(refundSchema))], }) );