- How do I install the Yousign bundle in a Laravel project?
- Run `composer require com-company/yousign-bundle` in your project directory. The bundle supports Laravel 10+ and requires no additional setup beyond environment variables for API credentials.
- What Laravel versions does this bundle support?
- The bundle is fully compatible with Laravel 10 and above. No version-specific migrations or changes are required for the latest Laravel releases.
- Can I use this bundle for both Yousign API v2 and v3?
- Yes, the bundle supports both v2 and v3 via environment variables (`YOUSIGN_V2_*` and `YOUSIGN_V3_*`). Configure the appropriate URI and token for your use case.
- How do I configure webhook handling in Laravel?
- Add the bundle’s routes to `config/routes.yaml` under a custom prefix (e.g., `/api/subscription/yousign`). Then bind event handlers in `config/packages/yousign.yaml` using the `EventHandlerInterface` for payload processing.
- Does this bundle support custom date signature positioning?
- Yes, the latest version includes support for `date_signature_position` via the API client. Pass it as an array in your document payload: `['date_signature_position' => ['x' => 100, 'y' => 200]]`.
- How do I handle webhook errors in Laravel?
- Implement the `onError` method in your `EventHandlerInterface` class. The bundle will automatically route Yousign exceptions to this handler for logging or retries.
- Are there any breaking changes when upgrading to this bundle?
- No breaking changes are introduced. The new `date_signature_position` feature is additive, and existing configurations (e.g., `config/yousign.php`) remain unchanged.
- Can I test webhook payloads locally before production?
- Yes, use the staging API URI (`YOUSIGN_V3_URI=https://api-sandbox.yousign.app/v3/`) in your `.env` file. The bundle processes webhooks identically in dev and prod environments.
- What if I need to extend the bundle for custom Yousign events?
- Extend the `EventHandlerInterface` and bind your custom handler in `config/packages/yousign.yaml`. The bundle’s default handler catches unregistered events, but you can override this behavior.
- How do I log Yousign API responses for debugging?
- Use Laravel’s logging system to track requests and responses. For example, log the `date_signature_position` payload: `Log::debug('Yousign position', ['position' => $request->date_signature_position])`.