PHP code example of rudraramesh / esewa-payment

1. Go to this page and download the library: Download rudraramesh/esewa-payment 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/ */

    

rudraramesh / esewa-payment example snippets


$response = Http::post('/esewa/payment', [
    'amount' => 1000,
    'order_id' => 'ORDER123',
]);

Event::listen('esewa.payment.success', function ($payload) {
    // Handle payment success
});
Event::listen('esewa.payment.failed', function ($payload) {
    // Handle payment failure
});
bash
   php artisan vendor:publish --provider="Rbb\ESewaPayment\Providers\ESewaPaymentServiceProvider" --tag=config
   php artisan vendor:publish --provider="Rbb\ESewaPayment\Providers\ESewaPaymentServiceProvider" --tag=views