iLeben includes a complete multi-gateway payment system built on Laravel 12 and Filament 5. Three gateways are supported out of the box — Transbank Webpay (Chile card payments), Mercado Pago (LATAM), and Manual (bank transfer/offline) — all exposed through a singleDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/scooller/Leben-site/llms.txt
Use this file to discover all available pages before exploring further.
PaymentGateway facade that hides driver-specific details from calling code.
Supported Gateways
| Gateway | Provider | Supported Region | Flow Type |
|---|---|---|---|
transbank | Transbank Webpay Plus / Mall | Chile (CLP) | Synchronous redirect — POST return |
mercadopago | Mercado Pago | LATAM (multi-currency) | Async webhook + redirect |
manual | Bank transfer / offline | Any | Admin-approval workflow |
Architecture
The payment system is organized around three core components:PaymentGatewayInterface— The shared contract every gateway driver must implement (createTransaction,confirmTransaction,getTransactionStatus,refundTransaction,processWebhook,isEnabled,getName,validateConfiguration).PaymentGatewayManager— A factory service registered aspayment.gatewayin the container. It resolves and caches driver instances, reads gateway configuration fromconfig/payments.php, and exposesdriver(),forPayment(),available(), andisAvailable()helpers.PaymentGatewayFacade — The primary entry point for application code. All gateway operations can be performed through this facade without injecting services directly.
Directory structure
Enums
PaymentGateway
Identifies which payment driver to use. Values match the string keys used in config/payments.php and in API requests.
| Case | Value |
|---|---|
TRANSBANK | transbank |
MERCADOPAGO | mercadopago |
MANUAL | manual |
PaymentStatus
Tracks the lifecycle of every payment record.
| Case | Value | Description |
|---|---|---|
PENDING | pending | Created, awaiting gateway action |
PROCESSING | processing | Gateway is actively processing |
AUTHORIZED | authorized | Authorized but not yet settled |
COMPLETED | completed | Payment successful and settled |
FAILED | failed | Gateway reported a failure |
CANCELLED | cancelled | Cancelled by user or gateway |
REFUNDED | refunded | Fully refunded |
PARTIALLY_REFUNDED | partially_refunded | Partially refunded |
EXPIRED | expired | Session or token expired |
PENDING_APPROVAL | pending_approval | Manual gateway — awaiting admin review |
Facade Usage
All gateway operations go through thePaymentGateway facade. Import it with use App\Facades\PaymentGateway;.
Payment Model Scopes
ThePayment Eloquent model ships with query scopes for common filtering needs:
Plant Availability
The public plant catalogue derives availability from two sources:plant_reservations and payments. A plant is considered unavailable when any of the following is true:
- An active or completed
plant_reservationexists for the plant. - A
paymentlinked viaplant_idhas statuscompletedorauthorized.
pending, processing, or pending_approval status — without an already-completed reservation — do not block a plant from appearing as available.
When a payment transitions to
completed or authorized, the linked plant is automatically treated as sold in all public API responses. No separate action is required.Gateway Pages
Transbank
Webpay Plus and Mall mode for Chilean card payments. Includes test cards, environment setup, and return flow.
Mercado Pago
Preference-based redirect flow for LATAM markets with async webhook verification.
Manual Payments
Bank transfer and offline payments with admin-approval workflow and proof upload.