Download the PHP package efati/payment-gateway without Composer
On this page you can find all versions of the php package efati/payment-gateway. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download efati/payment-gateway
More information about efati/payment-gateway
Files in efati/payment-gateway
Package payment-gateway
Short Description A reusable, multi-gateway Laravel payment package.
License MIT
Homepage https://github.com/AfshinEfati/payment-gateway
Informations about the package payment-gateway
Laravel Payment Gateway
A reusable, multi-gateway Laravel payment package supporting Iranian banking system.
Features
- Multiple Gateways: Support for Zarinpal, Mellat, and more.
- Dynamic Access: Access specific gateways easily via Facade (e.g.,
Payment::zarinpal()). - Customizable Models: Publish and customize Bank, Gateway, and Transaction models.
- Database Support: Includes migrations and seeders for banks and gateways.
- DTO Support: Uses Data Transfer Objects for consistent request/response handling.
Requirements
- PHP ^8.2
- Laravel ^11.0 | ^12.0
Installation
Install the package via composer:
Configuration
Run the installation command to publish the config, migrations, seeders, models, and core logic:
This command will:
- Publish configuration to
config/payment.php - Publish migrations to
database/migrations - Publish seeders to
database/seeders - Publish models to
app/Models - Scaffold Core Logic: Copy Contracts, Gateways, DTOs, and Managers to
app/Payment/
Run migrations:
Seed the database with banks and gateways:
Usage
Basic Usage
The core logic is now located in app/Payment. You can customize any part of it.
Use the Payment facade to initialize a payment:
Dynamic Gateway Selection
Customization
Since the code is in app/Payment, you can directly edit:
app/Payment/Gateways/Zarinpal.phpapp/Payment/Managers/PaymentManager.phpapp/Payment/DTOs/PaymentRequestDTO.php
The package automatically detects if these files exist in app/Payment and uses them instead of the package defaults.
Verification
On your callback route:
Customizing Models
If you need to extend or modify the models (e.g., to add relationships), you can publish them to your app/Models directory:
This will copy Bank, PaymentGateway, and PaymentTransaction models to app/Models. The package will automatically use your published models if you update the config/payment.php file:
License
The MIT License (MIT).