aznidev/digiflazz-php
Composer 安装命令:
composer require aznidev/digiflazz-php
包简介
Unofficial PHP Library Digiflazz
README 文档
README
This library is unofficial Digiflazz API written with PHP.
Documentation
For the API documentation, check Digiflazz API Reference.
Installation
Install digiflazz-php-library with composer by following command:
composer require nurfaizfy/digiflazz-php-library
or add it manually in your composer.json file.
Usage
Configure package with your account's secret key obtained from Digiflazz Dashboard.
use Gonon\Digiflazz\Digiflazz; Digiflazz::initDigiflazz('username', 'apikey');
Methods' Signature and Examples
Balance
Get Balance
\Gonon\Digiflazz\Balance::getBalance();
Usage example:
$getBalance = \Gonon\Digiflazz\Balance::getBalance(); var_dump($getBalance);
Price List
Get Price List
\Gonon\Digiflazz\PriceList::getPrePaid(); // Prepaid product \Gonon\Digiflazz\PriceList::getPostPaid(); // Postpaid product
Usage example:
$priceList = \Gonon\Digiflazz\PriceList::getPrePaid(); var_dump($priceList);
Deposit
Create Deposit Ticket
\Gonon\Digiflazz\Deposit::createDeposit(array $params);
Parameters for this method
| Name | Required | Description |
|---|---|---|
amount_bank |
yes |
The deposit amount |
bank |
yes |
The name of the destination bank to which your transfer will be made (BRI, BCA, MANDIRI) |
owner_name |
yes |
The name of the account holder who made the deposit transfer to Digiflazz |
Usage example:
$params = [ 'amount' => '200000', 'bank' => 'BCA', 'owner_name' => 'Digiflazz', ]; $createDeposit = \Gonon\Digiflazz\Deposit::createDeposit($params); var_dump($createDeposit);
Transaction
Create Transaction
\Gonon\Digiflazz\Transaction::createTransaction(array $params);
Parameters for this method
| Name | Required | Description |
|---|---|---|
buyer_sku_code |
yes |
Product SKU |
customer_no |
yes |
Customer number |
ref_id |
yes |
Your unique reference ID |
Usage example:
$params = [ 'buyer_sku_code' => 'xl10', 'customer_no' => '08123456789', 'ref_id' => 'some1d', ]; $createTrasaction = \Gonon\Digiflazz\Transaction::createTransaction($params); var_dump($createTrasaction);
Inquiry Postpaid
\Gonon\Digiflazz\Transaction::inquiryPostpaid(array $params);
Parameters for this method
| Name | Required | Description |
|---|---|---|
buyer_sku_code |
yes |
Product SKU |
customer_no |
yes |
Customer number |
ref_id |
yes |
Your unique reference ID |
Usage example:
$params = [ 'buyer_sku_code' => 'xl10', 'customer_no' => '08123456789', 'ref_id' => 'some1d', ]; $pascaInquiry = \Gonon\Digiflazz\Transaction::inquiryPostpaid($params); var_dump($pascaInquiry);
Pay Postpaid
\Gonon\Digiflazz\Transaction::payPostpaid(array $params);
Parameters for this method
| Name | Required | Description |
|---|---|---|
buyer_sku_code |
yes |
Product SKU |
customer_no |
yes |
Customer number |
ref_id |
yes |
Your unique reference ID |
Usage example:
$params = [ 'buyer_sku_code' => 'xl10', 'customer_no' => '08123456789', 'ref_id' => 'some1d', ]; $payPasca = \Gonon\Digiflazz\Transaction::payPostpaid($params); var_dump($payPasca);
Inquiry PLN
\Gonon\Digiflazz\Transaction::inquiryPLN(array $params);
Parameters for this method
| Name | Required | Description |
|---|---|---|
customer_no |
yes |
Customer number |
Usage example:
$params = [ 'customer_no' => '123456789', ]; $iquiryPLN = \Gonon\Digiflazz\Transaction::inquiryPLN($params); var_dump($iquiryPLN);
Callback
Get Callback
Use this method to get Callback
\Gonon\Digiflazz\Callback::getCallback();
Use this method to get JSON Callback
\Gonon\Digiflazz\Callback::getJsonCallback();
Exceptions
InvalidArgumentException
InvalidArgumentException will be thrown if the argument provided by user is not sufficient to create the request.
For example, there are required arguments such as ref_id, customer_no, and buyer_sku_code to create an transaction. If user lacks one or more arguments when attempting to create one, InvalidArgumentException will be thrown.
InvalidArgumentException is derived from PHP's InvalidArgumentException. For more information about this Exception methods and properties, please check PHP Documentation.
ApiException
ApiException wraps up Digiflazz API error. This exception will be thrown if there are errors from Digiflazz API side.
To get exception message:
try { $transaction = \Gonon\Digiflazz\Transaction::createTransaction(array $params); } catch (\Gonon\Digiflazz\Exceptions\ApiException $e) { var_dump($e->getMessage()); }
To get exception HTTP error code:
try { $transaction = \Gonon\Digiflazz\Transaction::createTransaction(array $params); } catch (\Gonon\Digiflazz\Exceptions\ApiException $e) { var_dump($e->getCode()); }
To get exception Digiflazz API error code:
try { $transaction = \Gonon\Digiflazz\Transaction::createTransaction(array $params); } catch (\Gonon\Digiflazz\Exceptions\ApiException $e) { var_dump($e->getErrorCode()); }
Contributing
For any requests, bugs, or comments, please open an issue
Installing Packages
Before you start to code, run this command to install all of the required packages. Make sure you have composer installed in your computer
composer install
There is a pre-commit hook to run phpcs and phpcbf. Please make sure they passed before making commits/pushes.
aznidev/digiflazz-php 适用场景与选型建议
aznidev/digiflazz-php 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 5 次下载、GitHub Stars 达 0, 最近一次更新时间为 2025 年 01 月 29 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 aznidev/digiflazz-php 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 aznidev/digiflazz-php 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 5
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 7
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-01-29