- How do I integrate FahiPay into my Laravel 13+ app for payment processing?
- Install via Composer with `composer require fahipay/gateway-laravel`, run `php artisan fahipay:install` to publish config and migrations, then execute `php artisan migrate`. Configure your `.env` with `FAHIPAY_MERCHANT_ID` and `FAHIPAY_SECRET_KEY`, then use the facade (`FahiPay::createTransaction()`) or service container to initiate payments.
- Does this package support redirect-based payments (e.g., card payments) in Laravel?
- Yes, the package includes built-in support for redirect flows. Use `FahiPay::createTransaction()` with the `redirect` option to generate a payment URL, then redirect users to FahiPay’s payment page. The package handles the callback routing and signature verification automatically.
- Can I test payments locally before going live in the Maldives?
- Absolutely. Enable test mode in your `.env` by setting `FAHIPAY_TEST_MODE=true`. This routes transactions to FahiPay’s sandbox environment, allowing you to simulate payments without real funds or affecting live accounts.
- How does the package handle security for callback verification?
- The package includes secure signature verification for callbacks using FahiPay’s HMAC-based authentication. Ensure your `FAHIPAY_SECRET_KEY` is correctly set in `.env`, and the package will validate incoming webhook payloads automatically. For added security, consider restricting callback endpoints to FahiPay’s IP ranges.
- What Laravel versions and PHP versions are officially supported?
- This package is designed for **Laravel 13+** and requires **PHP 8.2+**. While it claims compatibility with newer Laravel versions, always test thoroughly in your staging environment, especially if using features like Symfony 7.x components or custom HTTP clients.
- Are there built-in migrations for tracking payments in my database?
- Yes, the package includes Eloquent migrations for the `fahipay_transactions` table. Running `php artisan migrate` after installation will create this table, allowing you to track transactions, statuses, and metadata via the `FahiPayTransaction` model.
- How do I handle failed transactions or API errors from FahiPay?
- The package includes basic error handling for API failures (e.g., timeouts, 4xx/5xx responses). However, retries are not implemented by default. For production, extend the `FahiPayService` class or wrap API calls in your own retry logic using Laravel’s `retry` helper or a queue job.
- Can I extend this package for additional FahiPay features like refunds or disputes?
- Yes, the package is designed for extensibility. You can create custom service classes by extending `FahiPayService` or overriding methods. For example, add a `refund()` method to the facade or publish additional migrations for dispute tracking. Check the `app/Providers/FahiPayServiceProvider.php` for service binding hooks.
- Does this package work with multi-tenancy or custom database schemas?
- The package assumes a default Laravel database setup. For multi-tenancy, you’ll need to manually adjust the `fahipay_transactions` table migrations or use Laravel’s database connections feature. Consider scoping transactions by tenant ID in your application logic.
- Are there any known limitations or risks when using this package in production?
- Key risks include undocumented edge cases (e.g., FahiPay API rate limits) and lack of explicit PCI-DSS compliance documentation. Test thoroughly in sandbox mode, monitor callback logs, and ensure your `FAHIPAY_SECRET_KEY` is never exposed. For high-risk applications, audit the package’s HTTP client implementation for security gaps.