- Can I use acatus-dev/paybox-bundle directly in Laravel, or is it only for Symfony?
- This bundle is designed for Symfony and isn’t natively compatible with Laravel. You’d need to adapt it using Laravel’s ServiceProvider, Middleware, or Events to replicate Symfony’s EventDispatcher and DependencyInjection. A full rewrite or wrapper package is recommended for seamless Laravel integration.
- What Laravel versions does acatus-dev/paybox-bundle support?
- The bundle itself targets Symfony 5, but Laravel compatibility isn’t guaranteed. For Laravel 9+, you’d need to manually implement Symfony-specific features (e.g., events, HMAC logic) using Laravel’s equivalents. Test thoroughly, as PHP 8.x changes may affect HMAC/OpenSSL dependencies.
- How do I configure Paybox’s test mode in Laravel?
- Since the bundle uses Symfony’s config system, you’ll need to replicate its `production` flag in Laravel’s `.env` or `config/paybox.php`. Set `PAYBOX_MODE=true` for production or `false` for sandbox. Ensure your Paybox credentials (site, rank, login, HMAC key) match the environment.
- Does this bundle handle Paybox’s server availability checks in Laravel?
- The bundle includes pre-request server checks, but you’d need to port this logic into Laravel middleware or a service. Use Guzzle’s HTTP client to ping Paybox’s endpoint before processing transactions, mirroring the Symfony bundle’s behavior.
- How can I verify Paybox IPN signatures in Laravel without Symfony’s EventDispatcher?
- Replace Symfony’s event system with Laravel’s `Event` facade. Create a custom `PayboxIpnListener` service to handle IPN events, then dispatch them via `event(new PayboxIpnEvent($data))`. Use OpenSSL’s `hash_hmac` to verify signatures, matching the bundle’s `sha512` algorithm.
- What are the risks of using this bundle in Laravel for PCI compliance?
- The bundle’s HMAC/OpenSSL dependencies must be enabled in `php.ini` (PECL `hash`, `openssl`). Store HMAC keys securely (e.g., Laravel’s `env()` or encrypted config) and log transactions without sensitive data. Paybox’s IPN handling must align with PCI DSS—test thoroughly in sandbox before production.
- How do I test Paybox transactions in Laravel’s test environment?
- Simulate Paybox responses using Laravel’s HTTP testing helpers (`Http::fake()`) or mock Guzzle requests. For IPN testing, dispatch fake events (`Bus::fake()`) and assert listeners trigger correctly. Since the bundle lacks a mock Paybox server, build one using Laravel’s `Http::respond()`.
- Are there alternatives to acatus-dev/paybox-bundle for Laravel?
- For Laravel, consider native packages like `spatie/paybox` (if available) or build a custom service using Guzzle for API calls and Laravel’s Events for IPN handling. Alternatively, use a multi-currency payment gateway like Stripe or Adyen with Laravel-specific SDKs.
- How do I handle async IPN events in Laravel queues?
- Dispatch IPN events to Laravel’s queue system (`event(new PayboxIpnEvent(...))->dispatch()`). Process them via a `PayboxIpnJob` that updates orders or triggers fraud checks. Use `shouldQueue()` to defer non-critical actions, ensuring idempotency for retried notifications.
- What if Paybox’s API changes in the future? Will this bundle break?
- The bundle is partially maintained, with no new features but security/compatibility fixes. For Laravel, expect higher maintenance overhead. Monitor Paybox’s API docs and adapt your wrapper/service layer accordingly. Consider abstracting Paybox-specific logic into interfaces for easier migration.