PHP code example of freelancernishad / laravel-ekpay
1. Go to this page and download the library: Download freelancernishad/laravel-ekpay 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/ */
freelancernishad / laravel-ekpay example snippets
use FreelancerNishad\Ekpay\Services\EkpayService;
public function checkout(EkpayService $ekpayService)
{
$trns_info = [
"trnx_amt" => 100,
"trnx_currency" => "BDT",
"trnx_id" => "ORDER_" . uniqid(),
"ord_det" => "Payment for Order #123",
];
$cust_info = [
"cust_email" => "[email protected]",
"cust_name" => "John Doe",
"cust_mobo_no" => "017XXXXXXXX",
];
$result = $ekpayService->initiatePayment($trns_info, $cust_info);
return redirect()->to($result['payment_url']);
}