- How do I install and configure birim/laravel-payone in my Laravel project?
- Run `composer require birim/laravel-payone` and publish the config with `php artisan vendor:publish --tag=laravel-payone`. The config file will appear in `config/payone.php`, where you can set your API credentials, mode (test/live), and other defaults like encoding and merchant details.
- Which Laravel versions does this package support?
- The package does not explicitly state Laravel version support in its documentation, but the last release was in 2022. Check the `composer.json` for the minimum Laravel version requirement (likely Laravel 5.x or 6.x) and test compatibility with your version before use.
- How do I send a preauthorization request using the Payone facade?
- Use `Payone::sendRequest()` with a payload like `['request' => 'preauthorization', 'clearingtype' => 'cc', 'amount' => 1500, 'currency' => 'EUR', ...]`. Include required fields such as `reference`, `lastname`, `country`, and redirect URLs (`successurl`, `errorurl`, `backurl`).
- Can I override PAYONE configuration at runtime, like the Sub-Account ID?
- Yes, use setters like `Payone::setSubAccountId(12345)` to override values dynamically. This is useful for multi-tenant applications or when handling different merchant accounts within the same request.
- Does this package support PAYONE webhooks for asynchronous notifications?
- The package provides a webhook handler, but you’ll need to manually route PAYONE’s notifications to `Route::post('/payone/webhook')`. Secure the endpoint with HMAC validation and extend the handler if you need custom logic, such as retrying failed notifications.
- How do I handle errors returned by PAYONE’s API?
- PAYONE’s API returns non-standard error formats, and the package’s `PayoneException` is basic. You may need to extend the exception handling or map errors manually for user-friendly messages. Check the raw response with `Payone::getLastResponse()` for debugging.
- Is this package suitable for production use? What about security?
- The package is not actively maintained (last release in 2022) and lacks security audits. For production, consider wrapping it in a custom service layer to isolate changes or fork the repo to address vulnerabilities. Ensure PCI compliance by using PAYONE’s tokenization and avoiding direct storage of card data.
- Can I use this package alongside Laravel Cashier for subscriptions?
- Yes, but you’ll need to manually map PAYONE’s recurring payments (e.g., `createaccess`) to Cashier’s models. The package doesn’t provide built-in Cashier integration, so you’ll handle subscription logic in your application layer.
- How do I test this package with PAYONE’s sandbox environment?
- Set `'mode' => 'test'` in the `config/payone.php` file and use PAYONE’s sandbox credentials. Mock API responses in tests using Laravel’s `Http::fake()` or create test cases with the sandbox’s known responses for preauthorization, createaccess, and other flows.
- What if I need features like 3D Secure 2.0 or multi-currency support?
- The package doesn’t handle 3D Secure 2.0 (you’ll need to integrate PAYONE’s JavaScript SDK directly) or multi-currency regional compliance out of the box. For advanced features, extend the `PayoneService` class or override methods to customize behavior for your use case.