EventDispatcher, Kernel, and Console components makes it non-portable without a rewrite.generateUrl()).PayplugIPNEvent.EventDispatcher → Laravel’s Events system.Console commands → Laravel’s Artisan commands.Routing → Laravel’s Route service provider.payplug/payplug-php could be used instead, with custom logic for IPN handling.payplug/payplug-php.| Component | Symfony2 Fit | Laravel Fit | Notes |
|---|---|---|---|
| Bundle Registration | ✅ Native (AppKernel.php) |
❌ Not applicable | Laravel uses config/app.php for providers. |
| Routing | ✅ YAML-based (routing.yml) |
❌ Requires custom middleware | Laravel uses routes/web.php. |
| Event System | ✅ kernel.event_listener tag |
✅ Events::listen() |
Event payloads differ (Symfony’s PayplugIPNEvent vs. Laravel’s Event). |
| Console Commands | ✅ payplug:account:update |
❌ Requires custom Artisan commands | Laravel’s CLI structure differs. |
| Dependency Injection | ✅ Symfony’s DI container | ✅ Laravel’s IoC container | Service IDs and wiring would need adaptation. |
| Configuration | ✅ config.yml/parameters.yml |
✅ config/payplug.php |
Key names (e.g., payplugPublicKey) may need mapping. |
composer require alcalyn/payplug-bundle:1.x
// app/AppKernel.php
new Alcalyn\PayplugBundle\AlcalynPayplugBundle(),
# app/config/routing.yml
alcalyn_payplug:
resource: "@AlcalynPayplugBundle/Resources/config/routing.yml"
prefix: /
# app/config/parameters.yml
payplug_account_payplugPublicKey: "%env(PAYPLUG_PUBLIC_KEY)%"
payplug_account_yourPrivateKey: "%env(PAYPLUG_PRIVATE_KEY)%"
php app/console payplug:account:update
event.payplug.ipn.IPN class if needed (e.g., for custom fields).payplug/payplug-php directly.// app/Providers/PayplugServiceProvider.php
namespace App\Providers;
use Payplug\Payplug;
class PayplugServiceProvider extends ServiceProvider {
public function register() {
$this->app->singleton('payplug', function () {
return new Payplug(config('payplug.public_key'), config('payplug.private_key'));
});
}
}
Route::post('/payplug/ipn', ...).$payplug = app('payplug');
$payment = $payplug->createPayment([
'amount' => 1600,
'currency' => 'EUR',
'description' => 'Order #123',
'authorization_mode' => 'regular',
]);
return redirect($payment->getUrl());
EventDispatcher changes).payplug/payplug-php.payplug:account:update, payplug:generate:url).How can I help you explore Laravel packages today?