Download the PHP package samrat415/khalti-laravel without Composer
On this page you can find all versions of the php package samrat415/khalti-laravel. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download samrat415/khalti-laravel
More information about samrat415/khalti-laravel
Files in samrat415/khalti-laravel
Package khalti-laravel
Short Description Easy Khalti ePayment Integration Package for Laravel
License MIT
Homepage https://github.com/samrat415/khalti-laravel
Informations about the package khalti-laravel
Easy Khalti ePayment Integration Package for Laravel
This Laravel package provides easy integration for Khalti ePayment services.
Installation
To install the package, use Composer:
Once installed, run the package's installation command to publish the configuration file:
This will publish the configuration file khalti-laravel.php
to the config
folder. Modify the configuration file as needed, and then run:
Usage
You can initiate a payment request using the ePaymentInitiateRequest
method provided by the package. Here's an example of how you can use it in your controller:
Frontend Implementation
To initiate a payment request from the frontend, you can create a form with a single field for the amount and a submit button. Here's an example:
Replace the JavaScript code with the provided code to handle form submission and response.
Validation Example
To complete the payment and validate it, you can use the following method:
Here's an example of the expected request payload:
Please note that Khalti::ePaymentValidationRequest($request)
expects the $request
object to have a pidx
field and $request
to be of type Illuminate\Http\Request
.
Security Vulnerabilities
If you discover a security vulnerability within this package, please send an email to the maintainer at [email protected].
Credits
License
This package is open-sourced software licensed under the MIT license.
All versions of khalti-laravel with dependencies
guzzlehttp/guzzle Version ^7.8
spatie/laravel-package-tools Version ^1.14.0