Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Pagamento Bundle

Pagamento Bundle Laravel Package

brazilianfriendsofsymfony/pagamento-bundle

Bundle Symfony para agregar funcionalidades comuns a meios de pagamento no Brasil, inspirado no JMSPaymentCoreBundle. Inclui utilitários e Twig helper para opções de parcelamento (juros, limites, templates) e suporte a formulários de escolha de pagamento.

View on GitHub
Deep Wiki
Context7

Este bundles tem por objetivo agregar funcionalidades comuns a vários métodos de pagamento.

Frequently asked questions about Pagamento Bundle
Can I use BFOSPagamentoBundle directly in Laravel without Symfony?
No, the bundle is Symfony-specific and requires abstraction for Laravel. You’ll need to extract core logic (e.g., `ParcelamentoUtils`) into a Laravel package, replace Symfony Forms with Form Requests or Livewire, and adapt Twig functions to Blade directives. The Symfony Bridge or Lumen may help bridge gaps.
How do I handle payment gateway integration (e.g., PagSeguro, MercadoPago) in Laravel?
The bundle assumes Symfony’s `JMSPaymentCoreBundle` patterns, so you’ll need to build a Laravel-compatible wrapper. For PagSeguro, use the official Laravel SDK; for MercadoPago, leverage Spatie’s Payment Gateways or create a custom Service Provider. The bundle’s `ParcelamentoUtils` can still handle parceling logic.
What’s the best way to migrate jQuery/RequireJS dependencies to Laravel’s modern stack?
Replace jQuery with Alpine.js for lightweight interactivity or use Inertia.js for full-stack reactivity. RequireJS can be dropped in favor of Laravel Mix/Vite’s ES Modules. If dynamic UI is critical, rewrite the parceling logic using Alpine.js components or Vue/React hooks.
Does this bundle support Laravel’s Blade templating instead of Twig?
Yes, but you’ll need to rewrite the Twig functions (e.g., `bfos_pagamento_opcoes_parcelamento()`) as Blade directives or use the TwigBridge package to integrate Twig into Laravel. Example: Convert Twig logic to a Blade component or helper like `@installmentOptions($config, $value)`.
How do I configure parceling rules (e.g., max installments, interest rates) in Laravel?
The bundle’s `ParcelamentoConfiguracao` class defines rules like `setQuantidadeMaximaParcelas(12)` or `setJurosParcelamento(1.99)`. In Laravel, instantiate this class in a Service Provider or Form Request, then pass it to your parceling logic. Example: `$config = new ParcelamentoConfiguracao(); $config->setParcelamentoHabilitado(true);`
Are there Laravel alternatives for payment parceling with better support?
Yes. For global payments, use Laravel Cashier (Stripe) or Spatie’s Payment Gateways. For Brazilian-specific needs, consider forking this bundle or evaluating MercadoPago’s Laravel SDK. If parceling is a core feature, a custom package built on Spatie’s Gateways may be more maintainable.
How do I handle payment secrets (e.g., API keys) securely in production?
Avoid hardcoding secrets like `e37secret`. Use Laravel’s `.env` file for sensitive data (e.g., `PAGSEGURO_SECRET=your_key`). Inject these into your Service Providers or Form Requests via `config()` or `env()`. Never commit `.env` to version control.
Can I test the parceling logic without connecting to real payment gateways?
Yes. Mock the gateway dependencies in PHPUnit/Pest tests. For example, use Laravel’s `Mockery` to fake the `ParcelamentoUtils` or gateway responses. Test edge cases like `ValorMinimoParcela` or `QuantidadeMaximaParcelas` with assertions on the returned array of installment options.
What Laravel versions does this bundle support, and are there breaking changes?
The bundle is Symfony-focused, so Laravel compatibility depends on your abstraction layer. Target Laravel 9+ for modern features like Symfony Bridge or Livewire. Breaking changes may arise from Symfony’s DI updates; monitor the bundle’s GitHub for Symfony version bumps.
How do I extend this bundle to support additional payment methods (e.g., PicPay, Itau Shopline)?
Create a plugin system in Laravel. Build a base `PaymentGateway` interface, then implement adapters for each provider (e.g., `PicPayGateway`). Use Laravel’s Service Container to bind these classes. The bundle’s `ParcelamentoUtils` can remain agnostic to the gateway, focusing only on installment logic.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver
mkwebdesign/filament-watchdog-v5
renatomarinho/laravel-page-speed
zedmagdy/filament-business-hours
renatovdemoura/blade-elements-ui
devgeek/beacon-admin
benjamin-rqt/data-watcher-bundle
atriumphp/atrium
sandermuller/package-boost-laravel
sandermuller/boost-skills
redaxo/core
yusufgenc/filament-api-forge
l3aro/rating-star-for-filament
leek/filament-subtenant-scope
anil/file-picker
broqit/fields-ai