@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
21 lines (20 loc) • 1.14 kB
TypeScript
/**
* @author Jackiê Macklein
* @company Onside tecnologia/Nettz
* @copyright Todos direitos reservados.
* @description Cliente HTTP para API SuperTEF (listar POS, solicitar e consultar pagamentos).
* Documentação: https://supertef.apidog.io/
*/
import { SuperTefClientConfig, SuperTefListPosParams, SuperTefListPosResponse, SuperTefPaymentDetail, SuperTefPollPaymentOptions, SuperTefRequestPaymentBody } from "./types";
export interface SuperTefClient {
readonly baseUrl: string;
listPos(params?: SuperTefListPosParams): Promise<SuperTefListPosResponse>;
requestPayment(body: SuperTefRequestPaymentBody): Promise<SuperTefPaymentDetail>;
getPaymentByUniqueId(paymentUniqueId: number): Promise<SuperTefPaymentDetail>;
/**
* Consulta o pagamento até status final (Pago ou Cancelado/Erro) ou estourar tentativas.
* Intervalo padrão 4s, conforme recomendação da documentação.
*/
pollPaymentUntilFinal(paymentUniqueId: number, options?: SuperTefPollPaymentOptions): Promise<SuperTefPaymentDetail>;
}
export declare function createSuperTefClient(config: SuperTefClientConfig): SuperTefClient;