e2k/payment-bundle
Symfony bundle for payment gateway abstraction with native CentralBill support via a pluggable interface. Configure gateways through YAML and environment variables, then integrate payments quickly.
Symfony bundle for payment gateway abstraction. Natively supports CentralBill and extends its functionality by implementing an interface.
composer require e2k/payment-bundle
composer require e2k/payment-bundle
Save the bundle manually:
// config/bundles.php
return [
E2K\PaymentBundle\E2KPaymentBundle::class => ['all' => true],
];
Create the configuration file:
# config/packages/e2k_payment.yaml
e2k_payment:
default_gateway: '%env(PAYMENT_DEFAULT_GATEWAY)%'
payment_route_prefix: '%env(PAYMENT_ROUTE_PREFIX)%'
gateways:
centralbill:
enabled: true
application_id: '%env(CENTRALBILL_APPLICATION_ID)%'
application_secret: '%env(CENTRALBILL_APPLICATION_SECRET)%'
web_pay_base_url: '%env(CENTRALBILL_WEB_PAY_BASE_URL)%'
callback_url: '%env(CENTRALBILL_CALLBACK_URL)%'
redirect_url: '%env(CENTRALBILL_REDIRECT_URL)%'
Add the environment variables:
PAYMENT_DEFAULT_GATEWAY=centralbill
PAYMENT_ROUTE_PREFIX=/payments
CENTRALBILL_APPLICATION_ID=your-app-id
CENTRALBILL_APPLICATION_SECRET=your-secret
CENTRALBILL_WEB_PAY_BASE_URL=https://your-app.com/payment/webpay
CENTRALBILL_CALLBACK_URL=https://your-app.com/payment/callback/centralbill
CENTRALBILL_REDIRECT_URL=https://your-app.com/payment/return
See docs/index.md.
How can I help you explore Laravel packages today?