mds-daraja-sdk
Version:
A simple SDK for integrating with Safaricom's Daraja API for M-Pesa payments.
13 lines (12 loc) • 709 B
TypeScript
export declare class MdsDarajaSdk {
private consumerKey;
private consumerSecret;
private baseUrl;
constructor(consumerKey: string, consumerSecret: string, sandbox?: boolean);
private getAccessToken;
initiateStkPush(businessShortCode: string, password: string, timestamp: string, phoneNumber: string, amount: number, callbackUrl: string): Promise<any>;
reverseTransaction(shortCode: string, password: string, transactionID: string): Promise<any>;
initiateB2cPayment(shortCode: string, password: string, phoneNumber: string, amount: number): Promise<any>;
static generatePassword(businessShortCode: string, passkey: string): string;
static generateTimeStamp(): string;
}