Download the PHP package yogeshgupta/phonepe-laravel without Composer
On this page you can find all versions of the php package yogeshgupta/phonepe-laravel. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download yogeshgupta/phonepe-laravel
More information about yogeshgupta/phonepe-laravel
Files in yogeshgupta/phonepe-laravel
Package phonepe-laravel
Short Description A Laravel package for integrating PhonePe payment gateway
License MIT
Informations about the package phonepe-laravel
PhonePe API v2 Laravel Integration
A developer-friendly Laravel package for integrating the PhonePe API v2 payment gateway, supporting both redirect checkout and web iframe checkout methods. Built on top of the yogeshgupta/phonepe-laravel package by Yogesh Gupta, this package simplifies secure and efficient transaction processing using the PhonePe checkout v2 API. It includes a customizable checkout form, token caching, and seamless Laravel integration.
Features
- Dual Checkout Methods:
- Redirect Checkout: Redirects users to PhonePe’s payment page.
- Web Iframe Checkout: Loads the payment interface in an iframe using the PhonePe Checkout SDK.
- PhonePe API v2 Support: Initiates and verifies payments using the latest API endpoints.
- Developer-Friendly:
- Configurable default checkout method via
.env
orconfig/phonepe.php
. - Override checkout method per request (
redirect
oriframe
). - Publishable checkout form with AJAX-based payment initiation.
- Configurable default checkout method via
- Token Caching: Efficient API calls with cached access tokens.
- Security: CSRF protection, input validation, and XSS prevention.
- Error Handling: Detailed logging and user-friendly error messages.
Requirements
- PHP >= 8.1
- Laravel 9.x, 10.x, 11.x, or 12.x
Installation
-
Install the package via Composer:
- Publish the configuration file:
This will create a config/phonepe.php
file in your Laravel project.
- Add your PhonePe credentials to your
.env
file:
Configuration
The configuration file (config/phonepe.php
) allows you to customize:
- Environment (
uat
orprod
) - Client ID, version, and secret for both environments
- Token cache path
- Redirect URL after PhonePe API v2 payment
Example configuration:
Usage
Initiating a Payment
Verifying Payment Status
Example Controller
Example Checkout Form
A sample Blade template for the checkout form:
Testing
To run tests (if included):
Contributing
Contributions are welcome! Please follow these steps:
- Fork the repository.
- Create a feature branch (
git checkout -b feature/your-feature
). - Commit your changes (
git commit -m 'Add your feature'
). - Push to the branch (
git push origin feature/your-feature
). - Open a pull request.
Issues
Report bugs or suggest features by opening an issue on the GitHub repository.
License
This Laravel PhonePe integration package is licensed under the MIT License.