Flow
CommunityIntegrate Flow (Chile) payments into Filament with a credentials UI, HMAC signing helpers, and checkout redirects.
filament/
namespace. Review the source and install at your own risk. Found
malware or an unresolved security issue the author won't
address?
Report it
.
Author:
John Michael Rivera Gonzalez
Documentation
- Requirements
- Installation
- Gateway usage
- Reusable form schema
- Integration notes
- Testing
- Security
- Changelog
- License
A Filament plugin that integrates Flow payments (Chile) into your Laravel application: credentials UI, HMAC-SHA256 signing, checkout redirects (url?token=), and create / status / refund helpers on the Flow REST API.
Open source (MIT). Free on Packagist.
#Requirements
| Stack | Versions |
|---|---|
| PHP | 8.2+ |
| Laravel | 11.28+ / 12+ / 13+ |
| Filament | 4.x or 5.x |
| Livewire | 3.x (with Filament 4) / 4.x (with Filament 5) |
#Installation
composer require johnrivera7/filament-flow
Optional publishes:
php artisan vendor:publish --tag=filament-flow-config
Register the plugin in your PanelProvider:
use JohnRivera7\FilamentFlow\FilamentFlowPlugin;
public function panel(Panel $panel): Panel
{
return $panel
->plugin(
FilamentFlowPlugin::make()
->navigationGroup('Pagos')
->navigationSort(41)
);
}
#Multi-tenant (recommended)
use JohnRivera7\FilamentFlow\Support\FlowCredentials;
->plugin(
FilamentFlowPlugin::make()
->credentialsUsing(function (): FlowCredentials {
$cfg = /* read from your DB */;
return FlowCredentials::fromArray($cfg);
})
->persistCredentialsUsing(function (FlowCredentials $credentials): void {
/* persist $credentials->toArray() or $credentials->toLegacyConfig() */
})
)
#Single-tenant (.env)
FLOW_ENABLED=true
FLOW_API_KEY=...
FLOW_SECRET_KEY=...
FLOW_ENVIRONMENT=sandbox
# Optional override:
# FLOW_API_URL=https://sandbox.flow.cl/api
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\FilamentFlow\FilamentFlowPlugin;
$gateway = FilamentFlowPlugin::get()->gateway();
$payment = $gateway->create(
commerceOrder: 'ORD-123',
subject: 'Reserva hotel',
amount: 15990,
email: 'guest@example.com',
urlConfirmation: route('payments.flow.confirm'),
urlReturn: route('payments.flow.return'),
);
// Redirect the payer (GET url?token=...)
return redirect()->away($payment['redirect_url']);
// Or use the branded interstitial view:
return response()->view('filament-flow::payment-redirect', [
'url' => $payment['redirect_url'],
]);
On urlConfirmation / urlReturn (Flow POSTs token):
use JohnRivera7\FilamentFlow\Support\FlowPaymentReconciliation;
$result = $gateway->confirm($request->except(['amount', 'total', 'monto']));
// $result['paid'] === true when status === 2
// $result['amount'] comes from Flow — never from the browser
$check = FlowPaymentReconciliation::compare($expectedAmountFromYourDb, $result['amount']);
if ($check['settlement'] === FlowPaymentReconciliation::SETTLEMENT_PARTIAL) {
// Register as deposit/abono — do NOT mark the order fully paid
}
if ($check['settlement'] === FlowPaymentReconciliation::SETTLEMENT_NONE) {
// Fail closed (missing/zero amount from Flow)
}
Refund:
$refund = $gateway->refund(
refundCommerceOrder: 'REF-123',
receiverEmail: 'guest@example.com',
amount: 15990,
urlCallback: route('payments.flow.refund'),
commerceTrxId: 'ORD-123', // or flowTrxId
);
#Reusable form schema
use JohnRivera7\FilamentFlow\Forms\Components\FlowCredentialsSchema;
$schema->components([
...FlowCredentialsSchema::make('payments.flow'),
]);
#Integration notes
- Every request must be signed: sort params alphabetically, concatenate
key.value, thenhash_hmac('sha256', …, secretKey)→ parameters. See Flow API. - Checkout redirect: concatenate
url + "?token=" + token. - Sandbox base URL:
https://sandbox.flow.cl/api· Production:https://www.flow.cl/api - Payment status
2= paid. - After async confirmation, call
payment/getStatuswith the receivedtoken. - Amount security: compute and store the charge on the server when creating the payment. On callback, reconcile with
FlowPaymentReconciliation. Underpayment must remain a deposit (abono), not a full settlement.
#Testing
composer install
composer test
#Security
See SECURITY.md.
#Changelog
See CHANGELOG.md.
#License
MIT
The author
I am a full-stack developer focused on building reliable web platforms for education, enterprise, and business operations. I work mainly with Laravel and Filament, creating admin panels, reusable packages, and integrations that solve real production needs.
I also have a background in cybersecurity as an ethical hacker, which shapes how I design and review software: secure authentication flows, proper access control, hardening production environments, and thinking about real-world attack surfaces before they become problems.
I contribute to the Filament ecosystem by developing open-source panel plugins, with a strong focus on authentication, enterprise SSO, and tools that help teams manage complex workflows from a clean admin interface. I follow official Filament standards and aim to publish practical, well-documented packages that developers can adopt with confidence.
Beyond Filament, I develop Moodle plugins and customizations for e-learning platforms, including integrations, Microsoft Teams modules, learning activities, custom course formats, and automated cloud backup solutions. I also build Laravel applications for insurance, commercial, corporate, and agricultural management systems.
My infrastructure work includes high-availability setups with PostgreSQL clusters, GlusterFS, Nginx, and Consul, as well as Odoo ERP and POS implementations. I enjoy working across the full stack—from backend architecture and DevOps automation to polished admin interfaces and end-user workflows.
I publish open-source packages on Packagist and GitHub, and I plan to keep expanding my contributions to Filament with new panel plugins over time.
From the same author
SAML2 Okta
Adds SAML2 single sign-on to your Filament panel with a full admin UI for IdP configuration, certificate management, user provisioning, SAML field mapping, and a customizable login button for Okta, Azure AD, Google Workspace, Auth0, and other standard identity providers.
Author:
John Michael Rivera Gonzalez
Transbank Webpay
Integrate Transbank Webpay Plus payments into Filament with a credentials UI, official SDK helpers, and POST token_ws redirects.
Author:
John Michael Rivera Gonzalez
Customizable Dashboard Widgets
Let users customize Filament dashboards: drag, resize, and arrange widgets on a permission-aware collage grid.
Author:
John Michael Rivera Gonzalez
Featured Plugins
A selection of plugins curated by the Filament team
Custom Dashboards
Let your users build and share their own dashboards with a drag-and-drop interface. Define your data sources in PHP and let them do the rest.
Filament
Spotlight Pro
Browse your Filament Panel with ease. Filament Spotlight Pro adds a Spotlight like Command Palette to your Filament Panel.
Dennis Koch
Advanced Tables (formerly Filter Sets)
Supercharge your tables with powerful features like user-customizable views, quick filters, multi-column sorting, advanced table searching, convenient view management, and more. Compatible with Resource Panel Tables, Relation Managers, Table Widgets, and Table Builder!
Kenneth Sese