npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

vtpassnodejs

v1.0.9

Published

A node package to interact with vtpass apis

Downloads

117

Readme

vtpassnodejs

A Package to interact with vtpass api using nodejs

Vtpass documentation

Response codes

Webook

how to generate request id

#installation You can install the package via npm :

npm install vtpassnodejs

#Usage Please note that for the below examples the classes are initiated in sandbox mode, to intiate the vtpass class in production mode , you will do as shown below

//for production mode
 const vtPassClass = new vtpass('production', 'your username', 'your password');
 
//for test mode
const vtPassClass = new vtpass();
   //recharge airtime
   const vtPassClass = require('vtpassnodejs');
  (async function(){
    const vtPassClass = new vtpass();
	const phone = 08011111111 //this works for test mode 
	const amount = 200;
	const network = 'mtn'; //you can have mtn, airtel, etisalat, glo, smile
	const request_id = 'your unique request id'; // if not passed , one is generated for you automatically by the package
    const buyAirtime = await vtPassClass.airtime.rechargeAirtime(network, amount, phone, variationCode, request_id);
    console.log(buyAirtime);
})();
   //get variation codes for subscriptions for network provider
   const vtPassClass = require('vtpassnodejs');
   (async function(){
    const vtPassClass = new vtpass();
	const provider = 'mtn' //you can have mtn, airtel, etisalat, glo, smile
    const variationCodes = await vtPassClass.data.getVariationCodes('mtn');
    console.log(variationCodes);
})();
   //subscribe data
     const vtPassClass = require('vtpassnodejs');
  (async function(){
    const vtPassClass = new vtpass();
    const variationCode = 'mtn-10mb-100';
    const phone = 08011111111;
    const network = 'mtn'; //you can have mtn, airtel, etisalat, glo, smile
	const request_id = 'your unique request id'; // if not passed , one is generated for you automatically by the package, [how to generate request id] (https://www.vtpass.com/documentation/how-to-generate-request-id/)
    const buyData = await vtPassClass.data.buyData(phone, network, variationCode, request_id);
    console.log(buyData);
})();
   //verify smile phone number
     const vtPassClass = require('vtpassnodejs');
(async function(){
    const vtPassClass = new vtpass();
	const phone = 2348011111111;
    const verifyPhone = await vtPassClass.data.verifySmilePhoneNumber(phone);
    console.log(verifyPhone);
})();
   //verify smile email
     const vtPassClass = require('vtpassnodejs');
(async function(){
    const vtPassClass = new vtpass();
	const email = '[email protected]';
    const verifyEmail = await vtPassClass.data.verifySmileEmail(email);
    console.log(verifyEmail);
})();
   //get variation codes for tvn subscriptions
     const vtPassClass = require('vtpassnodejs');
(async function(){
    const vtPassClass = new vtpass();
	const provider = 'dstv'; //dstv, gotv, startimes
    const varationCodes = await vtPassClass.tv.getVariationCodes(provider);
    console.log(varationCodes);
})();
   //verify smart card number
     const vtPassClass = require('vtpassnodejs');
(async function(){
    const vtPassClass = new vtpass();
    const provider = 'dstv';
    const billersCode = 1212121212;
    const verifySmartCard = await vtPassClass.tv.verifySmartCard(provider, billersCode);
    console.log(verifySmartCard);
})();
   //subscribe tv
     const vtPassClass = require('vtpassnodejs');
(async function(){
    const vtPassClass = new vtpass();
    const smartCard = 1212121212;
    const provider = 'dstv';
    const phone = 08011111111;
    const variationCode = 'dstv-padi';
    const amount = ''; //amount can be empty, if amount is not empty, the account is topped up the amount
	const request_id = 'your unique request id'; // if not passed , one is generated for you automatically by the package
    const verifySmartCard = await vtPassClass.tv.subscribeTv(smartCard, provider, phone, variationCode, amount, request_id);
    console.log(verifySmartCard);
})();
   //verify electricity meter number
     const vtPassClass = require('vtpassnodejs');
(async function(){
    const vtPassClass = new vtpass();
    const provider = 'ikeja-electric';
    const meterNumber = 1111111111111;
    const type = 'prepaid'; //can be prepaid or postpaid
    const verifyMeter = await vtPassClass.electricity.verifyMeterNumber(meterNumber, provider, type)
    console.log(verifyMeter);
})();
   //buy electricity token
     const vtPassClass = require('vtpassnodejs');
(async function(){
    const vtPassClass = new vtpass();
    const provider = 'ikeja-electric'; // ikeja-electric, eko-electric, kano-electric, portharcourt-electric, jos-electric, ibadan-electric, kaduna-electric, abuja-electric
    const meterNumber = 1111111111111;
    const meterType = 'prepaid';
    const amount = 5000;
    const phone = '08011111111';
	const request_id = 'your unique request id'; // if not passed , one is generated for you automatically by the package
    const rechargeLight = await vtPassClass.electricity.rechargeLight(meterNumber, provider, amount, phone, meterType, request_id);
    console.log(rechargeLight);
})();
//get variation codes for educational services 
(async function(){
    const vtPassClass = new vtpass();
	const service = 'waec-registration'; //waec-registration, waec waec-registration is for waec registration, waec option is for result checking service
    const varationCodes = await vtPassClass.educational.getVariationCodes(service);
    console.log(varationCodes);
})();
//purchase token for an educational service
(async function(){
    const vtPassClass = new vtpass();
    const service = 'waec-registration';  //waec-registration, waec waec-registration is for waec registration, waec option is for result checking service
    const amount = 14450; //this is gotten from variation amount on the get variation codes point
    const phone = 08011111111;
    const variation_code = 'waec-registraion'; //this is the variation code gotten from the method above for the service that it belongs 
	const request_id = 'your unique request id'; // if not passed , one is generated for you automatically by the packag
    const registerService = await vtPassClass.educational.registerService(service, amount, phone, variation_code, request_id);
    console.log(registerService);
})();
//requery transaction status
(async function(){
    const vtPassClass = new vtpass();
    const request_id = 'llmOt7lzlOVKQCavfD3U6887';
    const requeryService = await vtPassClass.requeryTransaction(request_id)
    console.log(requeryService);
})();
//get list of banks
(async function(){
    const vtPassClass = new vtpass();
    const banks = await vtPassClass.bank.getVariationCodes();
    console.log(banks);
})();
//verify account number
(async function(){
    const vtPassClass = new vtpass();
    const bank = 'zenith-mobile'; //gotten from bank varation codes
    const accountNumber = 1234567890;
    const bankDetail = await vtPassClass.bank.verifyAccountNumber(bank, accountNumber);
    console.log(bankDetail);
})();
//send money across to banks, please also setup webhooks for this service 
(async function(){
    const vtPassClass = new vtpass();
    const bank = 'zenith-mobile'; //gotten from bank variation codes
    const accountNumber = 1234567890;
    const amount = 100000;
    const phone = '08011111111';
	const request_id = 'your unique request id';
    const deposit = await vtPassClass.bank.deposit(accountNumber, bank, amount, phone, request_id);
    console.log(deposit);
})();

License: ISC