/** * PagarmeApiSDKLib * * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). */ import { discriminatedGetTransactionResponseSchema } from '../models/discriminatedSchemas'; import { dict, lazy, nullable, number, object, optional, Schema, string, } from '../schema'; import { GetCustomerResponse, getCustomerResponseSchema, } from './getCustomerResponse'; import { GetInvoiceResponse, getInvoiceResponseSchema, } from './getInvoiceResponse'; import { GetOrderResponse, getOrderResponseSchema } from './getOrderResponse'; import { GetPaymentOriginResponse, getPaymentOriginResponseSchema, } from './getPaymentOriginResponse'; import { GetTransactionResponse } from './getTransactionResponse'; /** Response object for getting a charge */ export interface GetChargeResponse { id?: string | null; code?: string | null; gatewayId?: string | null; amount?: number | null; status?: string | null; currency?: string | null; paymentMethod?: string | null; dueAt?: string | null; createdAt?: string | null; updatedAt?: string | null; lastTransaction?: GetTransactionResponse | null; invoice?: GetInvoiceResponse | null; order?: GetOrderResponse | null; customer?: GetCustomerResponse | null; metadata?: Record | null; paidAt?: string | null; canceledAt?: string | null; /** Canceled Amount */ canceledAmount?: number | null; /** Paid amount */ paidAmount?: number | null; /** interest and fine paid */ interestAndFinePaid?: number | null; /** Defines whether the card has been used one or more times. */ recurrencyCycle?: string | null; paymentOrigin?: GetPaymentOriginResponse | null; } export const getChargeResponseSchema: Schema = object({ id: ['id', optional(nullable(string()))], code: ['code', optional(nullable(string()))], gatewayId: ['gateway_id', optional(nullable(string()))], amount: ['amount', optional(nullable(number()))], status: ['status', optional(nullable(string()))], currency: ['currency', optional(nullable(string()))], paymentMethod: ['payment_method', optional(nullable(string()))], dueAt: ['due_at', optional(nullable(string()))], createdAt: ['created_at', optional(nullable(string()))], updatedAt: ['updated_at', optional(nullable(string()))], lastTransaction: [ 'last_transaction', optional(nullable(lazy(() => discriminatedGetTransactionResponseSchema))), ], invoice: [ 'invoice', optional(nullable(lazy(() => getInvoiceResponseSchema))), ], order: ['order', optional(nullable(lazy(() => getOrderResponseSchema)))], customer: [ 'customer', optional(nullable(lazy(() => getCustomerResponseSchema))), ], metadata: ['metadata', optional(nullable(dict(string())))], paidAt: ['paid_at', optional(nullable(string()))], canceledAt: ['canceled_at', optional(nullable(string()))], canceledAmount: ['canceled_amount', optional(nullable(number()))], paidAmount: ['paid_amount', optional(nullable(number()))], interestAndFinePaid: ['interest_and_fine_paid', optional(nullable(number()))], recurrencyCycle: ['recurrency_cycle', optional(nullable(string()))], paymentOrigin: [ 'payment_origin', optional(nullable(lazy(() => getPaymentOriginResponseSchema))), ], });