mr-rijal / ccavenue
Laravel package for CCAvenue payment gateway integration
Requires
- php: ^8.1
- illuminate/support: ^11.0|^12.0|^13.0
Requires (Dev)
- laravel/pint: ^1.0
- orchestra/testbench: ^10.9
- phpunit/phpunit: ^10.0|^11.0
- squizlabs/php_codesniffer: ^3.7
This package is auto-updated.
Last update: 2026-03-13 10:14:11 UTC
README
Laravel package for CCAvenue payment gateway integration. Supports Laravel 11, 12, and 13.
Requirements
- PHP 8.1+
- Laravel 11.x, 12.x, or 13.x
Installation
Install via Composer:
composer require mr-rijal/ccavenue
Publish the config and views:
php artisan vendor:publish --tag=ccavenue-config
Configuration
Add your CCAvenue credentials to .env:
CCAVENUE_MERCHANT_ID=your_merchant_id CCAVENUE_ACCESS_CODE=your_access_code CCAVENUE_WORKING_KEY=your_working_key CCAVENUE_REDIRECT_URL=payment/success CCAVENUE_CANCEL_URL=payment/cancel CCAVENUE_CURRENCY=INR CCAVENUE_LANGUAGE=EN CCAVENUE_TEST_MODE=true
Config is merged under the ccavenue key (published to config/ccavenue.php). Set CCAVENUE_TEST_MODE=false for production.
For Laravel 5.x, add the response route to CSRF exceptions in app/Http/Middleware/VerifyCsrfToken.php (or use the published middleware). The config option remove_csrf_check is also available.
Usage
Resolve the payment gateway and create a purchase:
use MrRijal\CCAvenue\CCAvenue; $ccavenue = app(CCAvenue::class); $response = $ccavenue->purchase([ 'order_id' => 'ORD-' . uniqid(), 'amount' => 1000.00, // ... other CCAvenue parameters ]);
Handle the redirect response from CCAvenue in your callback controller and decode the response:
$ccavenue = app(CCAvenue::class); $result = $ccavenue->response($request);
Or use the facade: CCAvenue::purchase([...]), CCAvenue::response($request).
Development
# Run tests composer test # Code style (PHPCS) composer check-style composer fix-style # Laravel Pint composer pint
License
This package is open-sourced software licensed under the MIT License.
Author
Prashant Rijal
https://prashantrijal.com.np