Complete guide to install and set up the CLINK payment plugin for Medusa. ## Prerequisites - **Medusa v2.x** store - **Node.js 18+** - **Lightning wallet/node** with CLINK support ### Supported Wallets (Merchant) | Wallet | Platform | Link | |--------|----------|------| | ShockWallet | iOS/Android/Web | [shockwallet.app](https://shockwallet.app) | | Lightning.Pub | Self-hosted | [lightning.pub](https://lightning.pub) | | ZEUS | iOS/Android | [zeusln.com](https://zeusln.com) | | Electrum | Desktop | requires [plugin](https://github.com/BareBits/electrum_clink) | ## Installation ### Step 1: Install the Package ```bash # In your Medusa project root npm install medusa-plugin-bitcoin-lightning-via-clink ``` ### Step 2: Configure medusa-config.ts ```typescript import { Modules } from "@medusajs/framework/utils" module.exports = defineConfig({ modules: [ { resolve: "@medusajs/medusa/payment", options: { providers: [ { resolve: "medusa-plugin-bitcoin-lightning-via-clink", id: "clink", options: { // Required: Your CLINK offer string noffer: "noffer1...", // Optional: Currency source (default: coingecko) currencySource: "coingecko", // Optional: Invoice timeout in seconds (default: 600) invoiceTimeout: 600, // Optional: Enable subscriptions enableSubscriptions: false, // Optional: Debug logging debug: false } } ] } } ] }) ``` ### Step 3: Get Your CLINK Offer **Using ShockWallet (Recommended):** 1. Download [ShockWallet](https://shockwallet.app) 2. Create/import your Lightning wallet 3. Go to **Menu** → **Static Offer** 4. Copy the `noffer1...` string 5. Paste into your config ### Step 4: Restart Medusa ```bash npm run dev ``` ### Step 5: Enable in Admin 1. Go to **Medusa Admin** → **Settings** → **Regions** 2. Edit your region 3. Under **Payment Providers**, enable **Lightning (CLINK)** 4. Save ## Test It! 1. Add a product to cart 2. Go to checkout 3. Select **Lightning (CLINK)** 4. Scan the QR code with your wallet 5. Pay! ## Next Steps - [Configuration](Configuration.md) - All available options - [Subscriptions](Subscriptions.md) - Enable auto-renewal - [Troubleshooting](Troubleshooting.md) - Common issues ## Need Help? - [GitHub Issues](https://github.com/WoompaLoompa/medusa-clink/issues) - [Discussions](https://github.com/WoompaLoompa/medusa-clink/discussions)