1. Go to this page and download the library: Download henryejemuta/php-vtung-vtu 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/ */
henryejemuta / php-vtung-vtu example snippets
use HenryEjemuta\Vtung\Client;
// Option 1: Authenticate with username and password
$client = new Client();
$response = $client->authenticate('your_username', 'your_password');
$token = $response['token'];
// Option 2: Instantiate with existing token
$client = new Client('your_jwt_token');
// $requestId should be a unique identifier for the transaction
$requestId = uniqid();
$result = $client->purchaseAirtime('mtn', '08012345678', 100, $requestId);
print_r($result);
// Get Data Variations
$variations = $client->getDataVariations('mtn');
print_r($variations);
// Purchase Data
$requestId = uniqid();
$result = $client->purchaseData('mtn', '08012345678', 'variation_id', $requestId);
print_r($result);