Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

PrestaShop CLINK Payment Module

Accept Bitcoin Lightning payments on your PrestaShop store via the CLINK protocol. Customers pay with ShockWallet, ZEUS, Amethyst, or any CLINK-compatible Lightning wallet. All communication is private and anonymous via Nostr relays.

How It Works

  1. Merchant generates a CLINK Offer string (noffer1...) from their CLINK-compatible Lightning node
  2. Customer selects "Bitcoin Lightning (via CLINK)" at checkout
  3. The module requests a BOLT11 Lightning invoice from the merchant's node via Nostr
  4. Customer scans the QR code and pays with any Lightning wallet
  5. Payment is confirmed via CLINK protocol — order is marked complete

Requirements

  • PrestaShop 1.7+ / 8.x / 9.x
  • PHP 7.4+
  • A CLINK-compatible Lightning wallet/node (ShockWallet, Lightning.Pub, ZEUS, Amethyst)

Installation

  1. Download or clone this repository into your PrestaShop modules/ directory as prestashop_clink/
  2. Install dependencies: cd prestashop_clink && npm install && npm run build
  3. Go to Modules > Module Manager in your back office
  4. Search for "CLINK" and click Install
  5. Go to Modules > Module Manager > CLINK > Configure to enter your offer string

Configuration

Navigate to Modules > Module Manager > Bitcoin Lightning (via CLINK) > Configure.

Setting Description
Enable/Disable Turn the gateway on/off
CLINK Offer String Your noffer1... string from ShockWallet / Lightning.Pub
Title Payment method title shown at checkout
Description Payment method description shown at checkout
Display Amount As How prices appear: sats, BTC, or ₿ (bip-0177)
Fixed BTC Rate Optional — set a fixed BTC price instead of live CoinGecko rate
Invoice Timeout Seconds before the Lightning invoice expires (default: 600)
Poll Interval Milliseconds between payment status checks (default: 5000)

Generating a noffer

ShockWallet (mobile)

  1. Open ShockWallet
  2. Go to Receive > CLINK Offer
  3. Copy the noffer1... string
  4. Paste into the module settings

Lightning.Pub (self-hosted)

  1. Log into your Lightning.Pub dashboard
  2. Navigate to Offers
  3. Copy the generated noffer1... string

Development

# Install JS dependencies
npm install

# Build JS bundle
npm run build

# Watch for changes
npm run watch

Architecture

Checkout Flow:
  Customer                   PrestaShop                Nostr Relay         Merchant Node
     |                          |                         |                    |
     |-- Place Order ---------->|                         |                    |
     |                          |-- Create Order (pending)|                    |
     |                          |-- Redirect to confirm   |                    |
     |                          |                         |                    |
     |-- Page Load ------------>|                         |                    |
     |-- JS: Decode noffer -----|                         |                    |
     |-- JS: Send kind:21001 ---+------------------------>|-- Request ------->|
     |                          |                         |                    |
     |                          |<-- BOLT11 Invoice ------|<-- Response -------|
     |-- Display QR code <------+                         |                    |
     |-- Customer pays <---------+------------------------>|                    |
     |                          |                         |-- Receipt ------->|
     |<-- Receipt callback -----+<------------------------|                    |
     |-- AJAX: mark_paid ------>|                         |                    |
     |                          |-- Order complete ------->|                    |

License

Academic Free License 3.0 (AFL-3.0). See LICENSE.md.

Contributors

Languages