myfatoorah/library
PHP library for integrating MyFatoorah payment gateway. Create invoices, execute and verify payments, handle callbacks, and manage payment status in your Laravel or PHP app with a simple API wrapper and configuration options.
payment-service) with Laravel’s HTTP clients.config/myfatoorah.php) aligns with Laravel’s 12-factor principles.MyFatoorahException)?MyFatoorahMock) for CI/CD?MyFatoorahServiceProvider) for bootstrapping.MyFatoorah::invoice()) for clean syntax.InvoiceCreated, RefundFailed) for decoupled workflows.dispatch(new ProcessRefund)) for async operations.HttpClient (e.g., Mockery or Laravel’s Http facade).config/database.php aligns with your ORM (e.g., Eloquent).| Phase | Task | Dependencies |
|---|---|---|
| Setup | Install package, publish config (php artisan vendor:publish). |
Laravel project initialized. |
| Configuration | Configure .env (API keys, endpoints). |
MyFatoorah merchant credentials. |
| Core API | Replace invoice/refund logic with package methods. | Basic API flows tested. |
| Webhooks | Migrate listeners to Laravel events + package webhook handlers. | Webhook URLs verified. |
| Async | Implement queues for long-running operations (e.g., refunds). | Queue workers configured. |
| Testing | Write integration tests for critical paths. | Test data seeded. |
| Monitoring | Set up logging/metrics for API calls and webhooks. | Observability tools in place. |
| Rollout | Feature flag rollout; monitor errors. | Pilot environment validated. |
composer update..env and config/myfatoorah.php in a secrets manager (e.g., Vault).@deprecated tags).MYFATOORAH_LOG=true in .env for debug traces.request_id).afterCommit() to batch queue jobs (e.g., 100 refunds/second).memory_get_usage() during high-volume API calls.invoice table indexes if storing MyFatoorah responses.| Failure Scenario | Mitigation Strategy | Detection Mechanism |
|---|---|---|
| MyFatoorah API Downtime | Queue failed jobs; retry with exponential backoff. | Laravel Horizon + Sentry alerts. |
| Webhook Delivery Failures | Implement dead-letter queues for unprocessed webhooks. | Queue worker metrics. |
| Rate Limiting | Add circuit breakers (e.g., spatie/flysystem-circuit-breaker). |
HTTP 429 responses logged. |
| Data Corruption | Validate |
How can I help you explore Laravel packages today?