/** * PagarmeApiSDKLib * * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). */ import { array, boolean, lazy, number, object, optional, Schema, string, unknown, } from '../schema'; import { CreateAddressRequest, createAddressRequestSchema, } from './createAddressRequest'; import { CreateCheckoutBankTransferRequest, createCheckoutBankTransferRequestSchema, } from './createCheckoutBankTransferRequest'; import { CreateCheckoutBoletoPaymentRequest, createCheckoutBoletoPaymentRequestSchema, } from './createCheckoutBoletoPaymentRequest'; import { CreateCheckoutCreditCardPaymentRequest, createCheckoutCreditCardPaymentRequestSchema, } from './createCheckoutCreditCardPaymentRequest'; import { CreateCheckoutDebitCardPaymentRequest, createCheckoutDebitCardPaymentRequestSchema, } from './createCheckoutDebitCardPaymentRequest'; import { CreateCheckoutPixPaymentRequest, createCheckoutPixPaymentRequestSchema, } from './createCheckoutPixPaymentRequest'; /** Checkout payment request */ export interface CreateCheckoutPaymentRequest { /** Accepted Payment Methods */ acceptedPaymentMethods: string[]; /** Accepted Multi Payment Methods */ acceptedMultiPaymentMethods: unknown[]; /** Success url */ successUrl: string; /** Default payment method */ defaultPaymentMethod?: string; /** Gateway Affiliation Id */ gatewayAffiliationId?: string; /** Credit Card payment request */ creditCard?: CreateCheckoutCreditCardPaymentRequest; /** Debit Card payment request */ debitCard?: CreateCheckoutDebitCardPaymentRequest; /** Boleto payment request */ boleto?: CreateCheckoutBoletoPaymentRequest; /** Customer is editable? */ customerEditable?: boolean; /** Time in minutes for expiration */ expiresIn?: number; /** Skip postpay success screen? */ skipCheckoutSuccessPage: boolean; /** Billing Address is editable? */ billingAddressEditable: boolean; /** Billing Address */ billingAddress: CreateAddressRequest; /** Bank Transfer payment request */ bankTransfer?: CreateCheckoutBankTransferRequest; /** Accepted Brands */ acceptedBrands: string[]; /** Pix payment request */ pix?: CreateCheckoutPixPaymentRequest; } export const createCheckoutPaymentRequestSchema: Schema = object( { acceptedPaymentMethods: ['accepted_payment_methods', array(string())], acceptedMultiPaymentMethods: [ 'accepted_multi_payment_methods', array(unknown()), ], successUrl: ['success_url', string()], defaultPaymentMethod: ['default_payment_method', optional(string())], gatewayAffiliationId: ['gateway_affiliation_id', optional(string())], creditCard: [ 'credit_card', optional(lazy(() => createCheckoutCreditCardPaymentRequestSchema)), ], debitCard: [ 'debit_card', optional(lazy(() => createCheckoutDebitCardPaymentRequestSchema)), ], boleto: [ 'boleto', optional(lazy(() => createCheckoutBoletoPaymentRequestSchema)), ], customerEditable: ['customer_editable', optional(boolean())], expiresIn: ['expires_in', optional(number())], skipCheckoutSuccessPage: ['skip_checkout_success_page', boolean()], billingAddressEditable: ['billing_address_editable', boolean()], billingAddress: ['billing_address', lazy(() => createAddressRequestSchema)], bankTransfer: [ 'bank_transfer', optional(lazy(() => createCheckoutBankTransferRequestSchema)), ], acceptedBrands: ['accepted_brands', array(string())], pix: ['pix', optional(lazy(() => createCheckoutPixPaymentRequestSchema))], } );