{"id":18345569,"url":"https://github.com/nurfaizfy/digiflazz-php-library","last_synced_at":"2025-04-06T08:31:44.762Z","repository":{"id":62550937,"uuid":"502554602","full_name":"nurfaizfy/digiflazz-php-library","owner":"nurfaizfy","description":"Simple Unofficial Digiflazz API Library written with PHP","archived":false,"fork":false,"pushed_at":"2023-05-31T16:11:27.000Z","size":22,"stargazers_count":11,"open_issues_count":3,"forks_count":12,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-19T17:16:33.586Z","etag":null,"topics":["api","digiflazz","php","ppob"],"latest_commit_sha":null,"homepage":"https://packagist.org/packages/nurfaizfy/digiflazz-php-library","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nurfaizfy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-06-12T08:02:33.000Z","updated_at":"2024-10-21T23:38:20.000Z","dependencies_parsed_at":"2023-01-21T23:16:50.993Z","dependency_job_id":null,"html_url":"https://github.com/nurfaizfy/digiflazz-php-library","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nurfaizfy%2Fdigiflazz-php-library","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nurfaizfy%2Fdigiflazz-php-library/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nurfaizfy%2Fdigiflazz-php-library/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nurfaizfy%2Fdigiflazz-php-library/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nurfaizfy","download_url":"https://codeload.github.com/nurfaizfy/digiflazz-php-library/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247457255,"owners_count":20941900,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","digiflazz","php","ppob"],"created_at":"2024-11-05T21:08:40.967Z","updated_at":"2025-04-06T08:31:44.388Z","avatar_url":"https://github.com/nurfaizfy.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Digiflazz PHP Library\n[![Latest Stable Version](http://poser.pugx.org/nurfaizfy/digiflazz-php-library/v)](https://packagist.org/packages/nurfaizfy/digiflazz-php-library)\n[![Total Downloads](http://poser.pugx.org/nurfaizfy/digiflazz-php-library/downloads)](https://packagist.org/packages/nurfaizfy/digiflazz-php-library)\n[![License](http://poser.pugx.org/nurfaizfy/digiflazz-php-library/license)](https://packagist.org/packages/nurfaizfy/digiflazz-php-library)\n\nThis library is unofficial Digiflazz API written with PHP.\n\n-   [Documentation](#documentation)\n-   [Installation](#installation)\n-   [Usage](#usage)\n-   [Methods' Signature and Examples](#methods-signature-and-examples)\n    -   [Balance](#balance)\n        -   [Get Balance](#get-balance)\n    -   [Price List](#price-list)\n        -   [Get Price List](#get-price-list)\n    -   [Deposit](#deposit)\n        -   [Create Deposit Ticket](#create-deposit-ticket)\n    -   [Transaction](#transaction)\n        -   [Create Transaction](#create-transaction)\n        -   [Inquiry Postpaid](#inquiry-postpaid)\n        -   [Pay Postpaid](#pay-postpaid)\n        -   [Inquiry PLN](#inquiry-pln)\n    -   [Callback](#callback)\n        -   [Get Callback](#get-callback)\n-   [Exceptions](#exceptions)\n    -   [InvalidArgumentException](#invalidargumentexception)\n    -   [ApiException](#apiexception)\n-   [Contributing](#contributing)\n\n---\n\n## Documentation\n\nFor the API documentation, check [Digiflazz API Reference](https://developer.digiflazz.com/api/).\n\n## Installation\n\nInstall digiflazz-php-library with composer by following command:\n\n```bash\ncomposer require nurfaizfy/digiflazz-php-library\n```\n\nor add it manually in your `composer.json` file.\n\n## Usage\n\nConfigure package with your account's secret key obtained from [Digiflazz Dashboard](https://member.digiflazz.com/buyer-area/connection/api).\n\n```php\nuse Gonon\\Digiflazz\\Digiflazz;\nDigiflazz::initDigiflazz('username', 'apikey');\n```\n\n## Methods' Signature and Examples\n\n### Balance\n\n#### Get Balance\n\n```php\n\\Gonon\\Digiflazz\\Balance::getBalance();\n```\n\nUsage example:\n\n```php\n$getBalance = \\Gonon\\Digiflazz\\Balance::getBalance();\nvar_dump($getBalance);\n```\n\n### Price List\n\n#### Get Price List\n\n```php\n\\Gonon\\Digiflazz\\PriceList::getPrePaid(); // Prepaid product\n\\Gonon\\Digiflazz\\PriceList::getPostPaid(); // Postpaid product\n```\n\nUsage example:\n\n```php\n$priceList = \\Gonon\\Digiflazz\\PriceList::getPrePaid();\nvar_dump($priceList);\n```\n\n### Deposit\n\n#### Create Deposit Ticket\n\n```php\n\\Gonon\\Digiflazz\\Deposit::createDeposit(array $params);\n```\n\nParameters for this method\n| Name | Required | Description |\n| --- | --- | --- |\n| `amount_bank` | `yes` | The deposit amount |\n| `bank` | `yes` | The name of the destination bank to which your transfer will be made (BRI, BCA, MANDIRI) |\n| `owner_name` | `yes` | The name of the account holder who made the deposit transfer to Digiflazz |\n\nUsage example:\n\n```php\n$params = [\n    'amount' =\u003e '200000',\n    'bank' =\u003e 'BCA',\n    'owner_name' =\u003e 'Digiflazz',\n];\n$createDeposit = \\Gonon\\Digiflazz\\Deposit::createDeposit($params);\nvar_dump($createDeposit);\n```\n\n### Transaction\n\n#### Create Transaction\n\n```php\n\\Gonon\\Digiflazz\\Transaction::createTransaction(array $params);\n```\n\nParameters for this method\n| Name | Required | Description |\n| --- | --- | --- |\n| `buyer_sku_code` | `yes` | Product SKU |\n| `customer_no` | `yes` | Customer number |\n| `ref_id` | `yes` | Your unique reference ID |\n\nUsage example:\n\n```php\n$params = [\n    'buyer_sku_code' =\u003e 'xl10',\n    'customer_no' =\u003e '08123456789',\n    'ref_id' =\u003e 'some1d',\n];\n$createTrasaction = \\Gonon\\Digiflazz\\Transaction::createTransaction($params);\nvar_dump($createTrasaction);\n```\n\n#### Inquiry Postpaid\n\n```php\n\\Gonon\\Digiflazz\\Transaction::inquiryPostpaid(array $params);\n```\n\nParameters for this method\n| Name | Required | Description |\n| --- | --- | --- |\n| `buyer_sku_code` | `yes` | Product SKU |\n| `customer_no` | `yes` | Customer number |\n| `ref_id` | `yes` | Your unique reference ID |\n\nUsage example:\n\n```php\n$params = [\n    'buyer_sku_code' =\u003e 'xl10',\n    'customer_no' =\u003e '08123456789',\n    'ref_id' =\u003e 'some1d',\n];\n$pascaInquiry = \\Gonon\\Digiflazz\\Transaction::inquiryPostpaid($params);\nvar_dump($pascaInquiry);\n```\n\n#### Pay Postpaid\n\n```php\n\\Gonon\\Digiflazz\\Transaction::payPostpaid(array $params);\n```\n\nParameters for this method\n| Name | Required | Description |\n| --- | --- | --- |\n| `buyer_sku_code` | `yes` | Product SKU |\n| `customer_no` | `yes` | Customer number |\n| `ref_id` | `yes` | Your unique reference ID |\n\nUsage example:\n\n```php\n$params = [\n    'buyer_sku_code' =\u003e 'xl10',\n    'customer_no' =\u003e '08123456789',\n    'ref_id' =\u003e 'some1d',\n];\n$payPasca = \\Gonon\\Digiflazz\\Transaction::payPostpaid($params);\nvar_dump($payPasca);\n```\n\n#### Inquiry PLN\n\n```php\n\\Gonon\\Digiflazz\\Transaction::inquiryPLN(array $params);\n```\n\nParameters for this method\n| Name | Required | Description |\n| --- | --- | --- |\n| `customer_no` | `yes` | Customer number |\n\nUsage example:\n\n```php\n$params = [\n    'customer_no' =\u003e '123456789',\n];\n$iquiryPLN = \\Gonon\\Digiflazz\\Transaction::inquiryPLN($params);\nvar_dump($iquiryPLN);\n```\n\n### Callback\n\n#### Get Callback\n\nUse this method to get Callback\n```php\n\\Gonon\\Digiflazz\\Callback::getCallback();\n```\n\nUse this method to get JSON Callback\n```php\n\\Gonon\\Digiflazz\\Callback::getJsonCallback();\n```\n\n## Exceptions\n\n### InvalidArgumentException\n\n`InvalidArgumentException` will be thrown if the argument provided by user is not sufficient to create the request.\n\nFor 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.\n\n`InvalidArgumentException` is derived from PHP's `InvalidArgumentException`. For more information about this Exception methods and properties, please check [PHP Documentation](https://www.php.net/manual/en/class.invalidargumentexception.php).\n\n### ApiException\n\n`ApiException` wraps up Digiflazz API error. This exception will be thrown if there are errors from Digiflazz API side.\n\nTo get exception message:\n\n```php\ntry {\n    $transaction = \\Gonon\\Digiflazz\\Transaction::createTransaction(array $params);\n} catch (\\Gonon\\Digiflazz\\Exceptions\\ApiException $e) {\n    var_dump($e-\u003egetMessage());\n}\n```\n\nTo get exception HTTP error code:\n\n```php\ntry {\n    $transaction = \\Gonon\\Digiflazz\\Transaction::createTransaction(array $params);\n} catch (\\Gonon\\Digiflazz\\Exceptions\\ApiException $e) {\n    var_dump($e-\u003egetCode());\n}\n```\n\nTo get exception Digiflazz API error code:\n\n```php\ntry {\n    $transaction = \\Gonon\\Digiflazz\\Transaction::createTransaction(array $params);\n} catch (\\Gonon\\Digiflazz\\Exceptions\\ApiException $e) {\n    var_dump($e-\u003egetErrorCode());\n}\n```\n\n## Contributing\n\nFor any requests, bugs, or comments, please open an [issue](https://github.com/nurfaizfy/digiflazz-php-library/issues)\n\n### Installing Packages\n\nBefore you start to code, run this command to install all of the required packages. Make sure you have `composer` installed in your computer\n\n```bash\ncomposer install\n```\n\nThere is a pre-commit hook to run phpcs and phpcbf. Please make sure they passed before making commits/pushes.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnurfaizfy%2Fdigiflazz-php-library","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnurfaizfy%2Fdigiflazz-php-library","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnurfaizfy%2Fdigiflazz-php-library/lists"}