Ghost and Hugo
A Ghost or Hugo site usually has no server of its own, so it must never hold a secret s21_ API key. There are three ways to take crypto payments on it, from the simplest. In each one the payer signs and sends from their own wallet, straight to yours; send21 never holds the money.
1. A pay button: one fixed link, a fresh payment per payer
A pay button is a link, https://send21.io/b/<token>, with the amount, coins and receiving addresses you locked. Every payer who presses it gets a fresh payment request. It keeps working until you switch it off, and nothing in it is secret. Create one in the app under Buttons; you get the link and a ready HTML snippet.
- Ghost: add an HTML card in the editor and paste the snippet.
- Hugo: paste the snippet into a shortcode or a layout. Raw HTML in Markdown content needs
markup.goldmark.renderer.unsafe = true; a shortcode avoids that.
2. A pay link you created, with the Hugo and Ghost example
The open-source Hugo and Ghost pay link example styles a button for a pay link you already created (https://send21.io/pay/..., in the app or with POST /api/v1/payment-requests). For Hugo it is a send21-pay shortcode with link, amount, currency, label and note; for Ghost an HTML card with ghost-embed.html, where you replace the placeholder link with yours.
A pay link is for one payment and expires after at most 30 days, so this suits a single invoice or a short campaign. For a fixed button that keeps working, use a pay button (1).
{{< send21-pay link="https://send21.io/pay/..." amount="20" currency="EUR" label="Pay with crypto" >}}3. A new pay link per order, with a small backend
When each order needs its own link with its own amount and reference, put a small backend in front that holds the s21_ key and calls POST /api/v1/payment-requests, for example the checkout component. The static site only talks to that backend. Never put a secret s21_ key in the browser.
Tips and coffee buttons
send21-coffee-button is a Lightning-first "buy me a coffee" button with a README badge and a supporters wall. It runs on your own server; for a site without one, a pay button (1) does the same job for a fixed amount.
When the payment arrives
You get the usual emails and, if you set up a webhook, the signed draft.confirmed event. The payer's pay page is in English or German. Refunds are made by you, from your own wallet: blockchain payments cannot be undone.
Related
Start building
Create a free account to get an API key, or try the whole flow first on test networks.
This page is also available as Markdown: /docs/ghost-hugo.md. Questions: integration@send21.io.