> ## Documentation Index
> Fetch the complete documentation index at: https://docs.lekalao.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Online-service mode

> Open registration, sell plans and host several customers.

By default, only the first person can create an account; everyone else is invited. To offer Lekalao online to customers, open registration and switch billing on.

## Before you open

<Steps>
  <Step title="Forbid writing in other people's name">
    ```dotenv .env theme={null}
    LEKALAO_REQUIRE_VERIFIED_DOMAIN=true
    ```

    See [Security](/self-hosting/security#who-may-write-in-whose-name).
  </Step>

  <Step title="Create the plans">
    ```bash theme={null}
    php artisan db:seed --class=PlanSeeder
    ```

    | Plan          | Key       | Price a month | Subscribers | E-mails a month |
    | ------------- | --------- | ------------- | ----------- | --------------- |
    | Découverte    | `free`    | 0             | 500         | 2,000           |
    | Essentiel     | `starter` | 15,000 FCFA   | 5,000       | 50,000          |
    | Professionnel | `pro`     | 45,000 FCFA   | 25,000      | 300,000         |
    | Grand volume  | `scale`   | 150,000 FCFA  | no limit    | 2,000,000       |

    Then change them in the `plans` table to match your own offer.
  </Step>

  <Step title="Wire up the payments">
    See below.
  </Step>

  <Step title="Open registration">
    ```dotenv .env theme={null}
    LEKALAO_SIGNUP_ENABLED=true
    LEKALAO_SIGNUP_PLAN=starter
    LEKALAO_SIGNUP_TRIAL_DAYS=0
    ```

    Every registration creates a team of its own on the `LEKALAO_SIGNUP_PLAN` plan. `LEKALAO_SIGNUP_TRIAL_DAYS` sets a trial length; `0` leaves the plan's own. Registrations are limited to 5 an hour per IP address.
  </Step>
</Steps>

## Billing

```dotenv .env theme={null}
LEKALAO_BILLING_ENABLED=true
LEKALAO_BILLING_CURRENCY=XAF
LEKALAO_BILLING_GRACE_DAYS=7
LEKALAO_BILLING_GATEWAY=wajub
```

With billing on, each plan's limits apply (subscribers, e-mails a month), and sending stops `LEKALAO_BILLING_GRACE_DAYS` days after the end of an unpaid period. Teams see all of it in **Settings → Billing** ([Billing](/account/billing)).

### Wajub

```dotenv .env theme={null}
WAJUB_SECRET_KEY=sk_live_…
WAJUB_WEBHOOK_SECRET=whsec_…
```

At Wajub, declare the notification address:

```
https://lekalao.example.com/webhooks/billing
```

A payment that goes through extends the period from the end of the previous one: paying early loses no days.

### Manual

`LEKALAO_BILLING_GATEWAY=manual` takes no money online: payments stay **Waiting for payment**. After a bank transfer, mark the payment paid:

```bash theme={null}
php artisan tinker --execute="app(App\Domain\Billing\Actions\ApplyPaymentAction::class)->execute(App\Domain\Billing\Models\Payment::acrossTeams()->whereKey('…')->sole(), App\Domain\Billing\Enums\PaymentStatus::Paid);"
```

For another gateway, see [Extending Lekalao](/self-hosting/extending#a-payment-gateway).

## Kept apart

Teams share nothing: lists, subscribers, campaigns, templates, media, providers, domains, tokens, webhooks and settings all belong to one team. A sending provider created without a team, by the platform, is shared by all of them.
