# nopCommerce quickstart

The OpenReceive plugin adds a payment method to
[nopCommerce](https://www.nopcommerce.com): the customer places the order in
nopCommerce's own checkout and pays on the order's pay page on your store,
straight into your own wallet. With a swap provider, the same page also takes
USDT, USDC, SOL and ETH, which the provider converts to BTC over Lightning into
the same wallet. The order moves to **Paid** when the Lightning invoice
settles.

nopCommerce keeps owning customers, orders, prices and shipping. The plugin
bundles the OpenReceive .NET engine, which keeps its payment attempts in two
tables of the store's own database, and marks the order paid through
nopCommerce's own order processing, so its emails, events and other plugins
run as for any payment method.

Requirements: nopCommerce 5.00 (.NET 10) or 4.90 (.NET 9), on the database the
store already uses (SQL Server, MySQL/MariaDB or PostgreSQL), and a
receive-only NWC code from your wallet
([get one](https://openreceive.org/get_a_nwc_code_to_receive_payments)).

## Install the plugin

Download the ZIP for your nopCommerce line from the
[GitHub release](https://github.com/OpenReceive/openreceive/releases/latest):

- nopCommerce 5.00: `openreceive-nopcommerce-<version>.zip`
- nopCommerce 4.90: `openreceive-nopcommerce-4.90-<version>.zip`

1. In the admin, open **Configuration → Local plugins**, click **Upload plugin
   or theme**, choose the ZIP and upload it. nopCommerce refuses the other
   line's ZIP. (Or unzip it and put its `Payments.OpenReceive` folder in the
   store's `Plugins/` folder.)
2. Restart the application (**Restart application** in the admin's header).
3. In **Configuration → Local plugins**, find **Bitcoin Lightning
   (OpenReceive)**, click **Install**, then **Restart application to apply
   changes**. Installing creates the engine's two tables in the store's database and the
   plugin's scheduled task.

## Configure the wallet

1. In **Configuration → Payment methods**, mark **Bitcoin Lightning
   (OpenReceive)** active and click **Configure**.
2. Paste the receive-only NWC code and click **Save**. The plugin asks the
   wallet first: a code that cannot make invoices, or one that can also
   spend, is refused and nothing is saved. A saved code is encrypted with the
   store's own encryption key and never shown again; paste a new one to
   replace it.
3. Optional: paste a swap provider's Lightning Swap Connect code the same way
   ([set up a swap provider](https://openreceive.org/set_up_swap_provider)).

Until a wallet code is saved, the payment method stays hidden at checkout.

## Check it

The Configure page shows a status report: each code as saved or not (never
its value), the wallet's receive-only check, and any paid order nopCommerce
could not mark paid. **Test invoice** asks the wallet for a 10-sat invoice
without creating an order.

## The scheduled task

Every request the checkout makes runs one reconciliation pass, so a customer
who stays on the pay page sees the order paid within seconds. The task
**System → Schedule tasks → OpenReceive: settle Lightning payments** runs
every five minutes and settles payments whose customer left the pay page.
nopCommerce runs its scheduled tasks inside the application, so keep the
application running (an idle IIS site that shuts down stops them too).

## How a payment works

- **The reference is the order's id.** It exists before payment, survives
  every retry, and is never reused, so an order is paid once. A second
  invoice for a paid order is refused.
- **Paying.** Placing the order leaves it **Pending** and redirects the
  customer to `/openreceive-pay/<order GUID>`, which shows the
  `<openreceive-checkout>` element. It makes the Lightning invoice (or a
  swap), shows it, and watches it settle. The page shows no order total
  beside the checkout: the checkout shows the one amount to send.
- **The price is nopCommerce's.** The invoice is for the order total in the
  currency the customer checked out in when the price feed quotes it,
  otherwise in the store's primary currency, converted at the current BTC
  price, and only while the order awaits payment and is not cancelled.
- **Who may pay.** The order's own customer (signed in, or the guest who
  placed it), or a browser that opened the pay page link. The checkout's
  JSON routes under `/openreceive` accept JSON only, refuse cross-site
  requests and require the store's antiforgery token.
- **Settlement.** A settled payment is written once in the engine's table;
  then the order gets a note naming the payment hash and is marked paid
  through nopCommerce, with the hash as its capture transaction. nopCommerce
  saves through its own connection, so the two writes are separate: the
  engine's row commits first and is the record, and marking the order paid is
  retried by the scheduled task and the pay page until the order shows paid.
  An order someone cancelled is never moved; it gets a note naming the
  payment.
- **Coming back.** The order's **Complete payment** button opens the same pay
  page and the same invoice.

One wallet serves every store of the installation. Marking an order paid is
serialized within one application instance; a web farm of several instances
may, rarely, mark the same order paid twice.

## Refunds and removal

The receive-only wallet cannot send refunds. Send a refund from your own
wallet, then record it in nopCommerce. A customer whose swap deposit never
converted reclaims it from the order's pay page, while the order is unpaid. If
you turn on swaps, you commit to keeping that path available. See
[swap refunds](/guides/swap-refunds.md).

Uninstalling the plugin forgets the saved codes and removes the scheduled
task. The two tables stay, as the record of payments received; a reinstall
continues from them.

## Tested, and not tested

Tested on 2026-11-28 in Docker, with SQL Server 2022 and the official
`nopcommerceteam/nopcommerce:5.00.1` and `nopcommerceteam/nopcommerce:4.90.8`
images, each store installed with sample data, and a test wallet on a live
relay. On each, the release ZIP for that line was uploaded in **Configuration
→ Local plugins → Upload plugin or theme**, the application restarted, the
plugin installed from the admin, the payment method turned on, and the test
wallet's receive-only code saved on the Configure page (its status report
read the wallet preflight as ok). In Chromium, a guest who checked out with
the method and paid on the pay page saw the order paid there; a guest who
closed the pay page before paying had the order marked paid by the scheduled
task, run from the admin. Both orders read Paid in the database, with the
settled payment row and an order note naming the payment hash. The plugin's
unit suite (39 tests) passes against both nopCommerce lines.

Swaps were not tested end to end on nopCommerce: no swap, through a real or
a test swap provider, has been paid on these stores.

Also not tested: MySQL/MariaDB and PostgreSQL stores (the plugin supports
them; only SQL Server ran), multi-store installations, a web farm, the
nopCommerce marketplace listing, and updating from an older release of the
plugin.

## Next

- [Swap refunds](/guides/swap-refunds.md)
- [How OpenReceive stores payments](/guides/storage.md)
- [Payment safety](/guides/payment-safety-upgrade.md)
