Download the PHP package yousefkadah/laravel-pelecard without Composer
On this page you can find all versions of the php package yousefkadah/laravel-pelecard. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download yousefkadah/laravel-pelecard
More information about yousefkadah/laravel-pelecard
Files in yousefkadah/laravel-pelecard
Package laravel-pelecard
Short Description Laravel package for Pelecard payment gateway integration with Cashier-compatible subscription billing and multi-tenancy support
License MIT
Informations about the package laravel-pelecard
Laravel Pelecard Payment Gateway
A comprehensive Laravel package for integrating with the Pelecard payment gateway. Built with Laravel Cashier-level code quality, featuring subscription billing, multi-tenancy support, and a familiar Billable trait interface.
Features
- 🔐 Multi-Tenancy Support - Multiple Pelecard accounts in one application
- 💳 Cashier-Compatible - Familiar
Billabletrait interface - 📦 Subscription Management - Create, cancel, resume, and swap subscriptions
- 🔄 Recurring Payments - Tokenization and automated billing
- 💰 One-Time Payments - Authorize, charge, refund, and void transactions
- 🖼️ iFrame Integration - Hosted payment pages with full customization
- 🔒 3D Secure - Enhanced security authentication
- 📱 Google Pay - Digital wallet support
- 🎯 Type-Safe DTOs - Request objects with validation and IDE autocomplete
- 🪝 Webhook Support - Automated payment notifications
- 📊 Transaction Logging - Complete payment history
- 🎯 Events - Listen to payment lifecycle events
- 🔒 Secure - Encrypted credential storage
Requirements
- PHP 8.1 or higher (PHP 8.3+ recommended for Laravel 13)
- Laravel 10.x, 11.x, 12.x, or 13.x
- Pelecard merchant account
Installation
Install the package via Composer:
Publish the configuration file:
Run the migrations:
Configuration
Add your Pelecard credentials to your .env file:
Billable Model
By default the billable entity — the model that owns subscriptions,
transactions and the saved card token — is your App\Models\User. To bill a
different model (e.g. a Tenant or Team in a SaaS app), set it in
config/pelecard.php (or the PELECARD_MODEL env var):
The model's table and foreign key drive both the migration and the
relationships, so a Tenant model (table tenants) automatically uses a
tenant_id foreign key on the subscriptions and pelecard_transactions
tables — no migration editing required. Just add the Billable trait to that
model. (This mirrors Laravel Cashier's configurable customer model.)
Multi-Tenancy Configuration
For applications that need separate Pelecard credentials per tenant, enable
multi-tenancy in config/pelecard.php:
Usage
Basic Setup
Add the Billable trait to your billable model (your User, or whatever
pelecard.model points at):
One-Time Payments
Security Note: Always use tokens for payments. Only collect card details for the initial tokenization.
Charge a Customer (Using Token)
First-Time Payment (Tokenize Card)
Automatic Card Saving (Recommended)
The package automatically extracts tokens from payment responses (J2/J4/J5):
Authorize (Hold Funds)
Capture Authorization
Pelecard has no dedicated capture service — capturing a held (J5) authorization
is done by charging the saved token with ActionType J4:
Refund a Transaction
Using DTOs (Type-Safe Requests)
The package provides Data Transfer Objects for type-safe API requests with IDE autocomplete:
php // Using ParamX and ParamZ for order tracking $response = Pelecard::charge([ 'amount' => 10000, 'currency' => 'ILS', 'token' => $user->pelecard_token, 'param_x' => 'order_12345', // Order ID 'param_z' => json_encode([ // Additional metadata 'customer_id' => $user->id, 'source' => 'mobile_app', ]), ]);
// In webhook callback, retrieve the parameters $paramX = $request->input('ParamX'); // 'order_12345' $paramZ = $request->input('ParamZ'); // JSON data
// With DTOs $charge = new ChargeRequestDTO( amount: 10000, currency: 'ILS', token: $user->pelecard_token, ); $charge->paramX = 'order_12345'; $charge->paramZ = json_encode(['user_id' => $user->id]);
$response = Pelecard::charge($charge->toArray()); blade {{-- Only ParamX is supported in iframe --}} <x-pelecard::payment-iframe :amount="10000" param-x="order_12345" />
3D Secure Authentication
3D Secure provides an additional layer of security for online card transactions.
Using 3DS with Saved Token
3DS with iFrame (Recommended)
Enable 3DS in the iframe payment page:
Or programmatically:
Get 3DS Data After Authentication
Google Pay
Advanced Token Management
Best Practice: Always tokenize cards and use tokens for recurring payments to comply with PCI-DSS.
Convert Card to Token
Charge Using Token
Retrieve Token Details
Update Token
Transaction Retrieval
Invoice Creation
The package provides a flexible invoice builder with customizable templates.
Creating an Invoice
Customizing Invoice Template
Publish the invoice templates:
This creates resources/views/vendor/pelecard/invoices/default.blade.php which you can customize:
Using Custom Template
Error Messages
Invoice Creation
iFrame Payment Integration
Pelecard's iframe integration allows customers to complete payments directly on your website without being redirected to an external payment page.
Using the Blade Component
Using the Helper Directly
Customization Options
top_text- Text displayed at the top of the payment pagebottom_text- Text displayed at the bottomlogo_url- Your company logo URLhide_pelecard_logo- Hide Pelecard branding (boolean)show_confirmation- Show confirmation checkbox (boolean)min_payments- Minimum number of installmentsmax_payments- Maximum number of installmentsparam_x- Custom parameter to track the transaction
Subscriptions
The subscription API follows current Laravel Cashier conventions: subscriptions
have a type (e.g. 'default') and one or more prices.
Create a Subscription
Check Subscription Status
Cancel a Subscription
Resume a Canceled Subscription
Swap Prices
Update Quantity
Multi-Tenancy
Per-Team Credentials (SaaS Applications)
Direct Client Usage
Webhooks
Display webhook URL:
Configure the webhook URL in your Pelecard dashboard to receive payment notifications.
Listen to Webhook Events
Payment Methods
Update Default Payment Method
Check for Payment Method
Transaction History
Artisan Commands
Display Webhook URL
Sync Subscriptions
Events
The package dispatches the following events:
PaymentSucceeded- When a payment is successfulPaymentFailed- When a payment failsSubscriptionCreated- When a subscription is createdSubscriptionCancelled- When a subscription is cancelledSubscriptionUpdated- When a subscription is updated
Code Quality Tools
This package uses industry-standard code quality tools to maintain high code standards:
Laravel Pint (Code Formatting)
Rector (Automated Refactoring)
PHPStan (Static Analysis)
Run All Quality Checks
Testing
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Security
If you discover any security-related issues, please email [email protected] instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.
All versions of laravel-pelecard with dependencies
illuminate/support Version ^10.0|^11.0|^12.0|^13.0
illuminate/database Version ^10.0|^11.0|^12.0|^13.0
illuminate/contracts Version ^10.0|^11.0|^12.0|^13.0
guzzlehttp/guzzle Version ^7.5