- Can I use JMSPaymentCoreBundle directly in Laravel, or is it strictly for Symfony?
- JMSPaymentCoreBundle is designed for Symfony, not Laravel. However, you can integrate it into Laravel by leveraging Symfony’s components (like Dependency Injection) via packages like *symfony/console-bridge* or *symfony/dependency-injection*. Alternatively, consider Laravel-native alternatives like *laravel-cashier* or *omnipay* for seamless compatibility.
- What Laravel versions does this bundle support, and are there PHP 8.x compatibility issues?
- This bundle is Symfony-focused, not Laravel-specific, but it officially supports PHP 5.6+. For PHP 8.x, you’ll need to replace deprecated functions (e.g., *mcrypt*) with alternatives like *defuse/php-encryption* and manually patch Symfony 6.x/7.x dependencies. Test thoroughly—no official Laravel integration exists.
- How do I configure encryption for PCI compliance in Laravel with this bundle?
- Enable encryption via the bundle’s configuration (`jms_payment_core: encryption: enabled: true`) and specify a provider like *defuse/php-encryption*. Store encryption keys securely in Laravel’s `.env`. Note: Encryption is optional by default, so ensure PCI DSS compliance by validating your setup with a security audit.
- Which payment gateways are supported, and how do I add a custom one (e.g., Adyen)?
- The bundle supports Stripe, PayPal, Mollie, and others via third-party Symfony bundles (e.g., *jms/payment-stripe-bundle*). For custom gateways like Adyen, implement the `PaymentPluginInterface` and register it as a service. Check the [backends documentation](http://jmspaymentcorebundle.readthedocs.io) for implementation details.
- Does this bundle work with Laravel’s queue system for async payment processing?
- No, this bundle is Symfony-centric and lacks native Laravel queue support. To use it with Laravel queues, wrap payment operations in a job (e.g., `dispatch(new ProcessPaymentJob($payment))`) and handle retries via Laravel’s queue workers. The bundle’s retry logic won’t integrate directly.
- How do I migrate existing payment data from a legacy system to this bundle’s Doctrine entities?
- Export your legacy payment data (e.g., transactions, refunds) and import it using Doctrine migrations or raw SQL. The bundle provides entities like `Payment` and `Transaction`—map your old schema to these. Backup your data first, as manual adjustments may be needed for field mismatches.
- Are there performance concerns with storing all transactions in the database?
- Yes, storing every transaction/refund can bloat your database. Mitigate this by archiving old data to a separate table or storage (e.g., S3) via Laravel’s scheduler. The bundle doesn’t include archiving tools, so implement custom logic or extend its entities.
- What’s the best way to handle payment failures or retries in a Laravel app using this bundle?
- Use the bundle’s built-in retry logic by configuring `jms_payment_core: retry_strategy` in Symfony’s config. For Laravel, log failures to a queue (e.g., `failed_jobs` table) and retry via a cron job or Laravel’s `retryAfter` mechanism. Combine this with webhook validation for async confirmations.
- Is there a Laravel wrapper or alternative package that’s actively maintained?
- For Laravel, consider *laravel-cashier* (Stripe-focused), *omnipay* (multi-gateway), or *spatie/laravel-payments* (abstracted API). These are Laravel-native, actively maintained, and avoid Symfony’s compatibility risks. If you’re tied to Symfony components, fork this bundle and update it for modern Laravel.
- How do I test payment workflows locally without hitting real gateways?
- Use the bundle’s mock payment backends or create a custom `PaymentPluginInterface` implementation that simulates responses. For Laravel, mock HTTP clients (e.g., Guzzle) in tests to intercept calls to gateways. The bundle’s test suite (Symfony-focused) may not cover Laravel-specific edge cases.