mr-rijal/ccavenue

Laravel package for CCAvenue payment gateway integration

Maintainers

Package info

github.com/mr-rijal/ccavenue

Homepage

pkg:composer/mr-rijal/ccavenue

Statistics

Installs: 0

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

1.0.0 2026-03-13 10:09 UTC

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

Support