1. Go to this page and download the library: Download andisiahaan/digiflazz-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/ */
andisiahaan / digiflazz-php example snippets
use AndiSiahaan\Digiflazz\DigiflazzClient;
// Create client with credentials
$client = new DigiflazzClient('your_username', 'your_api_key');
// Check balance
$balance = $client->checkBalance();
print_r($balance);
// Or create from environment variables
$client = DigiflazzClient::fromEnvironment();
$client = DigiflazzClient::fromEnvironment();
use AndiSiahaan\Digiflazz\Config\Configuration;
$config = new Configuration(
username: 'your_username',
apiKey: 'your_api_key',
timeout: 30.0,
verifySsl: true,
);
$client = new DigiflazzClient($config);
$balance = $client->checkBalance();
// or
$balance = $client->balance()->check();
// Prepaid products
$prepaid = $client->priceListPrepaid();
// Postpaid products
$postpaid = $client->priceListPasca();
// With filters
$filtered = $client->priceList()->prepaid([
'category' => 'Pulsa',
'brand' => 'TELKOMSEL',
]);
// Get all at once
$all = $client->priceList()->all();