PHP code example of kodbee / jomabee-laravel

1. Go to this page and download the library: Download kodbee/jomabee-laravel 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/ */

    

kodbee / jomabee-laravel example snippets


use Kodbee\PaydiverLaravel\Facades\Paydiver;

$payment = Paydiver::createPayment([
    'amount' => 500,
    'product_name' => 'Premium Plan',
    'customer_email' => '[email protected]',
    'redirect_url' => route('checkout.thanks'),
    'callback_url' => route('webhooks.paydiver'),
]);

return redirect($payment['payment_url']);

Paydiver::paymentStatus('PAYD-XXXXXX');
Paydiver::verifyPayment('PAYD-XXXXXX', 'TRXID123', 'bkash');
Paydiver::transactions(['status' => 'verified']);
Paydiver::balance();

use Illuminate\Support\Facades\Route;

Route::post('/webhooks/paydiver', function (\Illuminate\Http\Request $request) {
    $event = $request->json()->all(); // signature already verified
    // handle $event['event'] === 'payment.verified'
    return response()->noContent();
})->middleware('paydiver.webhook')->name('webhooks.paydiver');