@jackiemacklein/nettz-utils
Version:
Serviços de imagem, e-mail, códigos de barras, utilitários numéricos e componentes React para apps Node.js com TypeScript
110 lines (109 loc) • 2.92 kB
TypeScript
/**
* @author Jackiê Macklein
* @company Onside tecnologia/Nettz
* @copyright Todos direitos reservados.
* @description Tipos para integração com APIs do Mercado Pago.
*/
export declare const MERCADOPAGO_DEFAULT_BASE_URL = "https://api.mercadopago.com";
export type MercadoPagoDeviceMode = "PDV" | "STANDALONE";
export interface MercadoPagoClientConfig {
/** Base da API, sem barra final. @default https://api.mercadopago.com */
baseUrl?: string;
timeoutMs?: number;
fetchImpl?: typeof fetch;
/** Credenciais opcionais para métodos OAuth. */
clientId?: string;
clientSecret?: string;
redirectUri?: string;
}
export interface MercadoPagoOAuthTokenRequest {
code: string;
clientId?: string;
clientSecret?: string;
redirectUri?: string;
}
export interface MercadoPagoOAuthRefreshTokenRequest {
refreshToken: string;
clientId?: string;
clientSecret?: string;
}
export interface MercadoPagoAccessToken {
access_token: string;
token_type: string;
expires_in: number;
expires_at: string;
scope: string;
user_id: number;
refresh_token: string;
public_key: string;
live_mode: boolean;
}
export interface MercadoPagoDevice {
id: string;
pos_id: number;
store_id: string | number;
external_pos_id: string;
operating_mode: MercadoPagoDeviceMode;
}
export interface MercadoPagoListDevicesResponse {
devices: MercadoPagoDevice[];
}
export interface MercadoPagoStore {
id: string | number;
name?: string;
[key: string]: unknown;
}
export interface MercadoPagoStoresResponse {
results: MercadoPagoStore[];
}
export interface MercadoPagoPos {
id: string | number;
name?: string;
external_id?: string;
[key: string]: unknown;
}
export interface MercadoPagoPosResponse {
results: MercadoPagoPos[];
}
export interface MercadoPagoPaymentIntent {
id: string;
status?: string;
amount?: number;
description?: string;
payment?: {
type?: string;
installments?: number;
installments_cost?: string;
};
additional_info?: {
external_reference?: string;
print_on_terminal?: boolean;
};
[key: string]: unknown;
}
export interface MercadoPagoCreateDeviceCardPaymentRequest {
amount: number;
description: string;
paymentType?: "debit_card" | "credit_card" | string;
reference: string;
installments?: number;
printOnTerminal?: boolean;
}
export interface MercadoPagoCreatePixPaymentRequest {
amount: number;
description: string;
reference: string;
sponsorId: number;
expirationDate: string;
notificationUrl: string;
}
export interface MercadoPagoMerchantOrdersResponse {
elements?: any[];
[key: string]: unknown;
}
export interface MercadoPagoPaymentDetail {
id: number;
status?: string;
status_detail?: string;
[key: string]: unknown;
}