PHPackages                             gonon/laravel-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/laravel-digiflazz

ActiveLibrary[API Development](/categories/api)

gonon/laravel-digiflazz
=======================

Laravel integration for the Gonon Digiflazz SDK

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

Since Jul 9Pushed 1mo agoCompare

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

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

Laravel Digiflazz
=================

[](#laravel-digiflazz)

[![Build Status](https://github.com/GononLabs/laravel-digiflazz/actions/workflows/tests.yml/badge.svg)](https://github.com/GononLabs/laravel-digiflazz/actions)[![PHP Version](https://camo.githubusercontent.com/40aa623995586087ec2a3aa9fe039d8b67c222328ba025989cd12f2da80045dc/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f676f6e6f6e2f6c61726176656c2d64696769666c617a7a2e737667)](https://packagist.org/packages/gonon/laravel-digiflazz)[![Latest Version](https://camo.githubusercontent.com/364a1eae020ee4b0573772310a1c16203db5293880fb0fdcb461c788a67dd734/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f676f6e6f6e2f6c61726176656c2d64696769666c617a7a2e737667)](https://packagist.org/packages/gonon/laravel-digiflazz)[![License](https://camo.githubusercontent.com/cc4361e531561597b2bb30a9c90fffd90e1e33e708c25e3ff74167513a3e0169/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f676f6e6f6e2f6c61726176656c2d64696769666c617a7a2e737667)](https://packagist.org/packages/gonon/laravel-digiflazz)

An elegant, idiomatic Laravel integration for the official Gonon Digiflazz PHP SDK.

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

[](#requirements)

- PHP 8.2+
- Laravel 11+
- gonon/digiflazz ^1.0

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

[](#installation)

```
composer require gonon/laravel-digiflazz
```

Configuration
-------------

[](#configuration)

Publish the configuration file to your application:

```
php artisan vendor:publish --tag="digiflazz-config"
```

or

```
php artisan vendor:publish --provider="Gonon\Digiflazz\Laravel\DigiflazzServiceProvider"
```

This will create a `config/digiflazz.php` file in your application where you can customize the default settings.

Next, set up your `.env` with the credentials from your Digiflazz Dashboard:

```
DIGIFLAZZ_USERNAME=your_username
DIGIFLAZZ_API_KEY=your_api_key
DIGIFLAZZ_PRODUCTION=false # Set to true for production
```

Usage (Facade)
--------------

[](#usage-facade)

The package provides an expressive `Digiflazz` facade that hooks directly into the underlying SDK. It handles all authentication and configuration seamlessly.

First, ensure you import the facade and necessary DTOs at the top of your classes:

```
use Gonon\Digiflazz\Laravel\Facades\Digiflazz;
```

### 1. Balance &amp; Deposit

[](#1-balance--deposit)

Check your account balance and request deposit instructions.

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

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

// Request a Deposit Ticket
$request = new DepositRequest(
    amount: 1000000,
    bank: 'BCA',
    ownerName: 'John Doe'
);
$deposit = Digiflazz::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 for Prepaid and Postpaid.

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

// Fetch all postpaid products
$postpaidProducts = Digiflazz::products()->getPostpaid();

// Fetch available categories
$prepaidCategories = Digiflazz::products()->getPrepaidCategories();

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

### 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 = Digiflazz::prepaid()->topup($topupRequest);
echo $transaction->status; // 'Pending' or 'Sukses'

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

### 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 = Digiflazz::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 = Digiflazz::postpaid()->pay($payRequest);
echo $payment->status; // 'Sukses'

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

### 5. Webhooks

[](#5-webhooks)

Digiflazz sends callbacks for transaction updates. The SDK securely parses and verifies the payload signature automatically. *Note: Make sure your `DIGIFLAZZ_WEBHOOK_SECRET` is set in your `.env`.*

```
use Illuminate\Http\Request;
use Gonon\Digiflazz\Exceptions\WebhookException;
use Gonon\Digiflazz\Laravel\Facades\Digiflazz;

public function handleWebhook(Request $request)
{
    $rawBody = $request->getContent();
    $signature = $request->header('X-Hub-Signature') ?? '';

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

        if ($webhookData->status === 'Sukses') {
            // Update order status in your database
        }

        return response()->json(['success' => true]);

    } catch (WebhookException $e) {
        abort(400, 'Invalid Webhook Signature: ' . $e->getMessage());
    }
}
```

Advanced: Dependency Injection &amp; Container
----------------------------------------------

[](#advanced-dependency-injection--container)

If you prefer passing the client via Dependency Injection instead of using the static Facade, the `DigiflazzClient` is automatically bound to the Service Container as a singleton.

```
use Gonon\Digiflazz\Client\DigiflazzClient;

class DigiflazzController extends Controller
{
    public function __construct(
        private readonly DigiflazzClient $digiflazz
    ) {}

    public function index()
    {
        $products = $this->digiflazz->products()->getPrepaid();
    }
}
```

You can also resolve the client manually using the `app()` helper anywhere in your application:

```
$digiflazz = app(\Gonon\Digiflazz\Client\DigiflazzClient::class);
// or via the bound alias
$digiflazz = app('digiflazz');
```

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.

###  Health Score

38

—

LowBetter than 83% of packages

Maintenance90

Actively maintained with recent releases

Popularity1

Limited adoption so far

Community6

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 (1 commits)")

---

Tags

digiflazzlaravelpayment-gatewayphpppobpulsasdklaravelsdkdigiflazzppobpulsa

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StyleLaravel Pint

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[defstudio/telegraph

A laravel facade to interact with Telegram Bots

818355.4k3](/packages/defstudio-telegraph)[simplestats-io/laravel-client

Server-side analytics for Laravel that follows the full funnel from visit to registration to payment, attributed to the channel that drove it. Revenue, MRR, churn and ad-spend profit (ROAS/CAC) per channel. GDPR compliant, ad-blocker proof.

5226.7k](/packages/simplestats-io-laravel-client)

PHPackages © 2026

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