1. Go to this page and download the library: Download luova/nagad library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
use LNagad;
class CartController extends Controller
{
use LNagad;
public function order()
{
// Call to payment Nagad
$this->nagadInitialize([
'amount' => '10', // cart ammount
'transaction_id' => '3354asdf' // unique order transaction id or your order id
]);
}
use LNagad;
class CartController extends Controller
{
use LNagad;
public function callback(Request $request)
{
$payment_ref_id = $request->payment_ref_id;
$verify = $this->NagadPyamentVerify($payment_ref_id);
// dd($verify); // For check verification response
// After Your code
}
bash
php artisan vendor:publish --tag=nagad
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.