| Package Data | |
|---|---|
| Maintainer Username: | act360 |
| Maintainer Contact: | santosh.act360@gmail.com (Santosh Jung Shahi) |
| Package Create Date: | 2017-05-11 |
| Package Last Update: | 2019-02-25 |
| Language: | PHP |
| License: | MIT |
| Last Refreshed: | 2025-11-02 15:12:39 |
| Package Statistics | |
|---|---|
| Total Downloads: | 133 |
| Monthly Downloads: | 0 |
| Daily Downloads: | 0 |
| Total Stars: | 7 |
| Total Watchers: | 1 |
| Total Forks: | 3 |
| Total Open Issues: | 0 |
This composer package offers a E-sewa payment gateway setup for your Laravel applications.
Begin by pulling in the package through Composer.
composer require act360/laravel-esewa
Next, if using Laravel 5, include the service provider within your config/app.php file.
'providers' => [
Esewa\EsewaServiceProvider::class,
];
Finally, add these variable to .env.
ESEWA_MERCHANT_ID=YOUR_ESEWA_MERCHANT_ID
ESEWA_TRANSACTION_URL=ESEWA_PAYMENT_URL
Within your Model, make a call to the Billable trait.
namespace App;
use Esewa\Billable;
Class Store extends Model
{
use Billable;
}
You can use this on controller as:
Class StoreController extends Controller
{
public function create(Request $request, Store $store)
{
$item = $store->create($request->all());
$payment_details = [
'tAmt' => 100,
'amt' => 100,
'pid' => "PR-01",
'su' => "YOUR_SUCCESS_URL",
'fu' => "YOUR_FAILURE_URL"
];
$item->charge($payment_details);
}
public function success()
{
// Do something here when payment success.
}
public function failure()
{
// Do something here when payment failure.
}
}
Done! You'll now be able to use esewa gateway.