Download the PHP package sarfarazstark/laravel-payu without Composer
On this page you can find all versions of the php package sarfarazstark/laravel-payu. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download sarfarazstark/laravel-payu
More information about sarfarazstark/laravel-payu
Files in sarfarazstark/laravel-payu
Package laravel-payu
Short Description Laravel PayU Payment Gateway Integration Package
License MIT
Informations about the package laravel-payu
Laravel PayU Package
A comprehensive Laravel package for integrating PayU payment gateway with complete database transaction tracking, webhook handling, and advanced payment management features.
โจ Features
- ๐ Complete PayU API Integration - All PayU APIs wrapped in a Laravel-friendly interface
- ๐พ Database Transaction Tracking - Automatic logging of payments, refunds, and webhooks
- ๐ Enhanced Data Integrity - Database enums for status fields and categorized data
- ๐ฏ Eloquent Models - Rich models with relationships and helper methods
- ๐งช Comprehensive Testing - 28+ unit tests covering all functionality
- ๐ Webhook Management - Automatic webhook processing and verification
- ๐ก๏ธ Security First - Hash verification and secure configuration management
- ๐ Analytics Ready - Query scopes and aggregation methods for reporting
๐ฆ Installation
1. Install via Composer
2. Publish Configuration, Migrations & Models
๐ก Note: Publishing models is optional. You can work with the PayU transactions, refunds, and webhooks using the package's built-in models (
SarfarazStark\LaravelPayU\Models\*
). However, if you want to customize the models or add additional relationships in your application, publish them to yourapp/Models
directory.
3. Working with Published Models
Once you publish the models with php artisan vendor:publish --tag=payu-models
, you'll have three Eloquent models in your app/Models
directory:
PayUTransaction Model
- Location:
app/Models/PayUTransaction.php
- Features: Complete transaction tracking with relationships and helper methods
- Constants: Status and payment mode constants for easy reference
PayURefund Model
- Location:
app/Models/PayURefund.php
- Features: Refund management with status tracking and relationships
- Constants: Refund status and type constants
PayUWebhook Model
- Location:
app/Models/PayUWebhook.php
- Features: Webhook processing and verification with event tracking
- Constants: Event type and status constants
Example usage with published models:
3. Environment Configuration
Add your PayU credentials to .env
:
โ ๏ธ Important: The
PAYU_SUCCESS_URL
andPAYU_FAILURE_URL
are required. If not set in your .env file, you must passsurl
andfurl
parameters when calling payment methods, otherwise anInvalidArgumentException
will be thrown.
๐๏ธ Database Schema
The package creates three optimized database tables:
PayU Transactions (payu_transactions
)
- Status Enum:
pending
,success
,failure
,cancelled
,failed
- Payment Mode Enum:
CC
,DC
,NB
,UPI
,EMI
,WALLET
,CASH
- Complete transaction details with customer information
- Indexed for performance on status, email, and payment dates
PayU Refunds (payu_refunds
)
- Status Enum:
pending
,success
,failed
,cancelled
,processing
- Type Enum:
refund
,cancel
,chargeback
- Linked to transactions with refund tracking
PayU Webhooks (payu_webhooks
)
- Event Type Enum: 9 different payment/refund event types
- Status Enum:
received
,processed
,failed
,ignored
- Automatic webhook verification and processing logs
๐ Quick Start Guide
Basic Payment Integration
Payment Response Handling
๐ง Advanced Usage
Working with Eloquent Models
Transaction Management
Refund Management
Webhook Handling
Using Available Enum Constants
๐ Complete PayU API Integration
Payment Operations
Refund Operations
EMI & Card Operations
UPI & Banking Operations
Invoice Operations
๐ Reporting & Analytics
Transaction Analytics
Refund Analytics
๐งช Testing
The package includes comprehensive unit tests covering all functionality:
Writing Custom Tests
๐ Security Best Practices
Hash Verification
Environment Configuration
Database Security
๐ Production Deployment
Performance Optimization
Monitoring & Logging
๐ค Contributing
We welcome contributions! Please see our contributing guidelines for details.
Development Setup
๐ API Documentation
For detailed API documentation and parameter requirements, see the doc/
folder:
- Payment Verification
- Transaction Details
- Refund Operations
- EMI Operations
- UPI Validation
- Invoice Management
- And more...
๐ License
This package is open-sourced software licensed under the MIT License.
๐ฌ Support
- ๐ง Email: [email protected]
- ๐ Issues: GitHub Issues
- ๐ Documentation: GitHub Wiki
Made with โค๏ธ by Sarfaraz Stark