This is the full file; follow it from Step 0.

# OpenReceive agent directions (nopCommerce)

```sh
# READ THIS FIRST: this file is 19 KB and a summary drops required steps. Download it whole:
curl -fsSL https://openreceive.org/agent-directions/nopcommerce/full.md
# If your tool cuts long output, save it and read it in parts: curl -fsSL -o /tmp/openreceive-directions.md https://openreceive.org/agent-directions/nopcommerce/full.md
# Skip the download only if you already have all of it: pasted, read from disk or fetched raw.
```

**Step 0 in brief** (Step 0 below has the details):

- Check the store's nopCommerce line first (5.00 or 4.90), then ask the user to get a receive-only NWC code.
- Next ask about the LSC code. If the user wants stablecoins, USDT, USDC, ETH or SOL, do not ask yes/no first.
- The merchant pastes each code on the plugin's Configure page in the admin, not in this chat.
- Never write a code into appsettings.json, the database, nopCommerce's settings or any file.
- Do not suggest rotating or revoking a code because it was pasted here.
- Setup is done only when the NWC code is saved, and the LSC code is saved or the user said "Bitcoin only".

These directions describe OpenReceive 0.6.4.

Install the OpenReceive payment plugin in the nopCommerce store you are
working in. Preserve its theme, customers, products, orders and prices. The
plugin is a release ZIP (`Payments.OpenReceive`) that brings the OpenReceive
.NET engine with it: do not clone the OpenReceive repository, do not build
the plugin from source, and do not write payment code of your own.

The one required credential is a receive-only NWC code (Nostr Wallet Connect):
a string from the merchant's wallet that can create invoices and read their
status, and cannot spend. A swap provider (an "LSC" code) optionally lets
customers pay with USDT, USDC, ETH or SOL instead; the provider converts the
payment to BTC over Lightning in the merchant's connected wallet. Available
assets and networks depend on the provider.

nopCommerce has no command line for its admin. You put the plugin in place
and restart the store; the merchant installs it and saves the codes in the
admin, in their own browser. The codes never pass through you.

## Step 0 — find the store, then ask for the codes

Before anything else, check two things, and change nothing yet:

- How this store runs: the folder the application runs from (it holds
  `Nop.Web.dll` and a `Plugins/` folder), or the container that runs it (the
  official image runs from `/app`), or, in a source checkout, the solution's
  `src/Presentation/Nop.Web/Plugins/` output folder.
- Its nopCommerce line, from `Nop.Core.dll`'s version, the image tag, or
  `NopVersion.CURRENT_VERSION` in the source. OpenReceive supports **5.00**
  and **4.90**. On any other line, say which line the store runs and stop.

If `Plugins/Payments.OpenReceive/plugin.json` already exists, the plugin is
already there: ask the merchant whether its Configure page shows the wallet
code saved. If it does, skip to Step 3; if not, skip to Step 2.

Otherwise your next action is a question to the user. Do not download the
plugin, edit Docker files or search anywhere else before asking it. A new
store has neither code yet.

Two codes are needed, and only the merchant can save a code: on the plugin's
Configure page in the nopCommerce admin, which exists once the plugin is
installed (Step 2). So the user gets each code ready now and pastes it there,
not into this chat. Ask one question per message.

1. **First message — the NWC code, and nothing else.**

   > To receive payments you need a receive-only wallet code. In Rizful: open
   > the menu, tap NWC, choose Receive-only NWC code, and tap Copy
   > (https://openreceive.org/get_a_nwc_code_to_receive_payments). If you would
   > rather run your own wallet, Alby Hub works too: Connections → Add
   > Connection → Read Only. Keep the code for the plugin's settings page in
   > your nopCommerce admin; do not paste it here. Tell me when you have it.

2. **If the user pastes a code into the chat** instead, do not repeat it and
   do not write it into any file, setting or log. Thank them, and say they
   will paste it on the Configure page in Step 2. Do not suggest replacing
   the code.
3. **Second message — swaps.** If the user asked for stablecoins, USDT, USDC,
   ETH, SOL or coins other than Bitcoin (as in "Bitcoin and stablecoin
   payments"), this message IS the walkthrough below: do not skip it, and do
   not ask yes or no first. Otherwise ask whether customers should also be
   able to pay with USDT, USDC, ETH or SOL, then give the walkthrough. The
   walkthrough:

   > Go to https://lightning-swap.com, sign in for API keys, create a key, and
   > copy the whole URI (https://openreceive.org/set_up_swap_provider). Keep
   > it for the same settings page — or say "Bitcoin only" and I will continue
   > without it.

   Mention FixedFloat only if they already use it. Swaps on means the route
   back is part of this integration (the swap non-negotiable below).

Do not report setup as complete until the merchant reports the NWC code
saved, and the LSC code saved or "Bitcoin only". Never invent a placeholder
code.

## Step 1 — put the plugin in place

Download the ZIP for the store's line:

```sh
# nopCommerce 5.00
curl -fsSL -o /tmp/openreceive-nopcommerce.zip https://github.com/OpenReceive/openreceive/releases/download/v0.6.4/openreceive-nopcommerce-0.6.4.zip
# nopCommerce 4.90
curl -fsSL -o /tmp/openreceive-nopcommerce.zip https://github.com/OpenReceive/openreceive/releases/download/v0.6.4/openreceive-nopcommerce-4.90-0.6.4.zip
```

Its root holds one folder, `Payments.OpenReceive`. Then either:

- unzip it into the `Plugins/` folder the store runs from, so that
  `Plugins/Payments.OpenReceive/plugin.json` exists
  (`unzip -oq /tmp/openreceive-nopcommerce.zip -d <store folder>/Plugins`). In
  a container, unzip it to `/tmp/openreceive-nopcommerce` and run
  `docker cp /tmp/openreceive-nopcommerce/Payments.OpenReceive <container>:/app/Plugins/Payments.OpenReceive`.
  A folder copied into a container is lost when the container is recreated:
  if the project mounts `Plugins/` or builds its own image, put it there
  instead. Then restart the application the way this project restarts it
  (`docker restart <container>`, its compose service, its system service),
  never by killing a process by name; or
- tell the merchant to upload the ZIP in **Configuration → Local plugins →
  Upload plugin or theme** and click **Restart application** in the admin's
  header.

The folder holds compiled assemblies; do not add it to the store's solution
or project files. If the project's own rules (its `AGENTS.md`, contributing
guide, deploy process) forbid adding plugins by hand, ask the owner and wait.

## Step 2 — the merchant installs it and saves the codes

Give the merchant these steps, in one message:

1. **Configuration → Local plugins**: find **Bitcoin Lightning
   (OpenReceive)**, click **Install**, then **Restart application to apply
   changes**.
2. **Configuration → Payment methods**: mark it active and click
   **Configure**.
3. Paste the receive-only NWC code and click **Save**.
4. If they have a swap code: paste it as the primary swap code on the same
   page, and click **Save**.

The page asks the wallet before it saves the code: a code that cannot make
invoices, or one that can also spend, is refused and nothing is saved. If the
merchant reports spend methods such as `pay_invoice`, they need a receive-only
code instead. Ask them to tell you when the page's status report shows the
wallet code saved and the wallet preflight ok, or to paste the status report
(it shows codes as saved or not, never their values). The page's **Test
invoice** button asks the wallet for a 10-sat invoice without making an
order.

Never write a code into `appsettings.json`, the database, nopCommerce's
settings or any file yourself.

## Step 3 — hand over, then stop

You cannot pay an invoice: the code is receive-only. Do not pay, settle or
mark an order paid, and do not look for a way to (a wallet control port, a
test endpoint, another wallet). If the user wants a real settlement test, they
place an order and pay it on its pay page from their own wallet; afterwards
the order reads Paid.

Once the merchant reports the status clean, your last message starts "Setup
is finished" and has at most six short lines: "Open <store url>, add a product
and choose Bitcoin Lightning (OpenReceive) at checkout: confirming the order
opens the payment page", the methods the checkout offers (Bitcoin, plus USDT,
USDC, ETH and SOL when the swap code is saved), one line that the store must
keep running for its scheduled task (**OpenReceive: settle Lightning
payments**) to settle payments whose customer left the page, and one line of
what to look at. Do not mention a minimum or say a coin will not work: a
provider minimum depends on the order total. Do not add containers, services
or scheduled jobs yourself. Send nothing after it.

## Non-negotiables

- Never print, log or commit a code, and never write one into source files,
  configuration files, the database or browser code. The Configure page's
  saved or not saved is all anyone reports.
- Do not suggest rotating, revoking or replacing a code because it was pasted
  into this chat; ask the merchant to paste it on the Configure page instead.
- Work only in this store. Never read or run anything from another project or
  directory on this machine. A browser, Playwright, hand-made calls to the
  checkout's routes, database queries and reading the plugin's source are not
  part of setup: when the status report shows a failure, report it.
- Receive-only NWC is required. Never get past the wallet check with a code
  that can spend.
- The plugin owns only its two payment tables in the store's database and its
  encrypted settings. nopCommerce owns customers, orders, prices, shipping and
  email. Do not add an external payment database or custom fulfillment code,
  and do not edit nopCommerce's own files or the theme.
- IF SWAPS ARE ON, KEEP THE ROUTE BACK. A deposit that arrives short or late
  becomes refundable, and the customer claims it later from the order's pay
  page. Keep the plugin installed while swap payments may still need a
  refund. https://openreceive.org/guides/swap-refunds.md
- A receive-only wallet cannot send refunds. Refund a settled payment manually
  from the wallet.

## Further reading

- [nopCommerce Quickstart](https://openreceive.org/guides/quickstart-nopcommerce.md)
- [Automated Swaps](https://openreceive.org/guides/automated-swaps.md)
- [Swap Refunds](https://openreceive.org/guides/swap-refunds.md)
- [Lightning Swap Connect URI](https://openreceive.org/guides/lightning-swap-connect.md)
- [Security](https://openreceive.org/guides/security.md)
- [Price Feeds](https://openreceive.org/guides/price-feeds.md)

## Tested, and not tested

No agent has run these directions yet. What they rest on was tested on
2026-11-28 in Docker (see the quickstart below): the release ZIP for each
line uploaded through the admin of nopCommerce 5.00.1 and 4.90.8 on SQL
Server, the plugin installed, a test wallet's receive-only code saved on the
Configure page, and two guest orders paid, one on its pay page and one by the
scheduled task. Swaps were not tested end to end on nopCommerce. Not tested:
the folder copy into a store that runs outside Docker or under IIS, a source
checkout's plugin folder, and an agent trial of these steps.

---

## The quickstart, in full

Inlined verbatim so this file needs no network access. Steps 0–3 above are the setup and this is their reference: where the two differ, the steps win.
The page it comes from is https://openreceive.org/guides/quickstart-nopcommerce.

## 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](https://openreceive.org/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.
