johnrivera7/filament-transbank-webpay
Filament plugin for integrating Transbank Webpay into Laravel admin panels. Adds payment handling, transaction management, and configuration for Webpay Plus, helping Chilean stores accept and track online payments directly from Filament.
illuminate/contracts ^13.0) and documents the Laravel 11 / 12 / 13 matrix. There are no breaking changes in the 1.0.x line, so composer require johnrivera7/filament-transbank-webpay:^1.0 is the safe constraint — it will pull 1.0.2 while staying inside the patch range.php artisan vendor:publish --tag="filament-transbank-webpay-config"
php artisan vendor:publish --tag="filament-transbank-webpay-migrations"
php artisan migrate
.env, not in the config file. You need the commerce code, API key, and an environment switch (integration vs production). Use Transbank's published integration credentials for local work so you never touch live keys in development.PanelProvider (->plugins([...])) — see the README for the exact plugin class name in this version.orders/payments row (status = initiated, plus token, buy_order, session_id, amount) before redirecting. The return handler then transitions that row. Never rely on session state alone to know what the user was paying for.App\Services\WebpayCheckout with create() and commit() methods and unit-test those.auth middleware group, and look the order up by the returned token_ws, not by auth()->user(). If your app requires a logged-in user to view the result page, handle "user looks logged out" deliberately (see Gotchas).lockForUpdate() on the payment record) and short-circuit if the status is already committed. This protects against double-clicks, browser back-then-refresh, and Transbank retries.TextInput or a formatted currency field — cast at the boundary and validate min:50 (Transbank's floor) to fail early rather than at the gateway.Action on a resource or a custom page is fine. For a real checkout with cart, customer data, and a result screen, build a custom Filament page (or a plain Blade route) and keep the panel for reconciliation — the panel is where you want an admin view of payment statuses, not where you want the customer's card flow to live.expose, ngrok, or similar and set APP_URL to the tunnel host, or the redirect will silently land on a dead localhost URL and the commit will never fire.initiated, committed, authorized, failed, aborted — plus a raw_response JSON column. Transbank's response codes are more granular than "paid / not paid" and you will want them six months later during a finance reconciliation.return_url without your session token. Depending on how the package registers its route you may need to exclude the return path from VerifyCsrfToken, or simply not use your own controller for it. If you see a 419 on return, this is why.SameSite and your session driver). Never assume auth()->check() inside the return handler. If you need the user context, embed a reference in session_id and re-authenticate or show a "your payment succeeded, please log in" screen.abort_unless(config('...environment') === 'production', ...) in a production-only service provider) so a missing env var fails loudly instead of creating fake payments.token_ws is a bearer-style credential for that transaction. Keep it out of Log::info, out of exception messages, and out of Filament's activity log if you have one enabled.illuminate/contracts ^13.0 constraint is necessary but not sufficient, since Filament itself gates the panel APIs. Also re-run composer update --with-all-dependencies rather than a plain require, otherwise Composer may keep you on the older contract and you'll wonder why the upgrade "didn't take."Http::fake()) for anything beyond the single happy-path smoke test. Live-credential tests in CI are a common source of leaked keys.How can I help you explore Laravel packages today?