/** * PayPal Server SDKLib * * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). */ import { array, lazy, object, optional, Schema, string } from '../schema.js'; import { Customer, customerSchema } from './customer.js'; import { LinkDescription, linkDescriptionSchema } from './linkDescription.js'; import { PaymentTokenStatus, paymentTokenStatusSchema, } from './paymentTokenStatus.js'; import { SetupTokenResponsePaymentSource, setupTokenResponsePaymentSourceSchema, } from './setupTokenResponsePaymentSource.js'; /** Minimal representation of a cached setup token. */ export interface SetupTokenResponse { /** The PayPal-generated ID for the vaulted payment source. This ID should be stored on the merchant's server so the saved payment source can be used for future transactions. */ id?: string; /** This object defines a customer in your system. Use it to manage customer profiles, save payment methods and contact details. */ customer?: Customer; /** The status of the payment token. */ status?: PaymentTokenStatus; /** The setup payment method details. */ paymentSource?: SetupTokenResponsePaymentSource; /** An array of related [HATEOAS links](/api/rest/responses/#hateoas). */ links?: LinkDescription[]; } export const setupTokenResponseSchema: Schema = lazy(() => object({ id: ['id', optional(string())], customer: ['customer', optional(customerSchema)], status: ['status', optional(paymentTokenStatusSchema)], paymentSource: [ 'payment_source', optional(setupTokenResponsePaymentSourceSchema), ], links: ['links', optional(array(linkDescriptionSchema))], }) );