Download the PHP package dgvai/laravel-nagad without Composer
On this page you can find all versions of the php package dgvai/laravel-nagad. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download dgvai/laravel-nagad
More information about dgvai/laravel-nagad
Files in dgvai/laravel-nagad
Package laravel-nagad
Short Description Nagad Payment Gateway for Laravel (Bangladesh)
License MIT
Informations about the package laravel-nagad
Nagad (Bangladesh) payment gateway for Laravel 6.x+
Nagad is one of the Financial Services in Bangladesh. This package is built for Nagad Payment Gateway for Laravel 6.x, 7.x and 8.x+
Contents
- Installation
- Setting up your configuration
- Usage
- Changelog
- License
Installation
You can install the package via composer:
Setting up your configuration
Extract the nagad config files:
-
This will publish and config file in
config_path()
of your application. Eg.config/nagad.php
-
Configure the configurations for the nagad merchant acocunt. Use
sandbox = true
for development stage. - Be sure to set the timezone of you application to
Asia/Dhaka
in order to work with Nagad PG. To do this: go toconfig/app.php
and set'timezone' => 'Asia/Dhaka'
Usage
NagadPG uses three stages of payment process, and two of theme are simultaneous. To get started, first you have to setup
a callback route (GET
) for the Nagad Callback and name the route in the nagad config file.
To Start payment, in your controller:
To receive the callback response, in your callback controller method:
Available Methods
For Checking-out
setOrderID(string $orderID)
:$orderID
to be any unique AlphaNumeric StringsetAmount(string $amount)
:$amount
to be any valid currency numeric StringsetAddionalInfo(array $array)
:$array
to be any array to be returned at callbacksetCallbackUrl(string $url)
:$url
to be any url string to be overidden the defualt callback url set in configcheckout()
: to initiate checkout process.redirect()
: to direct redirect to the NagadPG Web Page.getRedirectUrl()
: instead of redirecting, getting the redirect url manually.
For Callback
callback($request)
:$request
to be instanceverify()
: to verify the response.success()
: to check if transaction is succeed.getErrors()
: to get the error and errorCode if fails transactions | returnsarray[]
getVerifiedResponse()
: to get the full verified response | returnsarray[]
getAdditionalData(bool $object)
: to get the additional info passed during checkout.$object
is to set return object or array.
Changelog
Please see CHANGELOG for more information what has changed recently.
License
The MIT License (MIT). Please see License File for more information.