engalalfy / laravel-payments
A unified Laravel package for multiple payment gateways (Paymob, Kashier, etc.) with easy integration and extensibility.
Fund package maintenance!
Islam H ALAlfy
Requires
- php: ^8.4|^8.2
- illuminate/contracts: ^10.0||^11.0||^12.0
- spatie/laravel-package-tools: ^1.16
Requires (Dev)
- larastan/larastan: ^2.9||^3.0
- laravel/pint: ^1.14
- nunomaduro/collision: ^8.1.1||^7.10.0
- orchestra/testbench: ^10.0.0||^9.0.0||^8.22.0
- pestphp/pest: ^3.0
- pestphp/pest-plugin-arch: ^3.0
- pestphp/pest-plugin-laravel: ^3.0
- phpstan/extension-installer: ^1.3||^2.0
- phpstan/phpstan-deprecation-rules: ^1.1||^2.0
- phpstan/phpstan-phpunit: ^1.3||^2.0
- roave/security-advisories: dev-latest
- spatie/laravel-ray: ^1.35
This package is auto-updated.
Last update: 2025-06-18 19:18:36 UTC
README
A unified Laravel package for multiple payment gateways (Paymob, Kashier, etc.) with easy integration and extensibility. Simplify your payment processing with a consistent API across different payment providers.
Features
- Unified API: Work with multiple payment gateways using a consistent interface
- Extensible: Easily add support for new payment gateways
- Provider Agnostic: Switch between payment providers without changing your application code
- Event Driven: Leverage Laravel's event system for payment notifications
- Thorough Documentation: Well-documented API with examples for each supported gateway
- Robust Testing: Comprehensive test suite for reliability
Package Structure
laravel-payments/
├── config/ # Configuration files
├── database/
│ └── migrations/ # Database migrations
├── resources/
│ └── views/ # Views for payment pages if needed
├── src/
│ ├── Facades/ # Laravel Facades
│ ├── Gateways/ # Payment gateway implementations
│ │ ├── Paymob/
│ │ ├── Kashier/
│ │ └── ...
│ ├── Contracts/ # Interfaces defining the API
│ ├── Models/ # Eloquent models
│ ├── Events/ # Payment-related events
│ ├── Exceptions/ # Custom exceptions
│ └── LaravelPayments.php # Main package class
└── tests/ # Test suite
Installation
You can install the package via composer:
composer require engalalfy/laravel-payments
After installation, publish the configuration and migrations:
php artisan vendor:publish --tag="laravel-payments-config"
Configuration
Configure your payment gateways in the published config file:
// config/laravel-payments.php return [ 'default' => env('PAYMENT_GATEWAY', 'paymob'), 'gateways' => [ 'paymob' => [ 'api_key' => env('PAYMOB_API_KEY'), 'integration_id' => env('PAYMOB_INTEGRATION_ID'), 'iframe_id' => env('PAYMOB_IFRAME_ID'), // Additional Paymob configuration... ], 'kashier' => [ 'merchant_id' => env('KASHIER_MERCHANT_ID'), 'api_key' => env('KASHIER_API_KEY'), // Additional Kashier configuration... ], // Additional payment gateways... ], 'currency' => env('PAYMENT_CURRENCY', 'EGP'), 'callback_url' => env('PAYMENT_CALLBACK_URL', '/payment/callback'), ];
Basic Usage
Testing
The package comes with a comprehensive test suite:
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details on how to contribute to this package.
Reporting Issues
If you encounter any issues, please open an issue on GitHub.
Pull Requests
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Support the Development
If you find this package helpful, consider supporting its development:
Credits
License
The MIT License (MIT). Please see License File for more information.