johnrivera7/filament-transbank-webpay

Filament plugin for Transbank Webpay Plus (Chile) — credentials UI, logos, create/commit/refund helpers.

Maintainers

Package info

github.com/Johnrivera7/filament-transbank-webpay

pkg:composer/johnrivera7/filament-transbank-webpay

Transparency log

Statistics

Installs: 0

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v1.0.0 2026-08-14 05:28 UTC

This package is auto-updated.

Last update: 2026-08-14 05:32:49 UTC


README

Transbank Webpay Filament plugin

FILAMENT 4.x FILAMENT 5.x

Latest Version on Packagist Total Downloads License GitHub Stars GitHub Issues Latest release PHPUnit tests

PHP 8.2+ Laravel 11+ Livewire 3/4 Filament 4/5 Built with Transbank SDK MIT

A Filament plugin that integrates Transbank Webpay Plus (Chile) into your Laravel application: credentials UI, logos, POST token_ws redirects, and create / commit / status / refund helpers on the official Transbank SDK.

Open source (MIT). Badges like Buy license / Private Composer package / Proprietary documentation apply to paid Filament plugins only — this package is free on Packagist.

Requirements

Stack Versions
PHP 8.2+
Laravel 11.28+ / 12+
Filament 4.x or 5.x
Livewire 3.x (with Filament 4) / 4.x (with Filament 5)

Installation

composer require johnrivera7/filament-transbank-webpay

Optional publishes:

php artisan vendor:publish --tag=filament-transbank-webpay-config
php artisan vendor:publish --tag=filament-transbank-webpay-assets

Register the plugin in your PanelProvider:

use JohnRivera7\FilamentTransbankWebpay\FilamentTransbankWebpayPlugin;

public function panel(Panel $panel): Panel
{
    return $panel
        ->plugin(
            FilamentTransbankWebpayPlugin::make()
                ->navigationGroup('Pagos')
                ->navigationSort(40)
        );
}

Multi-tenant (recommended)

use JohnRivera7\FilamentTransbankWebpay\Support\TransbankCredentials;

->plugin(
    FilamentTransbankWebpayPlugin::make()
        ->credentialsUsing(function (): TransbankCredentials {
            $cfg = /* read from your DB */;

            return TransbankCredentials::fromArray($cfg);
        })
        ->persistCredentialsUsing(function (TransbankCredentials $credentials): void {
            /* persist $credentials->toArray() */
        })
)

Single-tenant (.env)

TRANSBANK_ENABLED=true
TRANSBANK_COMMERCE_CODE=597055555532
TRANSBANK_API_KEY=...
TRANSBANK_ENVIRONMENT=integration

Without persistCredentialsUsing(), the settings page does not write credentials to disk—wire persistence via the callbacks above (or manage .env yourself).

Gateway usage

use JohnRivera7\FilamentTransbankWebpay\FilamentTransbankWebpayPlugin;
use JohnRivera7\FilamentTransbankWebpay\Services\WebpayPlusGateway;

$gateway = FilamentTransbankWebpayPlugin::get()->gateway();

$payment = $gateway->create(
    buyOrder: 'ORD123',
    sessionId: 'sess-1',
    amountClp: 15990,
    returnUrl: route('payments.transbank.return'),
);

return response()->view('filament-transbank-webpay::payment-redirect', [
    'url' => $payment['redirect_url'],
    'fields' => $payment['redirect_fields'], // ['token_ws' => ...]
]);

On the return URL:

if (WebpayPlusGateway::isAbortReturn($request->all())) {
    $reason = WebpayPlusGateway::abortReason($request->all()); // aborted|timeout
}

// If token_ws is present (even alongside TBK_*), call commit:
$result = $gateway->commit($request->all());

Reusable form schema

use JohnRivera7\FilamentTransbankWebpay\Forms\Components\TransbankCredentialsSchema;

$schema->components([
    ...TransbankCredentialsSchema::make('payments.transbank'),
]);

Integration notes

  • Webpay Plus requires a POST redirect with token_ws (not a GET query string).
  • Integration sandbox: commerce 597055555532 + Transbank’s public integration API key.
  • Production: real commerce code + API Key Secret after Transbank validation.
  • Abort/timeout returns send TBK_* without token_ws. If both arrive, token_ws wins—run commit.

Testing

composer install
composer test

Security

See SECURITY.md.

Changelog

See CHANGELOG.md.

License

MIT