1. Go to this page and download the library: Download inqord/paymenthelper 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 Illuminate\Http\Request;
use Inqord\PaymentHelper\Facades\PaymentHelper;
public function paymentSuccess(Request $request)
{
$verification = PaymentHelper::verify($request);
if ($verification->isSuccessful()) {
$transactionId = $verification->transactionId;
$amount = $verification->amount;
$metadata = $verification->metadata; // Contains 'user_id' and 'item' from above
// Your database logic to mark the order as paid...
return redirect('/dashboard')->with('success', 'Payment successful!');
}
return redirect('/dashboard')->with('error', 'Payment failed or declined.');
}
bash
php artisan paymenthelper:install
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.