PHP code example of gidkom / ovvar-php

1. Go to this page and download the library: Download gidkom/ovvar-php library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

gidkom / ovvar-php example snippets



Gidkom\Ovvar\Voucher;

$voucher  = new Voucher($apikey);


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


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


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



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