UNPKG

mpp-sdk

Version:

SDK to talk to the Memento Payments Platform

23 lines (22 loc) 814 B
import { AxiosInstance, AxiosRequestConfig } from "axios"; import SessionsEndpoint from "./sessions"; import { MPPConfig } from ".."; import { MPPResult } from "../types/result"; export interface BaseEndpointConfig { config: MPPConfig; http: AxiosInstance; sessions: SessionsEndpoint; } export declare abstract class BaseEndpoint { protected config: MPPConfig; protected http: AxiosInstance; protected sessions: SessionsEndpoint; constructor(config: BaseEndpointConfig); /** * Performs an http request using the provided axios config. * Auto refreshes session token if that setting is enabled and * wraps the response in a MPPResponse. * @param config axios request config */ protected doRequest<T>(config: AxiosRequestConfig): Promise<MPPResult<T>>; }