Download the PHP package asciisd/cashier-core without Composer
On this page you can find all versions of the php package asciisd/cashier-core. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download asciisd/cashier-core
More information about asciisd/cashier-core
Files in asciisd/cashier-core
Package cashier-core
Short Description A flexible payment processing system for Laravel using Factory Pattern
License MIT
Informations about the package cashier-core
Cashier Core
A flexible payment processing system for Laravel using the Factory Pattern. This package provides a unified interface for multiple payment processors, making it easy to add new payment gateways without changing your application code.
Features
- Factory Pattern: Easy to extend with new payment processors
- Unified Interface: Consistent API across all payment processors
- Laravel Integration: Native Laravel package with service provider
- Database Models: Built-in models for transactions, payments, and payment methods
- Configurable: Flexible configuration system
- Testable: Comprehensive test suite included
- Multiple Processors: Support for custom processors
- Refund Support: Full and partial refunds
- Authorization & Capture: Pre-authorization and later capture
- Payment Methods: Store and manage customer payment methods
- Webhooks: Built-in webhook handling support
- Security: Encrypted sensitive data storage
- Logging: Comprehensive payment logging
Installation
Configuration
Publish the configuration file:
Publish and run the migrations:
Environment Configuration
Add the following environment variables to your .env file:
Usage
Basic Payment Processing
Working with Different Processors
Refund Processing
Authorization and Capture
Database Models
Using the Payable Trait
Add the Payable trait to your models that can make payments:
This provides helpful methods:
Working with Transactions
Managing Payment Methods
Adding Custom Payment Processors
-
Create a class that extends
AbstractPaymentProcessor: -
Register it in your configuration:
- Use it through the factory:
Error Handling
Testing
Run the test suite:
Run tests with coverage:
Configuration Options
The package provides extensive configuration options. See the published config file for all available settings:
- Processors: Configure multiple payment processors
- Currency: Set default and supported currencies
- Database: Customize table names and connections
- Webhooks: Configure webhook handling
- Logging: Control payment logging
- Security: Configure data encryption and masking
- Retry Logic: Set up retry mechanisms for failed payments
- Feature Flags: Enable/disable specific features
Supported Payment Processors
Built-in Processors
Extensible Architecture
The Factory Pattern makes it easy to add new processors:
- Implement the
PaymentProcessorInterface - Extend
AbstractPaymentProcessorfor common functionality - Register in configuration
- Use immediately through the factory
Security Features
- Data Encryption: Sensitive data is encrypted before storage
- Card Masking: Credit card numbers are automatically masked
- Webhook Verification: Secure webhook signature verification
- Input Validation: Comprehensive input validation for all processors
Examples
Check the examples/BasicUsage.php file for comprehensive usage examples covering:
- Basic payment processing
- Refund handling
- Authorization and capture
- Payment method management
- Error handling
- Custom processor registration
- Database queries
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
The MIT License (MIT). Please see License File for more information.
Support
For support, please open an issue on GitHub or contact us at [email protected].
All versions of cashier-core with dependencies
laravel/framework Version ^11.0|^12.0|^13.0
illuminate/contracts Version ^11.0|^12.0|^13.0
illuminate/database Version ^11.0|^12.0|^13.0
illuminate/support Version ^11.0|^12.0|^13.0