Skip to main content

Documentation 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.

The Manual payment gateway handles bank transfers and other offline payment methods. Unlike Transbank and Mercado Pago, there is no third-party redirect or webhook — the buyer receives bank account details and payment instructions, uploads a proof of transfer, and an admin reviews and approves or rejects the payment from the Filament panel. The flow starts with an explicit reservation to hold the plant during the approval window.

Configuration

No SDK or external API credentials are required for manual payments. The gateway is enabled and configured through SiteSettings in the Filament panel under the Pasarelas de Pago tab. Bank account details, payment instructions, and proof requirements are all managed from that settings page.
Although manual payments have no external service dependency, the plant must be held with a reservation before initiating the checkout. See the payment flow below.

Payment Flow

1

Create a reservation

Call POST /api/v1/reservations to create a plant reservation and receive a session_token. This token holds the plant and links it to the pending payment. The reservation expires automatically via the reservations:expire scheduler task.
2

Initiate checkout

Call POST /api/v1/checkout with gateway: "manual" and include the session_token from the reservation. The API creates a Payment record with status pending_approval and invokes ManualPaymentService::createTransaction().
{
  "gateway": "manual",
  "session_token": "<token-from-reservation>"
}
3

Receive payment instructions

The API responds with everything the buyer needs to complete the transfer:
{
  "flow": "manual",
  "payment_id": 42,
  "reference": "MAN-01J...",
  "instructions": "Transferir al banco indicado con el número de referencia.",
  "bank_accounts": [
    {
      "bank": "Banco Estado",
      "account_type": "Cuenta Corriente",
      "account_number": "123456789",
      "holder": "iLeben SpA",
      "rut": "76.XXX.XXX-X"
    }
  ],
  "expires_at": "2026-06-08T18:00:00Z"
}
4

Upload proof of payment

After completing the bank transfer, the buyer uploads the receipt via:
POST /api/v1/payments/{id}/manual-proof
Content-Type: multipart/form-data
Fields:
FieldRequiredDescription
proof✅ YesImage or PDF of the transfer receipt
notesNoOptional free-text note from the buyer
Accepted file types: jpg, jpeg, png, pdf, heic, heif
Maximum file size: 5 MB
5

Admin reviews in Filament

The payment appears in the Filament admin panel under Payments filtered by status pending_approval. The admin opens the record to review the uploaded proof and any buyer notes.
6

Approve or reject

The admin calls the approve or reject action from the Filament panel. On approval, ManualPaymentService::approvePayment() transitions the payment to COMPLETED. On rejection, it transitions to FAILED and the plant reservation is released.
The session_token obtained from POST /api/v1/reservations is mandatory when using the manual gateway. Omitting it will result in a validation error. The token links the reservation to the payment and prevents the plant from being double-sold during the approval window.

PHP Example

The following snippet shows how ManualPaymentService is used inside the application:
use App\Facades\PaymentGateway as PaymentGatewayFacade;

$service = PaymentGatewayFacade::driver('manual');

// Retrieve bank accounts and instructions for display
$instructions = $service->getPaymentInstructions();
// Returns: instructions text + bank_accounts array from SiteSettings

// Approve a manual payment (called from Filament or a controller)
$service->approvePayment($transactionId, [
    'approved_by' => auth()->id(),
    'notes'       => 'Comprobante verificado',
]);

Admin Workflow in Filament

The Filament admin panel is the primary interface for managing manual payments.
  1. Navigate to Payments in the admin sidebar.
  2. Filter by Status → Pending Approval to see all payments awaiting review.
  3. Open a payment record to view the uploaded proof image or PDF, buyer notes, payment reference, and linked plant and project.
  4. Use the Approve action to mark the payment as COMPLETED and confirm the plant sale, or Reject to set it to FAILED and release the reservation.
Email notifications can be configured to fire on status transitions. Set PAYMENT_FIN_MAIL_ENABLED=true and define which statuses trigger a notification in PAYMENT_FIN_MAIL_ON_STATUSES.

Email Notifications

iLeben uses Fin Mail to send transactional emails when a manual payment changes status. Configure both variables in .env:
# Enable payment email notifications
PAYMENT_FIN_MAIL_ENABLED=true

# Comma-separated list of statuses that trigger an email
PAYMENT_FIN_MAIL_ON_STATUSES=authorized,completed,failed,cancelled,expired,refunded,partially_refunded
Fin Mail is managed via Artisan commands:
# Install Fin Mail tables and configuration
php artisan fin-mail:install

# Apply any pending Fin Mail upgrades
php artisan fin-mail:upgrade

# Clean up old sent-mail history
php artisan fin-mail:cleanup

Build docs developers (and LLMs) love