Download the PHP package otnansirk/laravel-dana without Composer
On this page you can find all versions of the php package otnansirk/laravel-dana. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download otnansirk/laravel-dana
More information about otnansirk/laravel-dana
Files in otnansirk/laravel-dana
Package laravel-dana
Short Description This Laravel wrapper for DANA Payment API
License MIT
Informations about the package laravel-dana
Laravel DANA Payment Package
This Laravel wrapper/library for DANA Payment API. Visit https://dana.id for more information about the product and see documentation at https://dashboard.dana.id/api-docs for more technical details.
Requirements
- PHP 8.1 or higher
- Laravel 9.x, 10.x, 11.x, or 12.x
Installation
1. You can install the package via composer.
2. The service provider will automatically get registered. Or you may manually add the service provider in your config/app.php
file.
3. You should publish the config/dana.php
config file with this php artisan command.
Configuration
All configuration are stored in config/dana.php
. Customize everything you need.
Make sure to set the following environment variables in your .env
file:
Usage
1. Create order | DANAPay::createOrder($orderData)
About all possible payloads for $orderData
please check the official DANA documentation.
Ref: https://dashboard.dana.id/api-docs/read/33
2. Get Transaction by acquirementId | DANAPay::queryOrder($acquirementId)
You can get transaction detail and status transaction with this method
Ref: https://dashboard.dana.id/api-docs/read/42
3. Get oAuth URL | DANAPay::generateOauthUrl($terminalType, $redirectUrl)
For more information please check the official DANA documentation.
Ref: https://dashboard.dana.id/api-docs/read/47
4. Get Token and Refresh Token | DANAPay::getToken($authToken)
You can get value of $authToken
from oAuth callback process.
From this function you will receive token
and refresh_token
.
Ref: https://dashboard.dana.id/api-docs/read/32
5. Get User Profile | DANAPay::profile($accessToken)
You can get value for $accessToken
from DANAPay::getToken
function
Ref: https://dashboard.dana.id/api-docs/read/38
6. Unbinding Access Token | DANAPay::unBindAllAccount()
This function used for revoke or unbind all access token registered from the merchant.
Ref: https://dashboard.dana.id/api-docs/read/46
7. Function for provide callback response
This function will generate valid response for DANA API.
$status
is boolean data type.
8. Function for calculation MDR
This function will calculate MDR fee for DANA.
You will get value $payMethod
and $payAmount
from callback DANA.
Testing
Laravel Version Compatibility
This package supports multiple Laravel versions:
Laravel Version | PHP Version | Status |
---|---|---|
Laravel 9.x | PHP 8.1+ | ✅ Supported |
Laravel 10.x | PHP 8.1+ | ✅ Supported |
Laravel 11.x | PHP 8.2+ | ✅ Supported |
Laravel 12.x | PHP 8.2+ | ✅ Supported |
Changelog
Please see CHANGELOG.md for a list of what has changed since the last version.
Contributing
This project is far from perfect. Many DANA APIs that have not been implemented. I would be very happy if any of you could contribute to this project.
License
The MIT License (MIT). Please see License File for more information.
All versions of laravel-dana with dependencies
laravel/framework Version ^9.19|^10.0|^11.0|^12.0
guzzlehttp/guzzle Version ^7.0