• Модуль интеграций
  • Сообщество
  • Блог
Документация
Плагины и интеграцииВсе расширения для Medusa от сообществаСтартерыЗапускайте проекты быстрее с готовыми решениями
ЭкспертыПодберите специалиста для разработки и развития вашего проекта на MedusaКейсыПосмотрите примеры Medusa в продакшене и успешные внедрения
Представляем готовый к продакшену Medusa DTC Starter от Gorgo

26 августа 2026 г. · Продукт

Gorgo снижает затраты на адаптацию Medusa к локальным рынкам.

Мы разрабатываем плагины интеграции, осуществляем поддержку и развиваем сообщество разработчиков на Medusa в Telegram.

  • Ресурсы Medusa
  • Плагины и интеграции
  • Модуль интеграций
  • Стартеры
  • Эксперты
  • Кейсы
  • Medusa Чат в Telegram
  • Medusa Новости в Telegram
  • Документация Gorgo
  • Связаться с нами
  • TelegramGitHub
Плагины
B

Bitcoin lightning via clink

Платёжный модуль Bitcoin Lightning для Medusa через протокол CLINK

npm install medusa-plugin-bitcoin-lightning-via-clink
Категория
Платежи
Создано
Woompaloompa
Версия
1.0.2
Последнее обновление
1 месяц назад
Ежемесячные загрузки
Загрузка данных
Звезды на Github
2
npmNPMGitHubGithub

medusa-plugin-bitcoin-lightning-via-clink

Bitcoin Lightning payment module for MedusaJS eCommerce via the CLINK protocol.

Features

  • ⚡ Lightning Payments - Accept Bitcoin Lightning payments via CLINK protocol
  • 🔒 Self-Custodial - Your node, your funds, no third-party
  • 🌐 Nostr-Native - All communication via Nostr relays, no web server needed
  • 💱 Auto Conversion - CoinGecko, Kraken, Fixed rate, or Manual
  • 🔄 Subscriptions - Auto-renewal via CLINK Debits (nDebit)
  • 📱 QR + Copy - Beautiful QR codes with one-click copy for invoices
  • 🔐 Privacy - Ephemeral Nostr keys for payment requests
  • 🛡️ Dual Confirmation - Webhook (primary) + Polling (backup)
  • 📊 Admin Dashboard - Configure everything from the Medusa admin panel

What's in the Box

ComponentDescription
Core payment provider with CLINK SDK integration
Fiat-to-sats conversion (CoinGecko, Kraken, Fixed, Manual)
Recurring payments via nDebit protocol
Admin Settings WidgetConfigure noffer, currency source, subscriptions, refunds
Storefront ComponentQR code + copy + countdown timer + payment status polling
Webhook EndpointReal-time payment confirmations from CLINK relay
Status EndpointBackup polling for payment verification

Quick Start

1. Install

2. Configure

Add to your :

3. Enable in Admin

  1. Go to Settings > Regions
  2. Edit your region
  3. Enable Lightning (CLINK) as a payment provider

4. Accept Payments!

Customers can now pay with Lightning at checkout.

Documentation

Full documentation lives on the GitHub Wiki:

  • Getting Started
  • Configuration
  • Guide for Merchants
  • Guide for Customers
  • Guide for Subscriptions
  • Currency Sources
  • Troubleshooting
  • FAQ
  • Changelog

How It Works

No web server needed for your Lightning node. All communication flows over Nostr. See the Wiki architecture page for the full data flow.

Requirements

  • Medusa v2.x
  • Node.js >= 18.0.0
  • A CLINK-compatible Lightning wallet/node:
    • ShockWallet (iOS/Android/Desktop)
    • Lightning.Pub (self-hosted)
    • ZEUS (iOS/Android)
    • Amethyst (Android)
    • Electrum with CLINK plugin (Desktop)

Configuration Options

OptionTypeRequiredDefaultDescription
stringYes-Your CLINK offer string
stringNoExchange rate source
numberNo-Fixed BTC rate (if using source)
numberNoInvoice expiry in seconds
numberNoPolling interval in ms
booleanNoEnable nDebit subscriptions
stringOnly for subscriptions-Merchant Nostr pubkey (64-hex); required when
stringNo-HMAC secret to verify webhook payloads (see Security below)
stringNo-Merchant email for refunds
stringNo-Merchant Nostr for refunds
booleanNoEnable debug logging

Security

v1.0.2 hardened the plugin against common payment and network attacks:

  • BOLT11 validation - Invoices returned by your node are validated before being shown to customers: mainnet prefix, amount matches the requested total, and a reasonable expiry. Invalid invoices are rejected and the payment session is failed.
  • SSRF protection - Relay URLs are validated ( only) and IP addresses are checked for safety. Localhost, domains, private/loopback/CGNAT/link-local IPs, and unsafe IPv6 ranges (ULA, link-local, multicast, IPv4-mapped) are rejected.
  • Webhook signature verification - Confirmations sent to the webhook endpoint are verified with an HMAC-SHA256 signature before the order is confirmed. Set a shared secret and the plugin will reject unsigned or tampered webhooks.
  • nDebit validation - Subscription debit pointers are decoded and validated (pubkey, relay) before use. A correlation key ties each debit request to the originating subscription.
  • Payment hash correlation - The webhook verifies the payment's matches the expected session before confirming the order.

Webhook secret

Two ways to set it (env var takes precedence):

If no secret is configured, webhook signatures are not checked (single-tenant setups behind a firewall). Configure one in production. See the Configuration Wiki page for details.

See the Configuration Wiki page for details on each option.

Supported Wallets

For Merchants (to get your ):

  • ShockWallet - Menu > Static Offer
  • Lightning.Pub - Dashboard > Offers
  • ZEUS - Settings > CLINK

For Customers (to pay):

  • ShockWallet
  • ZEUS
  • Amethyst
  • Electrum with CLINK plugin
  • Any CLINK-compatible wallet

Development

Contributing

Contributions are welcome! Please see CONTRIBUTING.md for details.

License

GPL-3.0 - See LICENSE for details.

Support

  • Issues
  • Discussions
  • CLINK Protocol
  • Medusa Documentation

Other Conversations

  • In Medusa GH forum: https://github.com/medusajs/medusa/discussions/16162
  • In Medusa Discord: https://discord.com/channels/876835651130097704/1529853260276437123

Еще в этой категории

Посмотреть все
Платежи
Braintree logo

Braintree

От Lambda Curry

Поддержка платежей и 3D Secure через Braintree

Загрузка данных
GitHubnpm
Платежи
Pay. logo

Pay.

От Webbers

Принимайте кредитные карты, цифровые платежи и купи сейчас, плати потом

Загрузка данных
GitHubnpm
Платежи
Mollie logo

Mollie

От Variable Vic

Легко принимайте мультивалютные платежи через Mollie

Загрузка данных
GitHubnpm
npm install medusa-plugin-bitcoin-lightning-via-clink
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 string
14 currencySource: "coingecko",
15 invoiceTimeout: 600,
16 debug: false
17 }
18 }
19 ]
20 }
21 }
22 ]
23})
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└─────────────────────────────────────────────────────────────────┘
1# Option 1: environment variable
2CLINK_WEBHOOK_SECRET=your-secret npm start
1// Option 2: plugin option
2options: {
3 webhookSecret: "your-secret"
4}
1# Install dependencies
2npm install
3
4# Run tests
5npm test
6
7# Build
8npm run build
9
10# Watch mode
11npm run dev