UNPKG

tabby-web-sdk

Version:

Web merchant custom implementation for Tabby, the app that lets you split your payments in 4.

35 lines (34 loc) 1.11 kB
import { PaymentRequest } from "../types/interface"; /** * A class that provides all the necessary utilities to interact with the Tabby API as a Merchant charging */ export declare class Tabby { private tabbyHost; private apiKey; private merchantCode; /** * Initializes Tabby by setting an API key to communicate with the the Tabby API in order to create sessions. * @param apiKey * @param merchantCode */ initialize(apiKey: string, merchantCode: string): void; /** * Calls the tabby API to create a session and split the payment in 4. * @param payload PaymentRequest * * @see [Referral] https://api-docs.tabby.ai/#operation/postCheckoutSession */ createSession(payload: PaymentRequest): Promise<{ status: string; link: any; paymentId: any; rejection_reason?: undefined; reject_message?: undefined; } | { status: string; rejection_reason: any; reject_message: string; link?: undefined; paymentId?: undefined; }>; }