-
Notifications
You must be signed in to change notification settings - Fork 0
Guide for Merchants
WoompaLoompa edited this page Jul 21, 2026
·
3 revisions
Complete guide for merchants to set up Bitcoin Lightning payments via CLINK on their Medusa store.
- Overview
- Requirements
- Installation
- Getting Your CLINK Offer
- Configuration
- Enabling in Regions
- Currency Sources
- Subscription Setup
- Refund Process
- Troubleshooting
This plugin allows your Medusa store to accept Bitcoin Lightning payments using the CLINK protocol.
- ⚡ Instant payments - Lightning Network settles in seconds
- 🔒 Self-custodial - Funds go directly to your Lightning node
- 🌐 No web server required - Communication via Nostr relays
- 💱 Auto conversion - Fiat to satoshis in real-time
- 📱 QR codes - Customers scan and pay with any wallet
-
A Lightning Node/Wallet that supports CLINK:
- ShockWallet (iOS/Android) - Recommended
- Lightning.Pub (Self-hosted)
- ZEUS (iOS/Android)
-
Medusa v2.x store
-
Node.js 18+
Any CLINK-compatible wallet:
- ShockWallet
- ZEUS
- Amethyst
- Electrum with CLINK plugin
# In your Medusa project root
npm install medusa-bitcoin-lightning-payment-module-via-clinkAdd the payment provider to your Medusa config:
import { Modules } from "@medusajs/framework/utils"
module.exports = defineConfig({
modules: [
{
resolve: "@medusajs/medusa/payment",
options: {
providers: [
{
resolve: "medusa-bitcoin-lightning-payment-module-via-clink",
id: "clink",
options: {
// Required: Your CLINK offer string
noffer: "noffer1...",
// Currency conversion source
currencySource: "coingecko",
// Optional settings
invoiceTimeout: 600, // 10 minutes
enableSubscriptions: false,
refundContactEmail: "you@example.com",
debug: false
}
}
]
}
}
]
})npm run devYour noffer1... string is like a Lightning address but works without a web server.
- Download ShockWallet
- Create or import your Lightning wallet
- Go to Receive → CLINK Offer
- Copy the
noffer1...string - Paste into your Medusa config
- Deploy Lightning.Pub
- Access your dashboard
- Navigate to Offers
- Copy the generated
noffer1...string
- Open ZEUS
- Go to Settings → CLINK
- Copy your
noffer1...string
| Option | Type | Description |
|---|---|---|
noffer |
string | Your CLINK offer string (starts with noffer1...) |
| Option | Type | Default | Description |
|---|---|---|---|
currencySource |
string | coingecko |
Exchange rate source |
fixedBtcRate |
number | - | Fixed BTC rate (when using fixed source) |
invoiceTimeout |
number | 600 |
Invoice expiry in seconds |
pollInterval |
number | 5000 |
Payment status check interval (ms) |
maxPollAttempts |
number | 120 |
Maximum polling attempts |
enableSubscriptions |
boolean | false |
Enable nDebit auto-renewal |
refundContactEmail |
string | - | Email for refund requests |
refundContactNostr |
string | - | Nostr pubkey for refunds |
debug |
boolean | false |
Enable debug logging |
- Go to Medusa Admin → Settings → Regions
- Edit your region
- Under Payment Providers, enable Lightning (CLINK)
- Save
- Free, no API key required
- Updates every 5 minutes
- Supports 50+ currencies
currencySource: "coingecko"- More accurate rates
- API key optional (free tier available)
- Updates every 5 minutes
currencySource: "kraken"- You set the BTC/fiat rate manually
- Good for stable pricing
currencySource: "fixed",
fixedBtcRate: 65000 // 1 BTC = 65,000 USD- You enter prices directly in satoshis
- No conversion needed
currencySource: "manual"Enable auto-renewal for recurring payments.
{
enableSubscriptions: true
}After first payment, customers can:
- Get their
ndebit1...string from their wallet - Paste it in the auto-renewal field
- Future payments process automatically
- ShockWallet - Settings → nDebit
- ZEUS - Settings → CLINK → nDebit
Lightning refunds require manual processing.
-
Customer contacts you via:
- Email:
you@example.com(if configured) - Nostr DM:
npub1...(if configured)
- Email:
-
You process the refund manually:
- Create a Lightning invoice from their wallet
- Pay the invoice from your node
{
refundContactEmail: "support@yourstore.com",
refundContactNostr: "npub1..."
}- Check if invoice has expired
- Verify Nostr relay connection
- Check logs:
{ debug: true }
- Verify currency source is working
- Check exchange rate cache
- Try a different currency source
- Check webhook endpoint is accessible
- Verify webhook secret matches
- Check firewall rules
{
debug: true
}