/** * PayPal Server SDKLib * * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). */ import { lazy, object, optional, Schema, string } from '../schema.js'; import { ApplicationContextUserAction, applicationContextUserActionSchema, } from './applicationContextUserAction.js'; import { ExperienceContextShippingPreference, experienceContextShippingPreferenceSchema, } from './experienceContextShippingPreference.js'; import { PaymentMethod, paymentMethodSchema } from './paymentMethod.js'; /** The application context, which customizes the payer experience during the subscription approval process with PayPal. */ export interface SubscriptionApplicationContext { /** The label that overrides the business name in the PayPal account on the PayPal site. */ brandName?: string; /** The BCP 47-formatted locale of pages that the PayPal payment experience shows. PayPal supports a five-character code. For example, `da-DK`, `he-IL`, `id-ID`, `ja-JP`, `no-NO`, `pt-BR`, `ru-RU`, `sv-SE`, `th-TH`, `zh-CN`, `zh-HK`, or `zh-TW`. */ locale?: string; /** The location from which the shipping address is derived. */ shippingPreference?: ExperienceContextShippingPreference; /** Configures the label name to `Continue` or `Subscribe Now` for subscription consent experience. */ userAction?: ApplicationContextUserAction; /** The customer and merchant payment preferences. */ paymentMethod?: PaymentMethod; /** The URL where the customer is redirected after the customer approves the payment. */ returnUrl: string; /** The URL where the customer is redirected after the customer cancels the payment. */ cancelUrl: string; } export const subscriptionApplicationContextSchema: Schema = lazy( () => object({ brandName: ['brand_name', optional(string())], locale: ['locale', optional(string())], shippingPreference: [ 'shipping_preference', optional(experienceContextShippingPreferenceSchema), ], userAction: ['user_action', optional(applicationContextUserActionSchema)], paymentMethod: ['payment_method', optional(paymentMethodSchema)], returnUrl: ['return_url', string()], cancelUrl: ['cancel_url', string()], }) );