hoshistech-lib
TypeScript icon, indicating that this package has built-in type declarations

2.0.39 • Public • Published

Hoshistech-lib

Library for common files, interfaces and utils used across all hoshistech services

installation

npm i hoshistech-lib

Usage

Payment 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);

KYC Lib

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);

JWT Lib

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)

Readme

Keywords

Package Sidebar

Install

npm i hoshistech-lib

Weekly Downloads

99

Version

2.0.39

License

ISC

Unpacked Size

235 kB

Total Files

123

Last publish

Collaborators

  • hoshistech