1. Go to this page and download the library: Download aqshah20/mezpay 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/ */
aqshah20 / mezpay example snippets
'providers' => [
// Other service providers...
MezPay\MezPayServiceProvider::class,
]
use App\Http\Controllers\OrdersController;
Route::get('/success/{orderId?}', [OrdersController::class, 'orderSucceeded'])->name('success');
Route::get('/failed/{orderId?}', [OrdersController::class, 'orderFailed'])->name('failed');
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
class OrdersController extends Controller
{
public function orderSucceeded(Request $request)
{
// Get the orderId from the URL parameter or any other source as needed
$orderId = $request->orderId;
// Perform actions for successful payment
// For example, update order status, send notifications, etc.
// You can also pass the $orderId to a view if needed
return view('success', compact('orderId'));
}
public function orderFailed(Request $request)
{
// Get the orderId from the URL parameter or any other source as needed
$orderId = $request->orderId;
// Perform actions for failed payment
// For example, update order status, send notifications, etc.
// You can also pass the $orderId to a view if needed
return view('failed', compact('orderId'));
}
}