-
Notifications
You must be signed in to change notification settings - Fork 0
Subscriptions
Complete guide to auto-renewal subscriptions using CLINK Debits.
Enable automatic recurring payments with CLINK Debits (nDebit). Customers authorize future payments once, and renewals process automatically.
- 🔄 Automatic renewals - No manual intervention
- ⚡ Instant processing - Lightning speed
- 🔒 Secure authorization - Cryptographic signatures
- ❌ Revocable - Customers can cancel anytime
Customer → Selects CLINK → Scans QR → Pays → Order Confirmed
Customer → Gets nDebit → Pastes in Settings → Auto-Renewal Enabled
Subscription Due → Plugin sends nDebit request → Wallet auto-pays → Renewal Complete
{
resolve: "medusa-plugin-bitcoin-lightning-via-clink",
id: "clink",
options: {
noffer: "noffer1...",
enableSubscriptions: true // Enable this!
}
}In Medusa Admin:
- Products → Add Product
- Set product type to "Subscription"
- Configure billing interval
{
// Days before expiry to remind customer
renewalReminderDays: 3,
// Grace period for failed payments (days)
gracePeriodDays: 7
}Customer pays normally via QR code.
ShockWallet:
- Open ShockWallet
- Settings → nDebit
- Copy
ndebit1...string
ZEUS:
- Open ZEUS
- Settings → CLINK → nDebit
- Copy
ndebit1...string
Online:
After first payment, on order confirmation page:
┌─────────────────────────────────────────────┐
│ Setup Auto-Renewal for Future Payments │
│ │
│ Your subscription will renew automatically │
│ using Lightning payments. │
│ │
│ 1. Open your Lightning wallet │
│ 2. Get your nDebit string │
│ 3. Paste it below: │
│ │
│ [ndebit1qvqsyqjqxuurvwpcxc6rvv...] │
│ │
│ [Enable Auto-Renewal] │
│ │
└─────────────────────────────────────────────┘
Customer can verify in My Account → Subscriptions:
- Status: "Auto-Renewal Active"
- Next renewal date
- Option to disable
When customer provides ndebit1...:
- Decode - Extract pubkey, relay, permissions
- Encrypt - Store securely in database
- Use - Send CLINK Debit request on renewal
1. Subscription due date arrives
2. Plugin creates CLINK Debit request (kind 21002)
3. Request sent to customer's wallet via Nostr
4. Wallet auto-authorizes payment
5. Invoice paid automatically
6. Subscription renewed
- nDebit encrypted at rest
- Cryptographic signature required
- Amount must match subscription
- Customer can revoke anytime
View Subscription:
- My Account → Subscriptions
- See status, next renewal, payment history
Disable Auto-Renewal:
- My Account → Subscriptions
- Click "Disable Auto-Renewal"
- Confirm
Update nDebit:
- My Account → Subscriptions
- Click "Update Payment Method"
- Paste new
ndebit1...
View Subscriptions:
- Admin → Orders → Subscriptions
- Filter by status
Manual Renewal:
- Select subscription
- Click "Renew Now"
- Customer pays via QR code
Cancel Subscription:
- Select subscription
- Click "Cancel"
- Confirm
-
Check nDebit validity
- Must start with
ndebit1 - From compatible wallet
- Must start with
-
Check wallet connectivity
- Customer's wallet must be online
- Relay must be accessible
-
Check payment limits
- Sufficient balance
- Channel capacity adequate
Guide to:
- ShockWallet: Settings → nDebit
- ZEUS: Settings → CLINK → nDebit
- Online: my.shockwallet.app/lapps
- Enable debug mode
- Check logs for errors
- Verify Nostr relay connection
- Customer may need to re-authorize
Yes! Update anytime from My Account → Subscriptions.
Renewal fails. Customer gets notification to top up.
Yes! Disable auto-renewal and pay via QR code.
Yes! Cryptographically signed and encrypted. Only usable for authorized subscription.
Yes! Each can have its own nDebit or share one.
interface NDebitData {
id: string
customer_id: string
subscription_id: string
ndebit_string: string // Encrypted
pubkey: string
relay: string
created_at: Date
updated_at: Date
}-
subscription.renewal_attempted- Renewal initiated -
subscription.renewal_succeeded- Payment confirmed -
subscription.renewal_failed- Payment failed -
subscription.cancelled- Subscription cancelled
- Configuration - All options
- Troubleshooting - Common issues
- Contributing - Help improve