-
Notifications
You must be signed in to change notification settings - Fork 0
Troubleshooting
Common issues and solutions for the CLINK payment plugin.
Symptoms:
- Customer pays but order remains pending
- QR code shows but payment never confirms
Solutions:
-
Check invoice expiration
- Default timeout is 10 minutes
- Increase
invoiceTimeoutif needed
-
Verify Nostr relay connection
- Check if the relay URL in your noffer is accessible
- Try a different relay
-
Enable debug mode
{ debug: true }
Check logs for errors
-
Check webhook endpoint
- Ensure
/clink/webhookis accessible - Verify firewall rules
- Ensure
Symptoms:
- Invoice shows incorrect satoshi amount
- Amount doesn't match fiat price
Solutions:
-
Check currency source
{ debug: true }
Look for conversion logs
-
Verify exchange rate
- CoinGecko/Kraken may be down
- Try
fixedsource temporarily
-
Check currency code
- Must be ISO 4217 (USD, EUR, GBP)
- Case-sensitive
Symptoms:
- Empty checkout page
- No QR code shown
Solutions:
-
Check browser console
- Look for JavaScript errors
- Verify script loading
-
Clear cache
- Browser cache
- Medusa cache
-
Verify plugin installation
npm ls medusa-plugin-bitcoin-lightning-via-clink
Error: Invalid CLINK offer string format
Solutions:
-
Verify format
- Must start with
noffer1 - Only lowercase letters and numbers
- No spaces or special characters
- Must start with
-
Re-copy from wallet
- ShockWallet: Receive → CLINK Offer
- Ensure complete string
-
Check for typos
- Compare with original
- Use a text editor to verify
Error: Cannot find module 'medusa-plugin-bitcoin-lightning-via-clink'
Solutions:
-
Verify installation
npm install medusa-plugin-bitcoin-lightning-via-clink
-
Check node_modules
ls node_modules | grep medusa-bitcoin -
Reinstall
rm -rf node_modules npm install
Solutions:
-
Verify config syntax
- Check for commas, brackets
- Ensure valid TypeScript
-
Restart Medusa
npm run dev
-
Check medusa-config.ts location
- Must be in project root
Error: CoinGecko API error or Kraken API error
Solutions:
-
Check network
curl https://api.coingecko.com/api/v3/simple/price?ids=bitcoin&vs_currencies=usd
-
Use fixed rate temporarily
{ currencySource: "fixed", fixedBtcRate: 65000 }
-
Check API limits
- CoinGecko: 10-50 requests/minute
- Kraken: 15 requests/minute
Symptoms:
- Rates change frequently
- Too many API calls
Solutions:
-
Verify cache TTL
- Default: 5 minutes
- Check
getCacheStatus()
-
Clear and reload
- Restart Medusa
- Cache rebuilds automatically
Symptoms:
- Auto-renewal fails
- Payment not processed
Solutions:
-
Verify nDebit format
- Must start with
ndebit1 - From compatible wallet
- Must start with
-
Check wallet online
- Customer's wallet must be reachable
- Relay must be accessible
-
Verify authorization
- Amount must match subscription
- Cannot exceed limits
Guide them to:
ShockWallet:
- Open ShockWallet
- Settings → nDebit
- Copy
ndebit1...string
ZEUS:
- Open ZEUS
- Settings → CLINK → nDebit
- Copy
ndebit1...string
Online:
Enable detailed logging:
{
debug: true
}[ClinkPayment] Initiating payment
[ClinkPayment] Currency source: coingecko
[ClinkCurrency] Fetching CoinGecko rate for usd
[ClinkCurrency] Converted 10 USD = 15114 sats (rate: 66165)
[ClinkPayment] Payment initiated: 15114 sats, expires at 1234567890
[ClinkWebhook] Received webhook event
[ClinkWebhook] Payment confirmed for session clink_1234567890_abc123
| Message | Meaning |
|---|---|
Initiating payment |
Customer selected CLINK |
Converted X USD = Y sats |
Currency conversion successful |
Payment initiated |
Invoice created |
Received webhook event |
Payment confirmation received |
Payment confirmed |
Order will be completed |
If these solutions don't help:
-
Enable debug mode
-
Collect logs
-
Open an issue
- GitHub Issues
- Include: Medusa version, plugin version, logs, steps to reproduce
-
Check existing issues
- Your problem may already be solved