Library for common files, interfaces and utils used across all hoshistech services
npm i hoshistech-lib
import { Payment } from 'hoshistech-lib';
const clientId = 'DcjminXDRy8CQQy'
const client = new Payment(clientId);
const dto = {
amount: 28,
identifier: '1',
currency: 'USD',
phone_number: '',
email: 'opemipo@test.com',
client_reference: '0992333444455555666666777773000000000',
};
const actual = await client.paymentLink(dto);
import { KYC } from 'hoshistech-lib';
const baseUrl = 'https://hoshistech-verification.com'
const kyc = new KYC(baseUrl);
const requestPayload = {
first_name: John;
last_name: Doe;
dob: 2023-01-11;
bvn: 267863466778;
account_number: 2278634667;
bank_code: 057;
};
const result = await kyc.VerifyBVN(requestPayload);
import { JwtUtil } from '../src/util';
const client = new JwtUtil('secret', '500y');
const result = await client.generateToken({ id: '47589q9399', });
console.log("result", result)
const token = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjQ3NTg5cTkzOTkiLCJpYXQiOjE2OTU4MjMwMTksImV4cCI6MTc0NzQ2MjMwMTl9.gUwK3Pu_i17o_EXtyAb_p2pE_CoYudWIfbGGkwdEIIU';
const result = await client.verifyToken(token);
console.log("result", result)