PHPackages                             andisiahaan/digiflazz-php - 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. [Payment Processing](/categories/payments)
4. /
5. andisiahaan/digiflazz-php

ActiveLibrary[Payment Processing](/categories/payments)

andisiahaan/digiflazz-php
=========================

Modern PHP client for Digiflazz API - Prepaid, Postpaid, PLN, and more

1.2.0(6mo ago)13MITPHPPHP ^8.1CI failing

Since Aug 15Pushed 6mo agoCompare

[ Source](https://github.com/andisiahaan/digiflazz-php)[ Packagist](https://packagist.org/packages/andisiahaan/digiflazz-php)[ Docs](https://github.com/andisiahaan/digiflazz-php)[ RSS](/packages/andisiahaan-digiflazz-php/feed)WikiDiscussions main Synced today

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

Digiflazz PHP
=============

[](#digiflazz-php)

[![Packagist Version](https://camo.githubusercontent.com/1855eabf29406e968668dfb5ffff8bb311b1f7aa55e7cd198daeabfa99948c2b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f616e64697369616861616e2f64696769666c617a7a2d7068702e737667)](https://packagist.org/packages/andisiahaan/digiflazz-php)[![PHP Version](https://camo.githubusercontent.com/e39350abed844874319a55783d22d60ee63f3399404ec4bbe0d851d005a70f91/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f616e64697369616861616e2f64696769666c617a7a2d7068702e737667)](https://packagist.org/packages/andisiahaan/digiflazz-php)[![License](https://camo.githubusercontent.com/7013272bd27ece47364536a221edb554cd69683b68a46fc0ee96881174c4214c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e737667)](LICENSE)[![CI](https://github.com/andisiahaan/digiflazz-php/actions/workflows/php.yml/badge.svg)](https://github.com/andisiahaan/digiflazz-php/actions)[![PHPStan Level](https://camo.githubusercontent.com/d117944b58da8146f96b4ef7403807610a20eeb3fbcaaaf95157bbcdad1686eb/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048505374616e2d6c6576656c253230382d627269676874677265656e2e737667)](https://phpstan.org/)

Modern PHP client for the Digiflazz API. Supports prepaid topup, postpaid bill payment, PLN inquiry, and more.

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

[](#requirements)

- PHP 8.1 or higher
- ext-json
- Guzzle 7.0+

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

[](#installation)

```
composer require andisiahaan/digiflazz-php
```

Quick Start
-----------

[](#quick-start)

```
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();
```

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

[](#configuration)

### Using Environment Variables

[](#using-environment-variables)

Set your credentials:

```
# Linux/macOS
export DIGIFLAZZ_USERNAME='your_username'
export DIGIFLAZZ_APIKEY='your_api_key'

# PowerShell
$env:DIGIFLAZZ_USERNAME='your_username'
$env:DIGIFLAZZ_APIKEY='your_api_key'
```

Then:

```
$client = DigiflazzClient::fromEnvironment();
```

### Using Configuration Object

[](#using-configuration-object)

```
use AndiSiahaan\Digiflazz\Config\Configuration;

$config = new Configuration(
    username: 'your_username',
    apiKey: 'your_api_key',
    timeout: 30.0,
    verifySsl: true,
);

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

Usage
-----

[](#usage)

### Check Balance

[](#check-balance)

```
$balance = $client->checkBalance();
// or
$balance = $client->balance()->check();
```

### Price List

[](#price-list)

```
// 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();
```

### Prepaid Transaction (Topup)

[](#prepaid-transaction-topup)

```
// Using array
$result = $client->topup([
    'buyer_sku_code' => 'xld10',
    'customer_no' => '087800001230',
    'ref_id' => 'unique-ref-123',
    'testing' => true, // Use sandbox
]);

// Using typed method
$result = $client->transaction()->topup(
    skuCode: 'xld10',
    customerNo: '087800001230',
    refId: 'unique-ref-123',
    testing: true,
);

// Generate unique ref_id
use AndiSiahaan\Digiflazz\Services\TransactionService;
$refId = TransactionService::generateRefId('TRX');
```

### Postpaid Bill (Pascabayar)

[](#postpaid-bill-pascabayar)

```
// Step 1: Inquiry (check bill)
$inquiry = $client->inqPasca([
    'buyer_sku_code' => 'pln',
    'customer_no' => '530000000001',
    'ref_id' => 'ref-001',
    'testing' => true,
]);

// Step 2: Pay the bill
if ($inquiry['data']['status'] === 'Sukses') {
    $payment = $client->payPasca([
        'buyer_sku_code' => 'pln',
        'customer_no' => '530000000001',
        'ref_id' => 'ref-001',
        'testing' => true,
    ]);
}

// Check status
$status = $client->statusPasca([...]);
```

### PLN Inquiry

[](#pln-inquiry)

```
// Quick inquiry
$pln = $client->inquiryPln('530000000001');

// Check if valid
$isValid = $client->pln()->isValidCustomer('530000000001');
```

### Deposit Request

[](#deposit-request)

```
$deposit = $client->requestDeposit([
    'amount' => 1000000,
    'Bank' => 'BCA',
    'owner_name' => 'John Doe',
]);

// Or using typed method
$deposit = $client->deposit()->withdraw(1000000, 'BCA', 'John Doe');
```

Error Handling
--------------

[](#error-handling)

The library throws specific exceptions for different error types:

```
use AndiSiahaan\Digiflazz\Exceptions\DigiflazzException;
use AndiSiahaan\Digiflazz\Exceptions\ApiException;
use AndiSiahaan\Digiflazz\Exceptions\HttpException;
use AndiSiahaan\Digiflazz\Exceptions\ValidationException;

try {
    $result = $client->topup([...]);
} catch (ValidationException $e) {
    // Missing or invalid parameters
    echo "Validation error: " . $e->getMessage();
    print_r($e->getErrors());
} catch (ApiException $e) {
    // API returned an error
    echo "API error: " . $e->getMessage();
    echo "Error code: " . $e->getErrorCode();

    if ($e->isInsufficientBalance()) {
        echo "Please top up your balance";
    }

    if ($e->isRetryable()) {
        // Safe to retry
    }
} catch (HttpException $e) {
    // Network or HTTP error
    echo "HTTP error: " . $e->getMessage();
    echo "Status code: " . $e->getStatusCode();
} catch (DigiflazzException $e) {
    // Base exception (catch all library exceptions)
    echo "Error: " . $e->getMessage();
}
```

Service Classes
---------------

[](#service-classes)

Direct access to service classes for more control:

```
$balanceService = $client->balance();
$transactionService = $client->transaction();
$priceListService = $client->priceList();
$depositService = $client->deposit();
$plnService = $client->pln();
```

Development
-----------

[](#development)

### Install Dependencies

[](#install-dependencies)

```
composer install
```

### Run Tests

[](#run-tests)

```
# All tests
composer test

# With coverage
composer test:coverage
```

### Static Analysis

[](#static-analysis)

```
composer analyse
```

### Code Style

[](#code-style)

```
# Check code style
composer cs-check

# Fix code style
composer cs-fix
```

Architecture
------------

[](#architecture)

```
src/
├── Config/
│   └── Configuration.php       # Immutable configuration
├── Contracts/
│   ├── ClientInterface.php     # Client contract
│   ├── HttpClientInterface.php # HTTP abstraction
│   └── ServiceInterface.php    # Service contract
├── Exceptions/
│   ├── DigiflazzException.php  # Base exception
│   ├── ApiException.php        # API errors
│   ├── AuthenticationException.php
│   ├── HttpException.php       # HTTP errors
│   └── ValidationException.php # Validation errors
├── Http/
│   └── GuzzleHttpClient.php    # Guzzle adapter
├── Services/
│   ├── Concerns/
│   │   └── ValidatesParameters.php
│   ├── AbstractService.php     # Base service
│   ├── BalanceService.php
│   ├── DepositService.php
│   ├── PlnService.php
│   ├── PriceListService.php
│   └── TransactionService.php
├── Support/
│   └── Signature.php           # Signature generator
└── DigiflazzClient.php         # Main client

```

Notes
-----

[](#notes)

- **IP Whitelist**: Digiflazz requires your server IP to be whitelisted. Contact Digiflazz support.
- **Testing Mode**: Use `testing: true` for sandbox transactions.
- **Credentials**: Never commit credentials. Use environment variables or `.env` file.

License
-------

[](#license)

MIT - see [LICENSE](LICENSE) file.

###  Health Score

33

—

LowBetter than 72% of packages

Maintenance66

Regular maintenance activity

Popularity5

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity47

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

Every ~124 days

Total

2

Last Release

200d ago

PHP version history (2 changes)v1.0.0PHP &gt;=7.4

1.2.0PHP ^8.1

### Community

Maintainers

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

---

Top Contributors

[![andisiahaan](https://avatars.githubusercontent.com/u/103436266?v=4)](https://github.com/andisiahaan "andisiahaan (10 commits)")

---

Tags

paymentapi clientdigiflazzppobpulsaPLNTopup

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[aws/aws-sdk-php

AWS SDK for PHP - Use Amazon Web Services in your PHP project

6.3k543.5M2.6k](/packages/aws-aws-sdk-php)[neuron-core/neuron-ai

The PHP Agentic Framework.

2.0k656.1k39](/packages/neuron-core-neuron-ai)[tempest/framework

The PHP framework that gets out of your way.

2.2k34.4k15](/packages/tempest-framework)[spatie/laravel-export

Create a static site bundle from a Laravel app

674146.0k6](/packages/spatie-laravel-export)[oat-sa/tao-core

TAO core extension

66143.7k124](/packages/oat-sa-tao-core)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

585.6M577](/packages/shopware-core)

PHPackages © 2026

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