1. Go to this page and download the library: Download smronju/laravel-sslcommerz 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/ */
smronju / laravel-sslcommerz example snippets
use Smronju\Sslcommerz\Facades\Sslcommerz;
$response = Sslcommerz::setOrder($amount, $invoiceId, $productName)
->setCustomer($name, $email, $phone)
->makePayment();
if ($response->success()) {
return redirect($response->gatewayPageURL());
}
$isValid = Sslcommerz::validatePayment($request->all(), $transactionId, $amount);
if ($isValid) {
// Save to database, update status, etc.
}