/** * 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 { CustomerResponse, customerResponseSchema, } from './customerResponse.js'; import { LinkDescription, linkDescriptionSchema } from './linkDescription.js'; import { PaymentTokenResponsePaymentSource, paymentTokenResponsePaymentSourceSchema, } from './paymentTokenResponsePaymentSource.js'; /** Full representation of a saved payment token. */ export interface PaymentTokenResponse { /** 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; /** Customer in merchant's or partner's system of records. */ customer?: CustomerResponse; /** The vaulted payment method details. */ paymentSource?: PaymentTokenResponsePaymentSource; /** An array of related [HATEOAS links](/api/rest/responses/#hateoas). */ links?: LinkDescription[]; } export const paymentTokenResponseSchema: Schema = lazy( () => object({ id: ['id', optional(string())], customer: ['customer', optional(customerResponseSchema)], paymentSource: [ 'payment_source', optional(paymentTokenResponsePaymentSourceSchema), ], links: ['links', optional(array(linkDescriptionSchema))], }) );