/**
 * Paypal Server SDKLib
 *
 * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
 */

import { object, optional, Schema, string } from '../schema';

/** The customer who approves and pays for the order. The customer is also known as the payer. */
export interface PayerBase {
  /** The internationalized email address.<blockquote><strong>Note:</strong> Up to 64 characters are allowed before and 255 characters are allowed after the <code>@</code> sign. However, the generally accepted maximum length for an email address is 254 characters. The pattern verifies that an unquoted <code>@</code> sign exists.</blockquote> */
  emailAddress?: string;
  /** The account identifier for a PayPal account. */
  payerId?: string;
}

export const payerBaseSchema: Schema<PayerBase> = object({
  emailAddress: ['email_address', optional(string())],
  payerId: ['payer_id', optional(string())],
});
