- What Laravel versions does baks-dev/ozon-package support?
- The package requires Laravel 7.4+ (based on the version badge) and PHP 8.4+. Ensure your Laravel installation matches these requirements to avoid compatibility issues. Check the [README](https://github.com/baks-dev/ozon-package) for exact version constraints.
- How do I install and configure the package for Ozon API integration?
- Run `composer require baks-dev/ozon-package` to install, then execute `php bin/console baks:assets:install` to set up configuration files. Configure your Ozon API credentials in `.env` (e.g., `OZON_API_KEY`, `OZON_WEBHOOK_SECRET`) and run Doctrine migrations (`php bin/console doctrine:migrations:migrate`) to create Ozon-specific tables.
- Does this package support custom packaging rules (e.g., fragile items, bulk shipments)?
- The package follows Ozon’s standard workflows (e.g., single-package-per-order) and may require customization for bespoke rules. Extend the package’s logic via Laravel’s service container or override its `OzonOrderPackager` class to implement custom validation or packaging logic.
- How does the package handle Ozon API failures like rate limits or timeouts?
- The package likely includes retry mechanisms for transient failures, but explicit documentation is lacking. For critical production use, wrap API calls in Laravel queues (e.g., `OzonOrderPackagerJob`) and implement custom retry logic with exponential backoff using Guzzle’s middleware or Laravel’s `retry` helper.
- Will this package conflict with my existing Doctrine schema or order management system?
- The package uses Doctrine migrations for Ozon-specific tables (e.g., `ozon_orders`). To avoid conflicts, prefix its tables (e.g., `ozon_*`) or merge schemas manually. If your app already manages orders, consider creating view layers or abstracting the package’s repository behind an interface to decouple it.
- Can I test the package locally before deploying to production?
- Yes, run `php bin/phpunit --group=ozon-package` to execute the package’s test suite. Mock Ozon API responses using Laravel’s HTTP testing helpers or a service like [Vcr](https://github.com/vcr-php/vcr) to simulate API interactions without hitting Ozon’s endpoints.
- How do I handle Ozon webhook validation and processing in Laravel?
- The package likely includes a `OzonWebhookListener` that validates signatures (using `OZON_WEBHOOK_SECRET`) and dispatches events (e.g., `OzonOrderPackaged`). Extend the listener or create a custom event subscriber to process webhooks asynchronously via queues for scalability.
- Is the package secure for handling Ozon API credentials and payment data?
- Store credentials in Laravel’s `.env` or a secure secrets manager (e.g., AWS Secrets Manager). Validate all webhook payloads and sanitize inputs to prevent injection. For PCI compliance, ensure Ozon’s payment processing adheres to their DSP2 requirements—this package abstracts the API but doesn’t handle payment logic directly.
- What alternatives exist for Ozon order packaging in Laravel?
- For lightweight needs, use Ozon’s [official API](https://dev.ozon.ru/) with a custom Laravel service. For multi-marketplace support, consider [spatie/laravel-marketplace](https://github.com/spatie/laravel-marketplace) (though Ozon-specific). This package is specialized for Ozon but may lack flexibility for non-standard workflows.
- How can I extend or override the package’s behavior (e.g., custom label templates)?
- Use Laravel’s service container to bind interfaces (e.g., `OzonApiClientInterface`) to custom implementations. Override the package’s `OzonLabelGenerator` or `OzonOrderPackager` classes in your `AppServiceProvider`. For templates, extend the `baks:assets:install` command or publish the package’s assets via `php artisan vendor:publish`.