Payments

Sell from your site with Paystack, Flutterwave or Stripe. Buyers pay into your own account.

Pro plan

Payments are part of the Pro plan. See Plans and limits.

Every site Lahyer hosts can take one-off payments. Buyers pay into your own Paystack, Flutterwave or Stripe account, at the price you set on the project's Payments tab. The money never passes through Lahyer, and Lahyer takes no fee on it. Apps made in Lahyer Studio add buy buttons when you ask.

Set up

Add your secret key

On the project's Payments tab, select the provider and paste its secret key. Its prefix tells Lahyer whether it is a test key or a live key:

ProviderTest keyLive key
Paystacksk_test_...sk_live_...
FlutterwaveFLWSECK_TEST-...FLWSECK-...
Stripesk_test_...sk_live_...

A project uses one provider, with at most one test key and one live key. Saving a key from the other provider removes the old provider's keys. Keys are encrypted at rest and never shown again in full.

Add a product

Give it a key your links will use (short and lowercase, such as ebook or vip-ticket), a name, an optional description, a price and a currency: NGN, GHS, KES, ZAR or USD.

<a href="/.lahyer/pay/checkout?product=ebook&next=/thank-you">Buy the ebook</a>

/.lahyer/pay/checkout takes:

ParameterDescription
productThe product's key. Required.
quantity1 to 100. Optional, 1 when left out.
nextA path on your site to return to after paying. Lahyer adds ?payment=paid to it.

Lahyer's checkout page shows the price, asks for the buyer's email and sends them to the selected provider. When the provider confirms the payment, Lahyer records it on the Payments tab, emails the organization's owners and sends the buyer back to next. Thank the buyer on that page when it has payment=paid.

Use a plain link rather than your framework's router link: the checkout is not a route of your app.

Show prices on your site

GET /.lahyer/pay/products lists the active products, with a price ready to display:

{
  "mode": "live",
  "products": [
    {
      "key": "ebook",
      "name": "The ebook",
      "description": "PDF and EPUB",
      "amountMinor": 500000,
      "currency": "NGN",
      "price": "₦5,000"
    }
  ]
}

amountMinor is in the currency's smallest unit (kobo for NGN, cents for USD). mode is test or live, or null before a key is added.

Test mode

Previews always use the test key, so trying a checkout on a pull request never moves real money. Production uses the live key, or the test key until you add a live one. On the test key, the checkout page says "Test mode: no real money moves".

How payments are confirmed

When the buyer comes back, Lahyer asks the provider about the payment and records it only when the status, currency and amount match the checkout. If the buyer never comes back, for example after a bank transfer, Lahyer asks the provider again 1, 3, 10, 30 and 60 minutes and 3, 6, 12 and 24 hours after the checkout started. After the last check, the payment is closed as failed or not completed.

Refunds and disputes

Lahyer never holds the money, so refunds and disputes are between you and your provider: handle them in your provider's dashboard. Subscriptions and refunds from the Lahyer dashboard are not available yet.

Your own provider

Full-stack apps can integrate another gateway or a bank's payment API in their own server code. On Payments, open Your own provider, enter its name, HTTPS API base URL and keys, choose Preview or Production, and select Test and connect.

Lahyer first checks the connection: it sends one GET request to the API base URL with the secret key as a Bearer token in the Authorization header. The connection is saved only if the provider answers and does not refuse the key (HTTP 401 or 403). Use the address of an endpoint that accepts this kind of request, such as a status or account endpoint. The address must be public HTTPS on the standard port 443.

The connection is stored as encrypted environment variables for the chosen environment:

  • PAYMENT_PROVIDER_NAME
  • PAYMENT_API_BASE_URL
  • PAYMENT_PUBLIC_KEY (optional)
  • PAYMENT_SECRET_KEY
  • PAYMENT_WEBHOOK_SECRET (optional)

Connecting again replaces these variables, and Remove deletes them. Deploy the app to apply changes. Keys are not included in browser bundles. Do not copy secrets into source code or prefix them with NEXT_PUBLIC_ or VITE_. Use separate test and live keys for the two environments.

Add the webhook URL shown on the page, for example https://your-app.lahyer.app/api/payments/webhook, in your provider's dashboard. Your app must implement checkout, payment verification and that webhook handler according to your provider's documentation; connecting does not generate those routes. Validate webhook signatures, reject replays, and verify the amount, currency and payment reference server-side before fulfilling orders. Do not treat redirect query parameters as proof of payment.

Custom payments are handled by your app and do not appear in Lahyer's built-in payment history. Static websites need a server before they can use custom payment secrets.

Limits

  • 100 products per project, priced from 1 to 100 million in the currency's main unit.
  • Quantity 1 to 100.
  • 300 checkouts an hour per site.

On this page