Bitcoin Lightning payment module for Medusa eCommerce via the CLINK protocol
Bitcoin Lightning payment module for MedusaJS eCommerce via the CLINK protocol.
| Component | Description |
|---|---|
| Core payment provider with CLINK SDK integration | |
| Fiat-to-sats conversion (CoinGecko, Kraken, Fixed, Manual) | |
| Recurring payments via nDebit protocol | |
| Admin Settings Widget | Configure noffer, currency source, subscriptions, refunds |
| Storefront Component | QR code + copy + countdown timer + payment status polling |
| Webhook Endpoint | Real-time payment confirmations from CLINK relay |
| Status Endpoint | Backup polling for payment verification |
npm install medusa-plugin-bitcoin-lightning-via-clinkAdd to your :
1import { Modules } from "@medusajs/framework/utils"2
3module.exports = defineConfig({4 modules: [5 {6 resolve: "@medusajs/medusa/payment",7 options: {8 providers: [9 {10 resolve: "medusa-plugin-bitcoin-lightning-via-clink",11 id: "clink",12 options: {13 noffer: "noffer1...", // Your CLINK offer string14 currencySource: "coingecko",15 invoiceTimeout: 600,16 debug: false17 }18 }19 ]20 }21 }22 ]23})Customers can now pay with Lightning at checkout.
Full documentation lives on the GitHub Wiki:
1βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ2β CHECKOUT FLOW β3βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€4β β5β Customer selects "Pay with Lightning" β6β β β7β βΌ β8β Medusa requests invoice β9β β β10β βΌ β11β CLINK SDK decodes nOffer β requests BOLT11 from your node β12β β β13β βΌ β14β QR code + invoice displayed to customer β15β β β16β βΌ β17β Customer scans QR with Lightning wallet β18β β β19β βΌ β20β Payment confirmed via Webhook (primary) OR Polling (backup) β21β β β22β βΌ β23β Order confirmed! β‘ β24β β25βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββNo web server needed for your Lightning node. All communication flows over Nostr. See the Wiki architecture page for the full data flow.
| Option | Type | Required | Default | Description |
|---|---|---|---|---|
| string | Yes | - | Your CLINK offer string | |
| string | No | Exchange rate source | ||
| number | No | - | Fixed BTC rate (if using source) | |
| number | No | Invoice expiry in seconds | ||
| number | No | Polling interval in ms | ||
| boolean | No | Enable nDebit subscriptions | ||
| string | No | - | Merchant email for refunds | |
| string | No | - | Merchant Nostr for refunds | |
| boolean | No | Enable debug logging |
See the Configuration Wiki page for details on each option.
For Merchants (to get your ):
For Customers (to pay):
1# Install dependencies2npm install3
4# Run tests5npm test6
7# Build8npm run build9
10# Watch mode11npm run devContributions are welcome! Please see CONTRIBUTING.md for details.
GPL-3.0 - See LICENSE for details.