@nkhind/vivawallet-sdk
Version:
Non-Official VivaWallet API SDK
27 lines (26 loc) • 1.3 kB
TypeScript
import { MethodReturn } from '../types/Methods.types';
import { VivawalletAPIInit, VivawalletISVInit } from '../types/Vivawallet.types';
import VivaSkull from './VivaSkull.class';
declare class VivaAuth extends VivaSkull {
constructor(datas: VivawalletAPIInit);
/** Credentials verification, `throw` error if credentials is not gived ***(required for API calls)*** */
private init;
/**
* Return the VivaWallet API Auth2.0 code from Credentials (needed for API Bearer calls)
* or `null` on request failed
*
* @param basic If `true`, apikey and merchantId will be used instead of clientId and clientSecret
*/
getVivaToken(basic?: boolean): MethodReturn<string | null, 'tokenerror'>;
getVivaBasicToken(): string;
/** Return the code needed for Viva webhooks returns or `null` on request failed */
getVivaWebhookCode(): MethodReturn<string | null, 'webhookerror'>;
}
declare class VivaAuthISV extends VivaSkull {
getVivaToken: typeof VivaAuth.prototype.getVivaToken;
getVivaWebhookCode: typeof VivaAuth.prototype.getVivaWebhookCode;
constructor(datas: VivawalletISVInit);
/** Credentials verification, `throw` error if credentials is not gived ***(required for API calls)*** */
private init;
}
export { VivaAuth, VivaAuthISV };