- Does this package support SOFORT’s migration to Stripe’s API (SOFORT v2)?
- The package appears to target SOFORT v1, as evidenced by the `projectId` field addition. If you’re using Stripe’s SOFORT integration, verify whether `projectId` is still required or if it’s a legacy field that can be omitted. Test API responses to confirm compatibility.
- How do I install `sofort/sofortlib-php` in a Laravel project?
- Run `composer require sofort/sofortlib-php:3.*` to install the package. No additional Laravel-specific setup is required, but ensure your Laravel version (pre-10) and PHP version (pre-8.2) align with the package’s dependencies. Check for conflicts with Guzzle or Illuminate updates.
- Is this package compatible with Laravel 10 or PHP 8.2+?
- No, the package lacks support for Laravel 10 or PHP 8.x features like typed properties. If you’re using modern Laravel, consider wrapping the package in a custom service or forking it to add compatibility. Test thoroughly for silent failures due to API version mismatches.
- How do I configure the `projectId` field if it’s no longer required by SOFORT/Stripe?
- Add a nullable `project_id` to your Laravel config (e.g., `config/sofort.php`) and use null coalescing when initializing the gateway. Example: `$options = $projectId ? ['projectId' => $projectId] : [];` This ensures backward compatibility while avoiding errors if the field is ignored.
- Can I use this package for iDEAL payments in Laravel?
- Yes, the package includes iDEAL-specific features like forward URL generation and checksum creation. Follow the `/examples` directory for usage patterns. However, ensure your Laravel environment supports the package’s PHP version (pre-8.2) and test iDEAL transactions in a staging environment first.
- What happens if the SOFORT/Stripe API rejects the `projectId` field in future updates?
- The package may fail silently or return 4xx errors if `projectId` is deprecated. Monitor Stripe’s SOFORT documentation for changes and consider forking the package to add deprecation warnings or make the field optional. A major version bump may be needed if Stripe drops support entirely.
- Are there Laravel-specific features like service providers or facades included?
- No, the package doesn’t include Laravel-specific abstractions like facades or service providers. You’ll need to manually bind the `SofortGateway` class to Laravel’s container. Example: `$this->app->singleton(SofortGateway::class, fn($app) => new SofortGateway(...));`
- Does this package support webhooks or Laravel events for payment status updates?
- No, the package doesn’t integrate with Laravel’s event system or webhook handlers. You’ll need to implement custom logic to process SOFORT/Stripe webhooks separately, such as using Laravel’s `HandleIncomingWebhook` trait or a queue job for async processing.
- How do I test transactions or refunds before going to production?
- Use SOFORT’s sandbox environment (documented in their [API guide](https://www.sofort.com/integrationCenter-eng-DE/integration/API-SDK/)) to test payments, refunds, and iDEAL flows. The package includes PHPUnit tests in the `/test` directory, which you can extend for custom validation logic.
- What are the alternatives to this package for Laravel SOFORT/Stripe integration?
- For modern Laravel projects, consider Stripe’s official PHP library (`stripe/stripe-php`), which natively supports SOFORT payments and integrates with Laravel’s service container. Alternatively, use Guzzle directly for API calls if you need full control over requests and responses.