jey/zibal
Laravel gateway integration for Zibal payments. Provides simple API to create payment requests, redirect users to Zibal, and verify transactions after callback. Includes configuration, service classes, and helpers to streamline checkout and order payment flows.
jey/zibal package provides a Laravel wrapper for the Ziball payment gateway, enabling seamless integration of Iranian payment processing (e.g., card payments, bank transfers). This is a highly specialized use case for markets where Ziball is the dominant payment provider (e.g., Iran).config/zibal.php setup (API keys, endpoints, etc.), aligning with Laravel’s convention-over-configuration paradigm.PaymentGateway) to swap implementations later.shetabit/payment) or native SDKs that offer broader gateway support?ZibalServiceProvider, enabling dependency injection (e.g., Zibal::charge()).Zibal facade for concise syntax (e.g., Zibal::verifyPayment()).config/zibal.php) for API keys, endpoints, and defaults.orders, payments tables). May require custom migrations for Ziball-specific fields (e.g., zibal_transaction_id).Zibal::createPayment() returns a URL). Requires frontend integration for handling redirects and webhook callbacks.composer require jey/zibal
php artisan vendor:publish --provider="Jey\Zibal\ZibalServiceProvider"
// Create payment
$payment = Zibal::createPayment([
'amount' => 100000, // Rials
'callback_url' => route('zibal.callback'),
'description' => 'Order #12345',
]);
return redirect()->away($payment->url);
// Handle callback
$result = Zibal::verifyPayment(request()->input('authority'));
if ($result->status === 'OK') {
// Fulfill order
}
route('zibal.callback').Failed, Verified, or Refunded events.composer.json).laravel-cashier).| Phase | Task | Dependencies |
|---|---|---|
| Discovery | Validate Ziball’s API docs and sandbox. | Legal/compliance sign-off |
| Setup | Install package, configure .env, publish config. |
Ziball dev account |
| Core Flow | Implement createPayment + callback handling. |
Database schema updates |
| Testing | Test sandbox transactions, edge cases (e.g., failed payments). | QA environment |
| Webhooks | Deploy callback endpoint, monitor logs for events. | Load balancer/firewall rules |
| Go-Live | Switch to live API keys, monitor transactions. | Stakeholder approval |
jey/zibal for updates (though inactive, check for forks or maintenance).config/caching and environment variables for dynamic values.'debug' => env('ZIBAL_DEBUG', false)).Zibal::createPayment() via Laravel Queues).tenants table).| Failure Scenario | Impact | Mitigation Strategy |
|---|---|---|
| Ziball API downtime | Payments fail, revenue loss. | Implement fallback to alternative gateway (e.g., bank transfer). |
| Webhook delivery failures | Unverified payments, fraud. | Use Laravel’s retry middleware for webhooks. |
| Sandbox → Live transition errors | Live payments rejected. | Test live API calls in staging first. |
| Currency/amount mismatches | Chargebacks or user disputes. | Validate amounts server-side before submission. |
| Regulatory blocks | Account frozen, legal risk. | Monitor sanctions lists; diversify gateways. |
How can I help you explore Laravel packages today?