PHPackages                             gonon/digiflazz - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. gonon/digiflazz

ActiveLibrary[API Development](/categories/api)

gonon/digiflazz
===============

Digiflazz SDK for the Gonon ecosystem

1.0.0(1mo ago)1231MITPHPPHP ^8.2CI passing

Since Jul 9Pushed 1mo agoCompare

[ Source](https://github.com/GononLabs/digiflazz)[ Packagist](https://packagist.org/packages/gonon/digiflazz)[ Docs](https://github.com/GononLabs/digiflazz)[ RSS](/packages/gonon-digiflazz/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (1)Dependencies (6)Versions (2)Used By (1)

Gonon Digiflazz SDK
===================

[](#gonon-digiflazz-sdk)

[![Latest Version on Packagist](https://camo.githubusercontent.com/5eec9b46c07c6df8be208c42c82c32abbb7c28df71e08bdc4f5573dac88fa43c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f676f6e6f6e2f64696769666c617a7a2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/gonon/digiflazz)[![GitHub Tests Action Status](https://camo.githubusercontent.com/4d2c167b168676b35acbc525efd20d22fa93287af30b5f85e610e353c0ce7b91/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f476f6e6f6e4c6162732f64696769666c617a7a2f74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/GononLabs/digiflazz/actions?query=workflow%3Atests+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/3c9943003ed2d5cef5f22590606644fd01bf8c501e108d983920d15ad9a02bff/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f676f6e6f6e2f64696769666c617a7a2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/gonon/digiflazz)[![License](https://camo.githubusercontent.com/fc65099cb6bfb761aff7905f854e498b659a75f7dbca9a5f67ead40b2f5fba77/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f676f6e6f6e2f64696769666c617a7a2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/gonon/digiflazz)

A framework-agnostic PHP SDK for the [Digiflazz API](https://api.digiflazz.com/), built for the Gonon ecosystem.

Requirements
------------

[](#requirements)

- PHP 8.2 or higher
- `gonon/core` package
- `gonon/http-symfony` (or any PSR-18 compliant HTTP client adapter supported by Gonon Core)

Installation
------------

[](#installation)

```
composer require gonon/digiflazz
```

Basic Configuration
-------------------

[](#basic-configuration)

To start using the SDK, you need to configure the `DigiflazzClient`. This SDK utilizes `Gonon\Core\Http\Client` for robust, abstracted HTTP communication.

```
use Gonon\Core\Configuration\Environment;
use Gonon\Core\Http\Client;
use Gonon\Digiflazz\Authentication\DigiflazzAuthenticator;
use Gonon\Digiflazz\Client\DigiflazzClient;
use Gonon\Digiflazz\Config\DigiflazzConfig;
use Gonon\Http\Symfony\SymfonyClientAdapter;

$config = new DigiflazzConfig(
    username: 'YOUR_USERNAME',
    apiKey: 'YOUR_API_KEY',
    webhookSecret: 'YOUR_WEBHOOK_SECRET', // Optional, needed for webhook validation
    environment: Environment::Production // or Environment::Sandbox
);

$client = new DigiflazzClient($config);
```

Usage
-----

[](#usage)

### 1. Balance &amp; Deposit

[](#1-balance--deposit)

You can check your Digiflazz account balance and request deposit instructions.

```
use Gonon\Digiflazz\DTO\Requests\DepositRequest;

// Check Balance
$balance = $client->balance()->check();
echo "Your balance is: " . $balance->deposit;

// Request a Deposit Ticket
$request = new DepositRequest(
    amount: 1000000,
    bank: 'BCA',
    ownerName: 'John Doe'
);
$deposit = $client->balance()->deposit($request);

echo "Transfer exactly {$deposit->amount} to {$deposit->bank} ({$deposit->accountNo})";
```

### 2. Products (Price List)

[](#2-products-price-list)

Fetch products, categories, or brands separately for Prepaid and Postpaid.

```
// Fetch all prepaid products
$prepaidProducts = $client->products()->getPrepaid();
foreach ($prepaidProducts as $product) {
    echo $product->productName . ' - Rp ' . $product->price . "\n";
}

// Fetch all postpaid products
$postpaidProducts = $client->products()->getPostpaid();
foreach ($postpaidProducts as $product) {
    echo $product->productName . ' - Admin: ' . $product->admin . "\n";
}

// Fetch available categories
$prepaidCategories = $client->products()->getPrepaidCategories();
$postpaidCategories = $client->products()->getPostpaidCategories();

// Fetch available brands under a specific category
$prepaidBrands = $client->products()->getPrepaidBrands(category: 'Pulsa');
$postpaidBrands = $client->products()->getPostpaidBrands(category: 'PLN');
```

### 3. Prepaid Transactions (Topup)

[](#3-prepaid-transactions-topup)

Topup prepaid products (e.g., Pulsa, Data, Token PLN).

```
use Gonon\Digiflazz\DTO\Requests\PrepaidTopupRequest;
use Gonon\Digiflazz\DTO\Requests\TransactionStatusRequest;

// Create Topup
$topupRequest = new PrepaidTopupRequest(
    buyerSkuCode: 'xld10',
    customerNo: '087800001233',
    refId: 'INV-12345'
);
$transaction = $client->prepaid()->topup($topupRequest);
echo $transaction->status; // 'Pending' or 'Sukses'

// Check Topup Status
$statusRequest = new TransactionStatusRequest(
    buyerSkuCode: 'xld10',
    customerNo: '087800001233',
    refId: 'INV-12345'
);
$status = $client->prepaid()->status($statusRequest);
echo $status->sn; // Serial Number
```

### 4. Postpaid Transactions (PPOB)

[](#4-postpaid-transactions-ppob)

Postpaid transactions require two steps: Inquiry and Payment.

```
use Gonon\Digiflazz\DTO\Requests\PostpaidInquiryRequest;
use Gonon\Digiflazz\DTO\Requests\PostpaidPaymentRequest;
use Gonon\Digiflazz\DTO\Requests\TransactionStatusRequest;

// Step 1: Inquiry (Check the bill)
$inquiryRequest = new PostpaidInquiryRequest(
    buyerSkuCode: 'pln',
    customerNo: '530000000003',
    refId: 'INV-POST-123'
);
$inquiry = $client->postpaid()->inquiry($inquiryRequest);

echo "Your bill is: " . $inquiry->sellingPrice;

// Step 2: Pay (Using the tr_id from Inquiry)
$payRequest = new PostpaidPaymentRequest(
    trId: $inquiry->trId
);
$payment = $client->postpaid()->pay($payRequest);
echo $payment->status; // 'Sukses'

// Check Postpaid Status
$statusRequest = new TransactionStatusRequest(
    buyerSkuCode: 'pln',
    customerNo: '530000000003',
    refId: 'INV-POST-123'
);
$status = $client->postpaid()->status($statusRequest);
```

### 5. Webhooks

[](#5-webhooks)

Digiflazz sends callbacks for transaction updates. The SDK securely parses and verifies the payload signature automatically using your `webhookSecret`.

```
use Gonon\Digiflazz\Exceptions\WebhookException;

$rawBody = file_get_contents('php://input'); // The raw JSON body
$signature = $_SERVER['HTTP_X_HUB_SIGNATURE'] ?? ''; // Digiflazz signature header

try {
    $webhookData = $client->webhook()->process($rawBody, $signature);

    echo "Update for Ref ID: " . $webhookData->refId;
    echo "New Status: " . $webhookData->status;
    echo "SN: " . $webhookData->sn;

} catch (WebhookException $e) {
    http_response_code(400);
    echo "Invalid Webhook: " . $e->getMessage();
}
```

Exceptions
----------

[](#exceptions)

The SDK throws strictly typed exceptions that extend `Gonon\Core\Exceptions\GononException`.

- `Gonon\Digiflazz\Exceptions\DigiflazzException`: Base exception.
- `Gonon\Digiflazz\Exceptions\TransactionException`: Thrown on invalid transaction responses.
- `Gonon\Digiflazz\Exceptions\WebhookException`: Thrown when a webhook signature is invalid or parsing fails.
- `InvalidArgumentException`: Thrown directly by Request DTO constructors when missing required parameters.

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE) for more information.

###  Health Score

40

—

FairBetter than 86% of packages

Maintenance90

Actively maintained with recent releases

Popularity9

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity46

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

47d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/fc64e00ab72c1b78f5ada3b983c7ee69701b71dd3c79c800235c810412037600?d=identicon)[nurfaizfy](/maintainers/nurfaizfy)

---

Top Contributors

[![nurfaizfy](https://avatars.githubusercontent.com/u/36664080?v=4)](https://github.com/nurfaizfy "nurfaizfy (2 commits)")

---

Tags

digiflazzpayment-gatewayphp-sdkppobpulsa-apiapisdkpaymentdigiflazzppobpulsagonon

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StyleLaravel Pint

Type Coverage Yes

### Embed Badge

![Health badge](/badges/gonon-digiflazz/health.svg)

```
[![Health](https://phpackages.com/badges/gonon-digiflazz/health.svg)](https://phpackages.com/packages/gonon-digiflazz)
```

###  Alternatives

[algolia/algoliasearch-client-php

API powering the features of Algolia.

69735.8M179](/packages/algolia-algoliasearch-client-php)[temporal/sdk

Temporal SDK

4163.2M27](/packages/temporal-sdk)[api-platform/metadata

API Resource-oriented metadata attributes and factories

275.5M254](/packages/api-platform-metadata)[comgate/sdk

Comgate PHP SDK

13388.6k](/packages/comgate-sdk)[webit/w-firma-api

wFirma.pl API

1922.6k](/packages/webit-w-firma-api)[bushlanov-dev/max-bot-api-client-php

Max Bot API Client library

488.7k](/packages/bushlanov-dev-max-bot-api-client-php)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
