- Can I use baks-dev/payment with Laravel 9 or older versions?
- No, the package requires PHP 8.4+ and Laravel 10+. If you’re on an older version, you’ll need to upgrade or use polyfills like `laravel/framework v10.x` for compatibility. Test thoroughly, as some Laravel 10 features (e.g., new service container) may not be fully backward-compatible.
- How do I integrate Stripe or PayPal with this package?
- The package abstracts payment methods but doesn’t include built-in gateways like Stripe or PayPal. You’ll need to create custom adapters by implementing the `PaymentMethod` interface and binding them to Laravel’s service container. Follow the event-driven architecture to hook into flows like authorization or refunds.
- Will this package work with Eloquent models, or do I need Doctrine?
- The package uses Doctrine migrations by default, but you can coexist with Eloquent by using `doctrine/dbal` for migrations while querying via Eloquent. For a seamless experience, consider converting Doctrine migrations to Eloquent syntax or using a hybrid approach (DBAL for migrations, Eloquent for queries).
- How do I handle payment webhooks asynchronously in Laravel?
- The package lacks built-in webhook management, so you’ll need to integrate Laravel’s queue system (e.g., Horizon) for async processing. Use idempotency keys to handle duplicate deliveries, and ensure critical operations like refunds or authorizations are queue-based to avoid blocking the request lifecycle.
- Are there any known conflicts with Laravel’s Artisan commands?
- Yes, the `baks:assets:install` command may conflict with Laravel’s `artisan`. Mitigate this by aliasing the command in `AppServiceProvider` (e.g., `artisan payment:install`) or renaming it to avoid namespace collisions. Check the package’s console commands for additional conflicts.
- Does this package support PCI-DSS compliance out of the box?
- No, the package doesn’t explicitly mention PCI-DSS compliance. You’ll need to audit its handling of sensitive data (e.g., card numbers) and implement additional measures like Laravel’s encryption (configured in `config/app.php`) or field-level encryption for PCI compliance.
- How do I test payment flows in a Laravel environment?
- The package includes unit tests (`--group=payment`), but lacks Laravel-specific integration tests. Manually validate critical flows (e.g., webhooks, refunds) and add integration tests for Laravel scenarios like authentication or queue processing. Use Laravel’s testing tools (e.g., `Http::fake()`) to simulate payment operations.
- Can I extend or override payment logic without modifying the package?
- Yes, the package’s event-driven architecture and `PaymentMethod` interface allow you to override core logic via Laravel’s service bindings or event listeners. For example, you can inject custom fraud checks or dynamic pricing rules without altering the package’s source code.
- What are the performance implications of using this package in high-traffic applications?
- The package’s scalability under load (e.g., >1K TPS) is untested. To mitigate risks, process all payment operations asynchronously via Laravel queues (e.g., Horizon) and conduct load testing to validate performance. Synchronous API calls could block Laravel’s request lifecycle, so async processing is critical.
- Are there alternatives to baks-dev/payment for Laravel payment processing?
- Yes, alternatives include Laravel Cashier (for Stripe), Spatie’s `laravel-payments` (multi-gateway), or Tighten’s `laravel-payments` (modular). These packages offer built-in gateway support and may better suit global deployments. Evaluate based on your need for customization (e.g., B2B SaaS) versus out-of-the-box functionality.