1.0.5 • Published 1 year ago

transunion v1.0.5

Weekly downloads
7
License
ISC
Repository
github
Last release
1 year ago

Transunion Product Event API

API: Transunion
Country: Kenya
Product: getProduct115

Install

npm install transunion --save

Test

npm test

Basic Usage

//import library
const transunion = require('transunion');

//get data from database or ...
const Username = 'XXXX';
const Password = 'xxxx';
const AUTH_Username = "yyyy"; 
const AUTH_Password = "zzzz"; 
const Code = '1111';
const InfinityCode = 'aaaa';


const Name1 = 'Test Name 1'; // Mandatory //
const Name2 = 'Test Name 2'; // Mandatory //
const Name3 = '';
const NationalId = 'National Id'; // Mandatory, Have Any one //
const PassportNo = ''; // Mandatory, Have Any one //
const AlienID = ''; // Mandatory, Have Any one //
const DOB = '';

const obj = {
    username : Username,
    password : Password,
    auth_username : AUTH_Username,
    auth_password : AUTH_Password,
    code : Code,
    infinity_code : InfinityCode,
    name1 : Name1,
    name2 : Name2,
    name3 : Name3,
    national_id : NationalId,
    passport_no : PassportNo,
    alien_id : AlienID,
    dob : DOB
};

transunion(obj)
.then(res => {
    console.log(res);
})
.catch(err => {
    console.log(err);
});

Expected success ouput

{ 
    type: 'success',
    code: '200',
    message: {'grade' : 'HH', 'credit_score' : '567'}',
    input_request: 'xml request send by us',
    output_responce: 'xml response from transuion end' 
}

Expected error ouput

{ 
    type: 'error',
    code: '402',
    message: 'Required input missing',
    input_request: 'xml request send by us',
    output_responce: 'xml response from transuion end' 
}

Error Code

const errorCode = {
                    101 : 'General Authentication Error',
                    102 : 'Invalid Infinity Code',
                    103 : 'Invalid Authentication Credentials',
                    104 : 'Password expired',
                    106 : 'Access Denied',
                    109 : 'Account locked',
                    200 : 'Product request processed successfully',
                    202 : 'Credit Reference Number not found',
                    203 : 'Multiple Credit Reference Number Found',
                    204 : 'Invalid report reason',
                    209 : 'Invalid Sector ID',
                    301 : 'Insufficient Credit',
                    402 : 'Required input missing',
                    403 : 'General Application Error',
                    404 : 'Service temporarily unavailable',
                    408 : 'Unable to verify National ID' 
                };
1.0.5

1 year ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago