Sundaybrian / creditinfo-wrapper

Unofficial Credit info Nodejs Api Wrapper

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Credit Info (TZ) API Wrapper for Nodejs (still in beta)

The Unofficial Credit Info Tanzania API wrapper for Nodejs.

Installation

Install via npm (soon enough)

npm i @debugger_supreme/credintinfo

or install a particular beta version

npm install --save @debugger_supreme/creditinfo@0.0.1-beta.0

Configuration

Authentication

Configure your api username and password in .env file as follows

CREDIT_INFO_USERNAME=your_api_username
CREDIT_INFO_PASSWORD=your_api_password

URL

The package config file comes with default API url pointing to production.

CREDIT_INFO_WSDL=https://ws.creditinfo.co.tz/WsReport/v5.39/service.svc?wsdl

To point to test environment set the CREDIT_INFO_WSDL key in your .env file to point to test url given. (See below)

CREDIT_INFO_WSDL=https://wstest.creditinfo.co.tz/WsReport/v5.39/service.svc?wsdl

Remember

  • The WSDL url should end with a ?wsdl suffix, don't forget to add this if you haven't already.
  • You need to first configure correct Authentication details above for your respective environment, as the WSDL url is secured with Basic Auth.

Usage

  1. SearchIndividual Report done
  2. Driving License Report coming soon
  3. Vehicle Report coming soon
  4. Exception Handling coming soon

SearchIndividual

Method SearchIndividualAsync(params) queries client information by FullName | PhoneNumber | IdNumber | IdNumberType

import CreditInfo from "@debugger_supreme/creditinfo";

const client = new CreditInfo({
  username: proces.env.CREDIT_INFO_USERNAME,
  password: process.env.CREDIT_INFO_PASSWORD,
  endpoint:
    "https://wstest.creditinfo.co.tz/WsReport/v5.39/service.svc?singleWSDL",
});

client
  .SearchIndividualAsync({
    query: {
      Parameters: {
        FullName: "Alli Hassan Mwinyi",
      },
    },
  })
  .then(function (results) {
    console.log({ results: results[0] });
  });

VehicleReport

Driving License Report

National Id Report

Exception Handling

TODO

  1. SearchIndividual Report
  2. Driving License Report
  3. Vehicle Report
  4. [ ]Exception Handling

This package is bootstrapped with the help of express-api-starter.

About

Unofficial Credit info Nodejs Api Wrapper

License:MIT License


Languages

Language:TypeScript 81.6%Language:Dockerfile 10.3%Language:Makefile 5.8%Language:JavaScript 2.3%