Skip to content

gidkom/ovvar-php

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ovvar

A PHP library to interact with ovvar API

 

Installation

With Composer

composer require gidkom/ovvar-php

REQUIREMENTS

  • PHP 5.4+

Usage

Authentication

Generate an API KEY from the Ovvar dashboard

Setup

<?php
include "vendor/autoload.php";

use Gidkom\Ovvar\Voucher;

$voucher  = new Voucher($apikey);

Generate a new voucher

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

<?php
$resp = $voucher->generate([
    'currency' => 'USD',
    'value' => 1500,
    'channel' => 'phone',
    'recipient_phone' => '2349063079039',
    'quantity' => 10
]);

Validate a voucher

Check if voucher is valid

<?php
$voucherPin = '12345876';
$resp = $voucher->validate($voucherPin);

Redeem a voucher

Redeem voucher

<?php
$voucherPin = '12345876';
$resp = $voucher->redeem($voucherPin);

Response format

<?php
# Check result if command is succesful
if($result['status']) {
    # Display result
    print_r($result['data']);
} else {
    # Something went wrong
    echo 'Error: ';
    echo $result['message'];
}

About

A PHP library to interact with ovvar API

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages