Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Library Laravel Package

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.

View on GitHub
Deep Wiki
Context7

MyFatoorah PHP Library

Frequently asked questions about Library
What Laravel versions does myfatoorah/library support?
The package is designed for Laravel 8.x and 9.x, leveraging modern features like dependency injection and facades. Check the repository’s `composer.json` for exact version constraints, as newer Laravel releases may require updates. Always verify compatibility with your project’s PHP version (e.g., 8.0+).
How do I configure the MyFatoorah API credentials in Laravel?
Add your MyFatoorah merchant ID, secret key, and endpoint URL to `config/myfatoorah.php`. The package auto-loads this file via Laravel’s service provider. For production, use environment variables (e.g., `.env`) to avoid hardcoding sensitive data. Example: `MYFATOORAH_SECRET=your_secret_here`.
Does this package support webhook validation for security?
Yes, the library includes built-in webhook validation using HMAC signatures to ensure requests originate from MyFatoorah. Configure your `webhook_secret` in the config file, and the package will verify signatures automatically. For critical systems, pair this with Laravel’s signed events for additional security.
Can I test MyFatoorah API calls without hitting the live endpoint?
The package supports mocking via Laravel’s HTTP client or Guzzle. Use `Mockery` or Laravel’s `Http::fake()` to simulate API responses in unit tests. For integration tests, leverage the `MyFatoorahMock` trait (if available) or stub the HTTP client. Example: `Http::fake(['*'])->throw(new Exception('Test failure'));`
How does the library handle API rate limits or retries?
The package includes basic retry logic for transient failures (e.g., network issues), but you may need to configure custom retry policies for high-volume scenarios. Use Laravel’s `retry` helper or Guzzle’s middleware to implement exponential backoff. For rate limits, monitor HTTP 429 responses and adjust your request frequency accordingly.
Is there built-in support for subscriptions or recurring payments?
The current library focuses on one-time invoices, refunds, and webhooks. Subscriptions would require custom logic, such as scheduling recurring invoices via Laravel’s `scheduler` or a queue worker. Check MyFatoorah’s API docs for subscription-specific endpoints and extend the package as needed.
How do I handle failed payments or refunds in Laravel?
The package dispatches Laravel events (e.g., `PaymentFailed`, `RefundProcessed`) for failed operations. Listen to these events in your `EventServiceProvider` or use queues to defer processing. Example: `event(new ProcessRefund($invoiceId));` For critical failures, log errors with Laravel’s `Log::error()` and notify admins via notifications.
What are the alternatives to myfatoorah/library for Laravel?
For Laravel payment gateways, consider `laravel-cashier` (Stripe), `omnipay/omnipay` (multi-gateway), or `paypal/rest-api-sdk-php` (PayPal). If MyFatoorah-specific features are non-negotiable, this package is the most integrated option. For broader flexibility, Omnipay supports MyFatoorah via a custom driver but lacks Laravel-native features like facades.
Does the package support multi-currency invoices?
The library forwards currency settings to MyFatoorah’s API, so support depends on the gateway’s capabilities. Configure the `currency` field in your invoice payload (e.g., `AED`, `SAR`). Test with MyFatoorah’s sandbox to confirm multi-currency workflows, as some regions may have restrictions.
How do I deploy this in production with PCI compliance?
The package delegates PCI compliance to MyFatoorah’s tokenization and encryption. Never store raw card data; use MyFatoorah’s hosted fields or tokens. For audit logs, integrate Laravel’s `Log::channel('daily')` to track sensitive operations. Use HTTPS for all API calls and restrict MyFatoorah credentials to your server’s environment variables.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
jayeshmepani/jpl-moshier-ephemeris-php
elnasnato/laraliveui
labrodev/rest-sdk
sampaui/sampaui
babelqueue/php-sdk
facebook/capi-param-builder-php
babelqueue/symfony
hamzi/corewatch
minionfactory/raw-hydrator
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver
mkwebdesign/filament-watchdog-v5
renatomarinho/laravel-page-speed
zedmagdy/filament-business-hours
renatovdemoura/blade-elements-ui
devgeek/beacon-admin
benjamin-rqt/data-watcher-bundle