Payments
Sell from your site with Paystack or Flutterwave. 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 or Flutterwave 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, paste the secret key from your Paystack or Flutterwave dashboard. Its prefix tells Lahyer whether it is a test key or a live key:
| Provider | Test key | Live key |
|---|---|---|
| Paystack | sk_test_... | sk_live_... |
| Flutterwave | FLWSECK_TEST-... | FLWSECK-... |
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.
Link to the checkout
<a href="/.lahyer/pay/checkout?product=ebook&next=/thank-you">Buy the ebook</a>The checkout link
/.lahyer/pay/checkout takes:
| Parameter | Description |
|---|---|
product | The product's key. Required. |
quantity | 1 to 100. Optional, 1 when left out. |
next | A 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 Paystack or Flutterwave. 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 Paystack or Flutterwave dashboard. Subscriptions and refunds from the Lahyer dashboard are not available yet.
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.