openreceive 0.4.15 → 0.4.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +11 -0
- data/lib/openreceive/version.rb +1 -1
- data/skills/integrate-openreceive/SKILL.md +1 -1
- data/skills/integrate-openreceive/references/btcpay.md +5 -1
- data/skills/integrate-openreceive/references/django.md +20 -13
- data/skills/integrate-openreceive/references/fastapi.md +1 -1
- data/skills/integrate-openreceive/references/fastify.md +1 -1
- data/skills/integrate-openreceive/references/laravel.md +1 -1
- data/skills/integrate-openreceive/references/next.md +1 -1
- data/skills/integrate-openreceive/references/node.md +1 -1
- data/skills/integrate-openreceive/references/php.md +1 -1
- data/skills/integrate-openreceive/references/rails.md +1 -1
- data/skills/integrate-openreceive/references/woocommerce.md +165 -61
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 1b88e57e809fdba10281f339a7b3231d01fca0453150bf760310a38d965612d7
|
|
4
|
+
data.tar.gz: c7872056ac23544ce027e948d447cf9aba8d6cc6e19c648c06a75efaee6a1793
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3b1f235c856217f9bc07e3f7da11c864db380389cfb336aad9b14ee79cc5d4386e081168847a9f1eb8eb646b7b73b2111bb8920f02e17fb2cf5cf1e41ead1ca7
|
|
7
|
+
data.tar.gz: 25901a3851cc34f168c8e480132e2e0d497b6014e3b95c9f2ed86044fbd759555aac511c7454a565bdbcbb088cbbb0c12aa19ce664c54dda595955541c742350
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.4.17 - 2026-10-06
|
|
4
|
+
|
|
5
|
+
Release with the complete 0.4.17 package family. The bundled agent skills carry
|
|
6
|
+
the revised WooCommerce directions, and every payload now asks to be fetched
|
|
7
|
+
raw. No Ruby runtime changes from 0.4.16.
|
|
8
|
+
|
|
9
|
+
## 0.4.16 - 2026-10-06
|
|
10
|
+
|
|
11
|
+
Release with the complete 0.4.16 package family and corrected shared agent
|
|
12
|
+
directions. No Ruby runtime changes from 0.4.15.
|
|
13
|
+
|
|
3
14
|
## 0.4.15 - 2026-10-06
|
|
4
15
|
|
|
5
16
|
- Install agent skills with `bin/rails openreceive:skills` (optional
|
data/lib/openreceive/version.rb
CHANGED
|
@@ -143,7 +143,7 @@ and BTCPay manage installation through their plugins; follow their references.
|
|
|
143
143
|
| FastAPI | `openreceive doctor --app main:app` | `nwc_client`, `price_provider`, `swap_providers` on `openreceive_router`, using `openreceive.testing` fakes |
|
|
144
144
|
| Laravel | `php artisan openreceive:doctor` | Bind `ReceiveNwcClient`, `PriceProvider`, and `OpenReceiveServiceProvider::SWAP_PROVIDERS` in the container |
|
|
145
145
|
| Plain PHP | `php bin/doctor` (host script calling `$engine->doctor()`) | Build `Service` with `OpenReceive\Testing\FakeWallet`, `FakeSwapProvider`, and `OpenReceive\Rates\StaticPriceProvider` |
|
|
146
|
-
| WordPress | `wp openreceive doctor` | Repository development: the documented Docker `compose.testkit.yml` override |
|
|
146
|
+
| WordPress | `wp openreceive doctor`, then `wp openreceive test-invoice <order id>` for a real invoice | Repository development: the documented Docker `compose.testkit.yml` override |
|
|
147
147
|
| BTCPay | Follow the plugin reference's connection and checkout checks | Use the plugin's Docker test setup in its reference |
|
|
148
148
|
|
|
149
149
|
The routes, persistence, reconciliation, and fulfillment hooks then run the
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# OpenReceive agent directions (BTCPay Server)
|
|
2
2
|
|
|
3
|
-
These directions describe OpenReceive 0.4.
|
|
3
|
+
These directions describe OpenReceive 0.4.17. If you fetched this file, fetch it raw (`curl -fsSL https://openreceive.org/agent-directions/btcpay.md`), not through a summarizing tool: a summary drops steps.
|
|
4
4
|
|
|
5
5
|
Connect a BTCPay Server store to a receive-only NWC wallet with the OpenReceive
|
|
6
6
|
plugin, and optionally let payers pay BTCPay invoices with USDT, USDC, ETH or
|
|
@@ -164,13 +164,17 @@ them to install the plugin for you.
|
|
|
164
164
|
|
|
165
165
|
**1. Open the Plugins menu.** It is the plug icon in the top-right corner.
|
|
166
166
|
|
|
167
|
+
|
|
167
168
|
**2. Click Plugin Directory.**
|
|
168
169
|
|
|
170
|
+
|
|
169
171
|
**3. Search for `openreceive`** and click the **OpenReceive** result.
|
|
170
172
|
|
|
173
|
+
|
|
171
174
|
**4. Click Install in BTCPay Server.** Confirm when prompted, then click
|
|
172
175
|
**Restart now** and wait for BTCPay to come back.
|
|
173
176
|
|
|
177
|
+
|
|
174
178
|
At startup, BTCPay creates the plugin's two tables in its own Postgres
|
|
175
179
|
database: `openreceive_invoices` and `openreceive_swaps`, in the schema
|
|
176
180
|
`BTCPayServer.Plugins.OpenReceive`. Nothing else is created.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# OpenReceive agent directions (Django)
|
|
2
2
|
|
|
3
|
-
These directions describe OpenReceive 0.4.
|
|
3
|
+
These directions describe OpenReceive 0.4.17. If you fetched this file, fetch it raw (`curl -fsSL https://openreceive.org/agent-directions/django.md`), not through a summarizing tool: a summary drops steps.
|
|
4
4
|
|
|
5
5
|
Add OpenReceive to a Django project — the app you are already working in. You
|
|
6
6
|
do not need a copy of the OpenReceive source: the Python package is on PyPI
|
|
@@ -366,17 +366,18 @@ Then add the app, point it at a host class, and mount the routes:
|
|
|
366
366
|
INSTALLED_APPS += ["openreceive.django"]
|
|
367
367
|
|
|
368
368
|
OPENRECEIVE = {
|
|
369
|
-
"HOST": "shop.openreceive_host.Host",
|
|
369
|
+
"HOST": "shop.openreceive_host.Host", # the class with the three hooks (generated below)
|
|
370
370
|
"PRICE_CURRENCIES": ["USD"],
|
|
371
|
-
"RATE_LIMITING": False,
|
|
372
|
-
"OPPORTUNISTIC_RECONCILE": True,
|
|
373
|
-
"DATABASE": "default",
|
|
371
|
+
"RATE_LIMITING": False, # True for public web shops (see below)
|
|
372
|
+
"OPPORTUNISTIC_RECONCILE": True, # or {"min_interval_seconds": …}; False only with your own worker
|
|
373
|
+
"DATABASE": "default", # the DATABASES alias that holds the two engine tables
|
|
374
374
|
}
|
|
375
375
|
```
|
|
376
376
|
|
|
377
377
|
```python
|
|
378
378
|
# urls.py
|
|
379
379
|
from django.urls import include, path
|
|
380
|
+
|
|
380
381
|
urlpatterns += [path("openreceive/", include("openreceive.django.urls"))]
|
|
381
382
|
```
|
|
382
383
|
|
|
@@ -420,9 +421,9 @@ The generated host module explains this and shows the guarded transition:
|
|
|
420
421
|
|
|
421
422
|
```python
|
|
422
423
|
def on_paid(self, settlement: PaymentSettlement) -> None:
|
|
423
|
-
claimed = Order.objects.filter(
|
|
424
|
-
|
|
425
|
-
)
|
|
424
|
+
claimed = Order.objects.filter(pk=settlement.reference, state="awaiting_payment").update(
|
|
425
|
+
state="paid", paid_at=datetime.fromtimestamp(settlement.paid_at, tz=UTC)
|
|
426
|
+
)
|
|
426
427
|
if claimed == 0:
|
|
427
428
|
return # someone else already fulfilled it
|
|
428
429
|
|
|
@@ -450,7 +451,9 @@ instead:
|
|
|
450
451
|
|
|
451
452
|
```python
|
|
452
453
|
def on_paid(self, settlement: PaymentSettlement) -> None:
|
|
453
|
-
order =
|
|
454
|
+
order = (
|
|
455
|
+
Order.objects.select_for_update().filter(pk=settlement.reference).first()
|
|
456
|
+
) # SELECT … FOR UPDATE
|
|
454
457
|
if order is None or order.state != "awaiting_payment":
|
|
455
458
|
return
|
|
456
459
|
order.state = "paid"
|
|
@@ -533,8 +536,9 @@ from openreceive.server import HookContext
|
|
|
533
536
|
from openreceive.storage import PaymentSettlement
|
|
534
537
|
|
|
535
538
|
from shop.models import Order # YOUR model — it could be named anything. OpenReceive
|
|
536
|
-
|
|
537
|
-
|
|
539
|
+
# never sees it or touches its table; these hooks are the
|
|
540
|
+
# only bridge between the engine and your data.
|
|
541
|
+
|
|
538
542
|
|
|
539
543
|
class Host:
|
|
540
544
|
# Your policy, called before every checkout/payment/swap request. `context`
|
|
@@ -564,8 +568,11 @@ class Host:
|
|
|
564
568
|
order = Order.objects.filter(pk=reference).first()
|
|
565
569
|
if order is None:
|
|
566
570
|
return None
|
|
567
|
-
return {
|
|
568
|
-
|
|
571
|
+
return {
|
|
572
|
+
"currency": "USD",
|
|
573
|
+
"value": str(order.total),
|
|
574
|
+
"description": f"{order.items.count()} items",
|
|
575
|
+
}
|
|
569
576
|
|
|
570
577
|
# Runs inside the settlement transaction, only for the order's first settled
|
|
571
578
|
# attempt. The WHERE clause is the lock: a second fulfillment path of yours
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# OpenReceive agent directions (FastAPI)
|
|
2
2
|
|
|
3
|
-
These directions describe OpenReceive 0.4.
|
|
3
|
+
These directions describe OpenReceive 0.4.17. If you fetched this file, fetch it raw (`curl -fsSL https://openreceive.org/agent-directions/fastapi.md`), not through a summarizing tool: a summary drops steps.
|
|
4
4
|
|
|
5
5
|
Add OpenReceive to a FastAPI application — the app you are already working in.
|
|
6
6
|
You do not need a copy of the OpenReceive source: the engine is on PyPI
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# OpenReceive agent directions (Fastify)
|
|
2
2
|
|
|
3
|
-
These directions describe OpenReceive 0.4.
|
|
3
|
+
These directions describe OpenReceive 0.4.17. If you fetched this file, fetch it raw (`curl -fsSL https://openreceive.org/agent-directions/fastify.md`), not through a summarizing tool: a summary drops steps.
|
|
4
4
|
|
|
5
5
|
Add OpenReceive to a Fastify application — the app you are already working in.
|
|
6
6
|
You do not need a copy of the OpenReceive source: the packages are on npm, and
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# OpenReceive agent directions (Laravel)
|
|
2
2
|
|
|
3
|
-
These directions describe OpenReceive 0.4.
|
|
3
|
+
These directions describe OpenReceive 0.4.17. If you fetched this file, fetch it raw (`curl -fsSL https://openreceive.org/agent-directions/laravel.md`), not through a summarizing tool: a summary drops steps.
|
|
4
4
|
|
|
5
5
|
Add OpenReceive to a Laravel application — the app you are already working in.
|
|
6
6
|
You do not need a copy of the OpenReceive source: the package is on Packagist
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# OpenReceive agent directions (Next.js)
|
|
2
2
|
|
|
3
|
-
These directions describe OpenReceive 0.4.
|
|
3
|
+
These directions describe OpenReceive 0.4.17. If you fetched this file, fetch it raw (`curl -fsSL https://openreceive.org/agent-directions/next.md`), not through a summarizing tool: a summary drops steps.
|
|
4
4
|
|
|
5
5
|
Add OpenReceive to a Next.js App Router application — the app you are already
|
|
6
6
|
working in. You do not need a copy of the OpenReceive source: the packages are
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# OpenReceive agent directions (Node.js)
|
|
2
2
|
|
|
3
|
-
These directions describe OpenReceive 0.4.
|
|
3
|
+
These directions describe OpenReceive 0.4.17. If you fetched this file, fetch it raw (`curl -fsSL https://openreceive.org/agent-directions/node.md`), not through a summarizing tool: a summary drops steps.
|
|
4
4
|
|
|
5
5
|
Add OpenReceive to a Node application — the app you are already working in. You
|
|
6
6
|
do not need a copy of the OpenReceive source: the packages are on npm, and the
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# OpenReceive agent directions (PHP)
|
|
2
2
|
|
|
3
|
-
These directions describe OpenReceive 0.4.
|
|
3
|
+
These directions describe OpenReceive 0.4.17. If you fetched this file, fetch it raw (`curl -fsSL https://openreceive.org/agent-directions/php.md`), not through a summarizing tool: a summary drops steps.
|
|
4
4
|
|
|
5
5
|
Add OpenReceive to a PHP application — the app you are already working in. You
|
|
6
6
|
do not need a copy of the OpenReceive source: the engine is on Packagist
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# OpenReceive agent directions (Rails)
|
|
2
2
|
|
|
3
|
-
These directions describe OpenReceive 0.4.
|
|
3
|
+
These directions describe OpenReceive 0.4.17. If you fetched this file, fetch it raw (`curl -fsSL https://openreceive.org/agent-directions/rails.md`), not through a summarizing tool: a summary drops steps.
|
|
4
4
|
|
|
5
5
|
Add OpenReceive to a Rails application — the app you are already working in. You
|
|
6
6
|
do not need a copy of the OpenReceive source: the gem is on RubyGems, the
|
|
@@ -1,64 +1,155 @@
|
|
|
1
1
|
# OpenReceive agent directions (WordPress + WooCommerce)
|
|
2
2
|
|
|
3
|
-
These directions describe OpenReceive 0.4.
|
|
4
|
-
|
|
5
|
-
Install and configure the OpenReceive gateway in the
|
|
6
|
-
|
|
7
|
-
The plugin bundles the PHP engine and checkout assets
|
|
8
|
-
install npm or Composer packages on the WordPress server
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
and
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
3
|
+
These directions describe OpenReceive 0.4.17. If you fetched this file, fetch it raw (`curl -fsSL https://openreceive.org/agent-directions/woocommerce.md`), not through a summarizing tool: a summary drops steps.
|
|
4
|
+
|
|
5
|
+
Install and configure the OpenReceive payment gateway in the WooCommerce store
|
|
6
|
+
you are working in. Preserve its theme, checkout, customer accounts, order
|
|
7
|
+
model and prices. The plugin bundles the PHP engine and checkout assets: do not
|
|
8
|
+
install npm or Composer packages on the WordPress server, and do not clone the
|
|
9
|
+
OpenReceive repository unless the release download in Step 1 fails.
|
|
10
|
+
|
|
11
|
+
The one required credential is a receive-only NWC code (Nostr Wallet Connect):
|
|
12
|
+
a string from the merchant's wallet that can create invoices and read their
|
|
13
|
+
status, and cannot spend. A swap provider (an "LSC" code) optionally lets
|
|
14
|
+
customers pay with USDT, USDC, ETH or SOL instead; the provider converts the
|
|
15
|
+
payment to BTC over Lightning in the merchant's connected wallet. Available
|
|
16
|
+
assets and networks depend on the provider.
|
|
17
|
+
|
|
18
|
+
Run every `wp` command below where this store's WP-CLI runs. When WordPress
|
|
19
|
+
runs in Docker Compose, prefix it with the service that has WP-CLI, for
|
|
20
|
+
example `docker compose run --rm -T cli wp …` or
|
|
21
|
+
`docker compose exec -T wordpress wp …`. `-T` passes stdin through. If the
|
|
22
|
+
store has no WP-CLI at all (managed hosting without a shell), say so and walk
|
|
23
|
+
the user through the quickstart's admin screens instead.
|
|
24
|
+
|
|
25
|
+
## Step 0 — ask for the two codes, one question at a time
|
|
26
|
+
|
|
27
|
+
Before anything else, check one thing: whether OpenReceive is already
|
|
28
|
+
installed (`wp plugin is-active openreceive`). If it is, run
|
|
29
|
+
`wp openreceive doctor`. It prints `NWC_URI: set` or `unset` (likewise
|
|
30
|
+
`LSC_URI_PRIMARY`), never the values. A code that is already set is not asked
|
|
31
|
+
for again; if both are set, skip to `wp openreceive configure --enable` at
|
|
32
|
+
the end of Step 2.
|
|
33
|
+
|
|
34
|
+
Otherwise your next action is a question to the user. Do not install the
|
|
35
|
+
plugin, edit Docker files or search anywhere else before asking it. Do not
|
|
36
|
+
read wp-config.php, deploy config, container environments or other projects
|
|
37
|
+
looking for a code: a new store has neither code yet.
|
|
38
|
+
|
|
39
|
+
The user never runs a command and never edits a file. They paste each code
|
|
40
|
+
into this chat; you store it. That is the supported path: do not ask them to
|
|
41
|
+
run the save command themselves, and do not tell them to revoke or replace a
|
|
42
|
+
code because it was pasted here. Ask one question per message.
|
|
43
|
+
|
|
44
|
+
1. **First message — the NWC code, and nothing else.**
|
|
45
|
+
|
|
46
|
+
> To receive payments I need a receive-only wallet code. In Rizful: open
|
|
47
|
+
> the menu, tap NWC, choose Receive-only NWC code, and tap Copy
|
|
48
|
+
> (https://openreceive.org/get_a_nwc_code_to_receive_payments). If you would
|
|
49
|
+
> rather run your own wallet, Alby Hub works too: Connections → Add
|
|
50
|
+
> Connection → Read Only. Paste the code here and I will store it.
|
|
51
|
+
|
|
52
|
+
2. **When they paste it.** If it does not start with `nostr+walletconnect://`,
|
|
53
|
+
ask them to copy the receive-only code again. Otherwise do not repeat it:
|
|
54
|
+
reply only that you have it, then ask the next question. You store it in
|
|
55
|
+
Step 2.
|
|
56
|
+
3. **Second message — swaps.** If the user asked for stablecoins, USDT, USDC,
|
|
57
|
+
ETH, SOL, altcoins or "crypto" (as in "Bitcoin and stablecoin payments"),
|
|
58
|
+
this message IS the walkthrough below: do not skip it, and do not ask yes
|
|
59
|
+
or no first. Otherwise ask whether customers should also be able to pay
|
|
60
|
+
with USDT, USDC, ETH or SOL, then give the walkthrough. The walkthrough:
|
|
61
|
+
|
|
62
|
+
> Go to https://lightning-swap.com, sign in for API keys, create a key, and
|
|
63
|
+
> copy the whole URI (https://openreceive.org/set_up_swap_provider). Paste
|
|
64
|
+
> it here and I will store it — or say "Bitcoin only" and I will continue
|
|
65
|
+
> without it.
|
|
66
|
+
|
|
67
|
+
Mention FixedFloat only if they already use it.
|
|
68
|
+
4. **When they paste it.** If it does not start with
|
|
69
|
+
`lightning+swapconnect://`, ask them to copy it again. Swaps are now on,
|
|
70
|
+
so keep the route back (the swap non-negotiable below).
|
|
71
|
+
|
|
72
|
+
Do not report setup as complete until the NWC code is saved, and the LSC code
|
|
73
|
+
is saved or the user said "Bitcoin only". Never invent a placeholder code.
|
|
74
|
+
|
|
75
|
+
## Step 1 — install the plugin
|
|
76
|
+
|
|
77
|
+
Install the plugin built for this release. Never install the GitHub
|
|
78
|
+
source-code ZIP or a ZIP from an older release:
|
|
79
|
+
|
|
80
|
+
```sh
|
|
81
|
+
wp plugin install https://github.com/OpenReceive/openreceive/releases/download/v0.4.17/openreceive-wordpress-0.4.17.zip --activate
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
It needs WooCommerce active, and PHP 8.2+ with GMP and sodium in BOTH the web
|
|
85
|
+
PHP and the WP-CLI PHP. On the official `wordpress` and `wordpress:cli` Docker
|
|
86
|
+
images, activation fails with "OpenReceive requires the PHP sodium and GMP
|
|
87
|
+
extensions": add GMP to both images as "Enable GMP in both PHP runtimes" below
|
|
88
|
+
says, rebuild both, then install again. If the URL answers 404, build the same
|
|
89
|
+
tag as "Get the installable archive" below says.
|
|
90
|
+
|
|
91
|
+
## Step 2 — store the codes, then enable the gateway
|
|
92
|
+
|
|
93
|
+
Store each code yourself, one per command, and never as a shell argument:
|
|
94
|
+
|
|
95
|
+
1. Write the code with your file-editing tool, not a shell command (no
|
|
96
|
+
`echo`, `printf` or heredoc), to a new file outside the repository, such
|
|
97
|
+
as `/tmp/openreceive-code`.
|
|
98
|
+
2. Run `wp openreceive configure --nwc-uri=- < /tmp/openreceive-code`. In
|
|
99
|
+
Docker: `docker compose run --rm -T cli wp openreceive configure --nwc-uri=- < /tmp/openreceive-code`.
|
|
100
|
+
For the LSC code, use `--lsc-uri-primary=-`.
|
|
101
|
+
3. Delete the file (`rm /tmp/openreceive-code`), whether the command passed
|
|
102
|
+
or not.
|
|
103
|
+
|
|
104
|
+
The command runs the receive-only wallet preflight, encrypts the code and
|
|
105
|
+
prints only "Settings saved; wallet preflight passed."; a failure keeps the
|
|
106
|
+
previous settings. If it reports spend methods such as `pay_invoice`, ask the
|
|
107
|
+
user for a receive-only code again. Never turn on the spend-capable override.
|
|
108
|
+
`wp wc payment_gateway` and WooCommerce REST writes of these fields are
|
|
109
|
+
rejected on purpose; do not use them. A code set as a constant in
|
|
110
|
+
wp-config.php wins over the stored one and changes only through the host's
|
|
111
|
+
secret workflow.
|
|
112
|
+
|
|
113
|
+
Then run `wp openreceive configure --enable` and `wp openreceive doctor`.
|
|
114
|
+
Doctor names any failed check and exits nonzero; fix it before going on.
|
|
115
|
+
|
|
116
|
+
## Step 3 — mint a test invoice
|
|
117
|
+
|
|
118
|
+
Create a pending test order that pays with OpenReceive, then mint its
|
|
119
|
+
Lightning invoice from the terminal:
|
|
120
|
+
|
|
121
|
+
```sh
|
|
122
|
+
wp wc shop_order create --user=<admin user id> --payment_method=openreceive \
|
|
123
|
+
--line_items='[{"product_id":<product id>,"quantity":1}]' --porcelain
|
|
124
|
+
wp openreceive test-invoice <order id>
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
`test-invoice` goes through the same checkout route as the order-pay page. It
|
|
128
|
+
prints the amount in sats, the BOLT11 invoice and the order-pay link. Give the
|
|
129
|
+
user that link: it opens the checkout with the configured methods and resumes
|
|
130
|
+
this same invoice. Ask them to pay only if they want a real settlement test,
|
|
131
|
+
and tell them the test order is theirs to delete.
|
|
132
|
+
|
|
133
|
+
## Non-negotiables
|
|
134
|
+
|
|
135
|
+
- Never print, log or commit a code, never put one in a shell argument, and
|
|
136
|
+
never write one into source files, wp-config.php or browser code. Doctor's
|
|
137
|
+
set/unset is all you report.
|
|
138
|
+
- Receive-only NWC is required. Never turn on the spend-capable override to
|
|
139
|
+
get past the preflight.
|
|
140
|
+
- The plugin owns only its payment-attempt tables in the WordPress database.
|
|
141
|
+
WooCommerce owns orders, totals, stock and email. Do not add an external
|
|
142
|
+
idempotency store, payment database or custom fulfillment code.
|
|
143
|
+
- IF SWAPS ARE ON, KEEP THE ROUTE BACK. A deposit that arrives short or late
|
|
144
|
+
becomes refundable, and the customer claims it later on the same order-pay
|
|
145
|
+
link (guests return with the order key in it). Keep order-pay links
|
|
146
|
+
reachable, and keep the plugin installed while swap orders may still need a
|
|
147
|
+
refund. https://openreceive.org/guides/swap-refunds.md
|
|
148
|
+
- A receive-only wallet cannot send merchant refunds. Refund a settled
|
|
149
|
+
payment manually from the wallet.
|
|
150
|
+
- Settlement runs on checkout requests and an every-minute scheduled job. On a
|
|
151
|
+
low-traffic store, run WordPress scheduled work from a system cron;
|
|
152
|
+
`wp openreceive notifications` is an optional long-running worker.
|
|
62
153
|
|
|
63
154
|
## Further reading
|
|
64
155
|
|
|
@@ -95,7 +186,7 @@ database or application.
|
|
|
95
186
|
|
|
96
187
|
### Get the installable archive
|
|
97
188
|
|
|
98
|
-
Download [openreceive-wordpress-0.4.
|
|
189
|
+
Download [openreceive-wordpress-0.4.17.zip](https://github.com/OpenReceive/openreceive/releases/download/v0.4.17/openreceive-wordpress-0.4.17.zip)
|
|
99
190
|
from the matching release. Historical releases may lack this asset. If that exact
|
|
100
191
|
URL returns 404, build the same tag below; never silently install an older ZIP.
|
|
101
192
|
The GitHub source-code ZIP is not an installable plugin. On a development machine
|
|
@@ -104,7 +195,7 @@ with Node 22+, PHP 8.2+ with GMP/sodium, Composer and WP-CLI:
|
|
|
104
195
|
```sh
|
|
105
196
|
git clone https://github.com/OpenReceive/openreceive.git
|
|
106
197
|
cd openreceive
|
|
107
|
-
git checkout v0.4.
|
|
198
|
+
git checkout v0.4.17
|
|
108
199
|
npm ci
|
|
109
200
|
npm run build:packages
|
|
110
201
|
composer install --working-dir=packages/php/wordpress
|
|
@@ -189,6 +280,19 @@ reports the failed check with credentials redacted and exits nonzero on failure.
|
|
|
189
280
|
The default payment title becomes “Bitcoin & crypto (OpenReceive)” with swaps;
|
|
190
281
|
a customized title is preserved.
|
|
191
282
|
|
|
283
|
+
To check checkout from the terminal, mint an invoice for an unpaid order whose
|
|
284
|
+
payment method is OpenReceive:
|
|
285
|
+
|
|
286
|
+
```sh
|
|
287
|
+
wp wc shop_order create --user=<admin user id> --payment_method=openreceive \
|
|
288
|
+
--line_items='[{"product_id":<product id>,"quantity":1}]' --porcelain
|
|
289
|
+
wp openreceive test-invoice <order id>
|
|
290
|
+
```
|
|
291
|
+
|
|
292
|
+
`test-invoice` uses the same checkout route as the order-pay page. It prints the
|
|
293
|
+
amount in sats, the Lightning invoice and the order-pay link, which opens the
|
|
294
|
+
checkout on that invoice. Delete the test order when you are done.
|
|
295
|
+
|
|
192
296
|
### Checkout and settlement
|
|
193
297
|
|
|
194
298
|
Both WooCommerce checkout blocks and classic checkout send the customer to the
|