Download the PHP package obrainwave/paygate without Composer
On this page you can find all versions of the php package obrainwave/paygate. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download obrainwave/paygate
More information about obrainwave/paygate
Files in obrainwave/paygate
Package paygate
Short Description Complete Laravel payment solution with 7 payment gateways, JavaScript SDK, advanced security, and plugin system. Unified API for Paystack, GTPay, Flutterwave, Monnify, Interswitch, Remita, and VTPass.
License MIT
Homepage https://github.com/obrainwave/paygate
Informations about the package paygate
Paygate v2.0.0 - Multi-Payment Gateway Laravel Package
A comprehensive Laravel package that provides a unified interface for 7 payment gateways. Seamlessly handle payments through Paystack, GTPay, Flutterwave, Monnify, Interswitch, Remita, and VTPass with a single, consistent API.
🎉 Version 2.0.0 is here! Complete rewrite with 7 payment gateways, JavaScript SDK, advanced security, plugin system, and much more!
✨ Features
Payment Gateways (7 Total)
- Paystack: Complete payment processing with refunds
- GTPay: Full payment support with refunds
- Flutterwave: Comprehensive payment processing with refunds
- Monnify: Complete payment gateway with refunds
- Interswitch: OAuth-based payment processing with refunds
- Remita: Payment processing (refund via support)
- VTPass: Bill payments for utilities and services
Core Features
- Unified API: Single interface for all payment gateways
- Payment Processing: Initiate, verify, and refund payments
- Database Integration: Automatic payment storage and tracking
- Laravel Events: Payment lifecycle event dispatching
- Webhook Handling: Secure webhook processing with signature verification
- Middleware Protection: Route protection and payment verification
Frontend Integration
- JavaScript SDK: Complete client-side payment handling
- Blade Components: Pre-built frontend components
- Responsive Design: Mobile-friendly payment forms
- Real-time Notifications: Built-in notification system
- Form Validation: Client-side validation and error handling
Advanced Features
- Caching System: Redis support with configurable TTL
- Security Suite: Data encryption, log masking, and fraud detection
- Plugin System: Extensible architecture for custom features
- Performance Optimization: Caching, retry logic, and rate limiting
- API Controllers: Complete REST API for payment operations
- Artisan Commands: Package management and installation
Developer Experience
- Comprehensive Testing: Feature and unit tests with 100% coverage
- Complete Documentation: API docs, examples, and guides
- Easy Installation: One-command setup with
php artisan paygate:install - Configuration Management: Environment-based configuration
- Error Handling: Graceful error management and logging
🚀 Version 2.0.0 - What's New
Major Features
- 7 Payment Gateways - Paystack, GTPay, Flutterwave, Monnify, Interswitch, Remita, VTPass
- JavaScript SDK - Complete client-side payment handling
- Plugin System - Extensible architecture for custom features
- Advanced Security - Fraud detection, data encryption, audit logging
- Performance Optimization - Caching, rate limiting, retry logic
- Complete Frontend - Blade components, responsive design, real-time notifications
Migration from v1.x
- ✅ Backward Compatible - Old API still works
- ✅ Easy Migration - One-command migration
- ✅ Enhanced Features - All new features available
- 📖 Migration Guide - Complete migration guide
Installation
1. Install via Composer
2. Run the Installation Command
This command will:
- Publish migrations and config files
- Run database migrations
- Add environment variables to your
.envfile
3. Configure Environment Variables
Add your payment gateway credentials to your .env file:
4. Clear Configuration Cache
Usage
Basic Usage
1. Using the Facade (Recommended)
2. Using Dependency Injection
3. Using Web Routes
4. Using API Routes
Advanced Features
Database Integration
Laravel Events
Blade Components
Legacy Usage (Backward Compatibility)
The package maintains backward compatibility with the original API:
🎯 Advanced Features
Database Integration
The package automatically stores payment records in the database:
Laravel Events
Listen to payment lifecycle events:
Webhook Handling
The package includes comprehensive webhook handling:
Middleware Protection
Protect routes that require successful payments:
API Endpoints
Complete REST API for payment operations:
JavaScript SDK
The package includes a comprehensive JavaScript SDK for client-side payment handling:
Auto-Initialization
The SDK automatically initializes payment forms with data attributes:
Blade Components
Use pre-built components in your views:
Testing
The package includes comprehensive tests:
Configuration Options
Customize the package behavior:
Environment Variables
Configure your payment gateways:
🔧 Artisan Commands
Manage the package with built-in commands:
🛡️ Security Features
- Webhook Signature Verification: All webhooks are verified using HMAC signatures
- Middleware Protection: Routes can be protected to require successful payments
- Data Encryption: Sensitive payment data can be encrypted
- Rate Limiting: Built-in rate limiting for payment endpoints
- Input Validation: Comprehensive validation for all payment data
- Audit Logging: Complete audit trail of all payment operations
📊 Monitoring & Analytics
🚀 Performance Optimization
- Caching: Response caching for better performance
- Database Indexing: Optimized database queries
- Lazy Loading: Efficient data loading
- Connection Pooling: Reuse HTTP connections
- Async Processing: Background job processing for webhooks
🔄 Migration Guide
If you're upgrading from an older version:
- Backup your data before upgrading
- Run the installation command:
php artisan paygate:install - Update your environment variables with new configuration options
- Test your payment flows to ensure everything works correctly
- Update your code to use new features (optional)
🤝 Contributing
We welcome contributions! Please see our Contributing Guide for details.
📄 License
This package is open-sourced software licensed under the MIT license.
🆘 Support
- Documentation: Full Documentation
- Issues: GitHub Issues
- Discussions: GitHub Discussions
Request Fields
The table below shows and explains the field features.
Note the Mandatory(M), Optional(O), and Not Applicable(N/A) used in the table.
| Field Name | Type | Paystack | GTPay | Flutterwave | Monnify | Description |
|---|---|---|---|---|---|---|
provider |
string | M | M | M | M | This is the payment gateway name. For now can only be paystack, gtpay, flutterwave and monnify. |
provider_token |
string | M | M | M | M | This is the payment gateway access_token or API Secret Key. For Monnify only, your API Key and Secret Key should be in ApiKey:SecretKey format as provider_token |
amount |
float | M | M | M | M | This is the amount to be charged for the transaction or the amount you are debiting customer. |
email |
string | M | M | M | M | Customer's email address |
reference |
string | M | M | M | M | Your unique generated reference |
redirect_url |
url | O | O | O | O | Fully qualified url, e.g. https://example.com/ . Use this to override the callback url provided on the dashboard for this transaction |
name |
string | O | O | O | M | Customer's name |
contract_code |
string | N/A | N/A | N/A | M | Customer's email address |
payment_methods |
array | O | O | O | O | An array of payment methods or channels to control what channels you want to make available to the user to make a payment with. E.g available channels for paystack include: ["card", "bank", "ussd", "qr", "mobile_money", "bank_transfer", "left"]. Check other payment gateways documentation for their available payment methods or channels. |
pass_charge |
boolean | N/A | O | N/A | N/A | This is only applicable to gtpay. It takes two possible values: True or False. It is set to False by default. When set to True, the charges on the transaction is computed and passed on to the customer(payer). But when set to False, the charge is passed to the merchant and will be deducted from the amount to be settled to the merchant. |
logo |
url | N/A | N/A | O | N/A | This is only applicable to flutterwave. The Merchant's logo URL. |
title |
url | N/A | N/A | O | N/A | This is only applicable to flutterwave. The name to display on the checkout page. |
phone_number |
string | N/A | N/A | O | N/A | This is only applicable to flutterwave. This is the phone number linked to the customer's bank account or mobile money account |
Response Sample
If successful, you will receive a response that looks like the below sample response
Response Fields
Note that the table below shows and explains the most important fields to complete the payment or transaction.
| Field Name | Type | Description |
|---|---|---|
errors |
boolean | Can only be true or false. The request was successful if true and false if the request was not successful |
message |
string | Short description of the request |
data |
object | This contains all the parameters you need to complete the payment or transaction |
data->checkout_url |
url | This is the checkout url from the payment gateway for the customer to complete the payment. You can redirect this url to give customer interface. |
data->reference |
string | Merchant's Unique reference for the transaction. The unique generated reference you send via request to payment gateway. |
data->access_code |
string | Unique reference generated for the transaction by payment gateway. |
provider |
string | This is the payment gateway name. For now can only be paystack, gtpay, flutterwave and monnify. |
Verify Payment/Transaction
You can load Paygate instance using use \Obrainwave\Paygate\Facades\Paygate or just use the facade use Paygate.
Request Sample
Request Fields
The table below shows and explains the field features.
Note the Mandatory(M), Optional(O), and Not Applicable(N/A) used in the table.
| Field Name | Type | Paystack | GTPay | Flutterwave | Monnify | Description |
|---|---|---|---|---|---|---|
provider |
string | M | M | M | M | This is the payment gateway name. For now can only be paystack, gtpay, flutterwave and monnify. |
provider_token |
string | M | M | M | M | This is the payment gateway access_token or API Secret Key. For Monnify only, you your API Key and Secret Key should be in ApiKey:SecretKey format as provider_token |
reference |
string | M | M | M | M | Your unique generated reference sent to payment gateway. It should also be returned via payment initiation response |
Response Sample
If successful, you will receive a response that looks like the below sample response
Response Fields
Note that the table below shows and explains the most important fields that decide the payment or transaction status.
| Field Name | Type | Description |
|---|---|---|
errors |
boolean | Can only be true or false. The request was successful if true and false if the request was not successful |
message |
string | Short description of the request |
provider |
string | This is the payment gateway name. For now can only be paystack, gtpay, flutterwave and monnify. |
status |
string | Can only be successful or failed. The payment was completed and successful if successful and failed if the payment was not successful or not completed. If you want to dig more about the status, check for payment gateway transaction status in data field. status for paystack, transaction_status for gtpay, status for flutterwave, and paymentStatus for monnify. |
amount |
float | Amount initiated to be paid by the customer from your transaction |
charged_amount |
float | Total amount charged by payment gateway and paid by the customer. This can be equal to the amount if you don't pass the charge to your customer. |
reference |
string | Your unique generated reference sent to the payment gateway. It should also be returned via payment verification response |
provider_reference |
string | Unique reference generated for the transaction by the payment gateway. It should also be returned via payment verification response |
data |
object | This contains all the parameters you need to play with the payment or transaction verification |
Conclusion
Presently only local payment gateways work. International payment gateways(such as Stripe, Paypal, etc) will be added.
For this package only initiates and verifies transactions at minimum version. More features will be added in subsequent versions. Please watchout!!!
Changelog
Please see CHANGELOG for more information on what has changed recently.
🔧 Advanced Features
Caching System
The package includes a comprehensive caching system for improved performance:
Security Suite
Advanced security features to protect payment data:
Plugin System
Extensible architecture for custom features:
Performance Optimization
Built-in performance features:
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
- Olaiwola Akeem Salau
- All Contributors
License
The MIT License (MIT). Please see License File for more information.