/** * PagarmeApiSDKLib * * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). */ import { array, boolean, dict, lazy, nullable, number, object, optional, Schema, string, } from '../schema'; import { GetAntifraudResponse, getAntifraudResponseSchema, } from './getAntifraudResponse'; import { GetFineResponse, getFineResponseSchema } from './getFineResponse'; import { GetGatewayResponseResponse, getGatewayResponseResponseSchema, } from './getGatewayResponseResponse'; import { GetInterestResponse, getInterestResponseSchema, } from './getInterestResponse'; import { GetSplitResponse, getSplitResponseSchema } from './getSplitResponse'; /** Generic response object for getting a transaction. */ export interface GetTransactionResponse { /** Gateway transaction id */ gatewayId?: string | null; /** Amount in cents */ amount?: number | null; /** Transaction status */ status?: string | null; /** Indicates if the transaction ocurred successfuly */ success?: boolean | null; /** Creation date */ createdAt?: string | null; /** Last update date */ updatedAt?: string | null; /** Number of attempts tried */ attemptCount?: number | null; /** Max attempts */ maxAttempts?: number | null; /** Splits */ splits?: GetSplitResponse[] | null; /** Date and time of the next attempt */ nextAttempt?: string | null; transactionType?: string; /** Código da transação */ id?: string | null; /** The Gateway Response */ gatewayResponse?: GetGatewayResponseResponse | null; antifraudResponse?: GetAntifraudResponse | null; metadata?: Record | null; split?: GetSplitResponse[] | null; interest?: GetInterestResponse | null; fine?: GetFineResponse | null; maxDaysToPayPastDue?: number | null; } export const getTransactionResponseSchema: Schema = object( { gatewayId: ['gateway_id', optional(nullable(string()))], amount: ['amount', optional(nullable(number()))], status: ['status', optional(nullable(string()))], success: ['success', optional(nullable(boolean()))], createdAt: ['created_at', optional(nullable(string()))], updatedAt: ['updated_at', optional(nullable(string()))], attemptCount: ['attempt_count', optional(nullable(number()))], maxAttempts: ['max_attempts', optional(nullable(number()))], splits: [ 'splits', optional(nullable(array(lazy(() => getSplitResponseSchema)))), ], nextAttempt: ['next_attempt', optional(nullable(string()))], transactionType: ['transaction_type', optional(string())], id: ['id', optional(nullable(string()))], gatewayResponse: [ 'gateway_response', optional(nullable(lazy(() => getGatewayResponseResponseSchema))), ], antifraudResponse: [ 'antifraud_response', optional(nullable(lazy(() => getAntifraudResponseSchema))), ], metadata: ['metadata', optional(nullable(dict(string())))], split: [ 'split', optional(nullable(array(lazy(() => getSplitResponseSchema)))), ], interest: [ 'interest', optional(nullable(lazy(() => getInterestResponseSchema))), ], fine: ['fine', optional(nullable(lazy(() => getFineResponseSchema)))], maxDaysToPayPastDue: [ 'max_days_to_pay_past_due', optional(nullable(number())), ], } );