1. Go to this page and download the library: Download kendenigerian/payzephyr 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 KenDeNigerian\PayZephyr\Facades\Payment;
Route::get('/checkout', function () {
return Payment::amount(500.00)
->email('[email protected]')
->callback(route('payment.callback'))
->redirect();
});
use KenDeNigerian\PayZephyr\Facades\Payment;
Route::get('/payment/callback', function (\Illuminate\Http\Request $request) {
$verification = Payment::verify($request->query('reference'));
if ($verification->isSuccessful()) {
return 'Payment succeeded! Reference: '.$verification->reference;
}
return 'Payment did not go through.';
})->name('payment.callback');