Laravel package for easy integration with payment gateways. Developed using the Laravel 11 environment.
WARNING This package is still in development and may contain bugs. Please use it at your own risk.
The best way to use this package is using composer
composer require nusagates/larapay=dev-master
Then copy config file from vendor to your project config with simple run command bellow:
php artisan vendor:publish --tag=larapay-config
Create an account on iPaymu and then get va Number and API Key from dashboard.
From your project at config/larapay.php
, set virtual account and api key corresponds to your iPaymu account at dashboard.
return [
'va' => env('LARAPAY_VA', '000000XXXXXXXXXX'),
'api_key' => env('LARAPAY_API_KEY', 'SANDBOXXXX-XXXX-XXX'),
'mode' => env('LARAPAY_MODE', 'sandbox'), // sandbox | production
...
];
Larapay allows saving request data to your log file. To enable this, simply set LARAPAY_LOG=true
.
Every time a request is made to an API, the request data payload will be saved.
With simple put class of iPaymu to your method of controller.
use Nusagates\Larapay\Vendors\iPaymu\Ipaymu;
public function index(Ipaymu $iPaymu)
{
return $iPaymu->getBalance();
}
or fluently
use Nusagates\Larapay\Facades\Ipaymu;
Ipaymu::getBalance();
$iPaymu->getBalance();
$iPaymu->getHistory();