PHP code example of kendenigerian / payzephyr

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/ */

    

kendenigerian / payzephyr example snippets


Payment::amount(100.00)->email('[email protected]')->redirect();

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');
bash
php artisan payzephyr:trace PZ_1758000000_ab12cd