Skip to content

gidkom/ovvar-node

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ovvar

A NodeJS library to interact with ovvar API

 

Installation

yarn add ovvar-node

OR

npm install ovvar-node

Usage

Authentication

Generate an API KEY from the Ovvar dashboard

Setup

import { Voucher } from 'ovvar-node'

const voucher  = new Voucher(process.env.API_KEY);

Generate a new voucher

Simply supply the needed parameters
currency: USD | NGN
value: amount value
channel: email | sms quantity: number of vouchers to generated
recipient_phone: phone number to receive voucher pin
recipient email: email to receive voucher pin

const resp = await voucher.generate({
    currency: 'USD',
    value: 1500,
    channel: 'phone',
    recipient_phone: '2349063079039',
    quantity: 10
});

Validate a voucher

Check if voucher is valid

const resp = await voucher.validate(voucherPin);

Redeem a voucher

const resp = await voucher.redeem(voucherPin);

About

A NodeJS library to interact with ovvar API

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published