1. Go to this page and download the library: Download razu/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 NagadPaymentGateway;
$redirectUrl = NagadPaymentGateway::tnxID($id)
->amount($amount)
->getRedirectUrl();
return $redirectUrl;
use NagadPaymentGateway;
$verify = (object) NagadPaymentGateway::ipn();
if($verify->status === 'Success'){
$order = json_decode($verify->additionalMerchantInfo);
$order_id = $order->tnx_id;
// your functional task with order_id
}
if ($verify->status === 'Aborted') {
dd($verify);
// redirect or other what you want
}
dd($verify);