openreceive 0.4.32 → 0.4.33

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.
Files changed (33) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +7 -0
  3. data/lib/openreceive/nwc_ruby.rb +27 -0
  4. data/lib/openreceive/version.rb +1 -1
  5. data/skills/debug-openreceive-payment/SKILL.md +1 -0
  6. data/skills/integrate-openreceive/references/astro.md +21 -9
  7. data/skills/integrate-openreceive/references/bolt.md +3 -3
  8. data/skills/integrate-openreceive/references/btcpay.md +2 -1
  9. data/skills/integrate-openreceive/references/django.md +13 -4
  10. data/skills/integrate-openreceive/references/edd.md +12 -10
  11. data/skills/integrate-openreceive/references/fastapi.md +40 -27
  12. data/skills/integrate-openreceive/references/fastify.md +23 -10
  13. data/skills/integrate-openreceive/references/flask.md +24 -9
  14. data/skills/integrate-openreceive/references/fossbilling.md +17 -10
  15. data/skills/integrate-openreceive/references/laravel.md +22 -4
  16. data/skills/integrate-openreceive/references/lovable.md +2 -2
  17. data/skills/integrate-openreceive/references/medusa.md +2 -1
  18. data/skills/integrate-openreceive/references/mobile.md +2 -1
  19. data/skills/integrate-openreceive/references/nestjs.md +20 -9
  20. data/skills/integrate-openreceive/references/next.md +39 -26
  21. data/skills/integrate-openreceive/references/node.md +25 -11
  22. data/skills/integrate-openreceive/references/nuxt.md +21 -9
  23. data/skills/integrate-openreceive/references/odoo.md +13 -12
  24. data/skills/integrate-openreceive/references/paymenter.md +11 -7
  25. data/skills/integrate-openreceive/references/php.md +21 -7
  26. data/skills/integrate-openreceive/references/prestashop.md +28 -18
  27. data/skills/integrate-openreceive/references/rails.md +30 -10
  28. data/skills/integrate-openreceive/references/react-router.md +21 -9
  29. data/skills/integrate-openreceive/references/sveltekit.md +29 -11
  30. data/skills/integrate-openreceive/references/tanstack-start.md +21 -9
  31. data/skills/integrate-openreceive/references/vendure.md +2 -1
  32. data/skills/integrate-openreceive/references/woocommerce.md +17 -11
  33. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3889e79c57d77dd7f90037de3b98eb97ddad7002f32fb19ed076f358031769fe
4
- data.tar.gz: 90d6b8b3a80e35d939f73c9cb3491b46632664ac2b83e2958a0438c990900918
3
+ metadata.gz: 0ecb8b6bdddd85ccabd387c9ebe3e23653c2eb5ca181d393c8504d82d2fdfa61
4
+ data.tar.gz: 35199d0141a530f5e319180c3a64023397f4782e979a9b018974b2d580752560
5
5
  SHA512:
6
- metadata.gz: 73bc2e4d14d31ecb79397659d0bb396b51c5a199e6e3e0952987c1f727151cbdabe390ef1773ced907f8ef4c4bd88bab883a23908e1389db9795a63e4e46da8f
7
- data.tar.gz: 12e6315678fa08b4954d39891cb04bc1f83fb5904ea02256f22937538101c504df1358f37e2fee19a5aa9575bdd39e0a9409c6b9e31dab024e60688836ce95a8
6
+ metadata.gz: 57214c610d1684e8f604e57b2e0739fb000f520e24a044b3335c0e9ad2e75a0fe40b7629c261ea9fd4731c1bd7ff8c71a335b56397b0efec9b9ab83eddad514b
7
+ data.tar.gz: 6a05dd9a08971b9af0a3e79966461819698a249eddd1f14ffece00f0c03bd0fe1c0f1ce87c6209cfdba6d07bb87fceb229b74c8b41b841486c6e418f69eb924c
data/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.4.33 - 2026-11-09
4
+
5
+ - Added: `OpenReceive::NwcRubyReceiveClient.from_uri` builds the wallet client
6
+ a Rack host passes to `OpenReceive::Server::Service`.
7
+ - Fixed: a relay that accepts the connection and never answers now costs 12 s
8
+ instead of 30 s (`NwcRubyReceiveClient::REQUEST_TIMEOUT_SECONDS`).
9
+
3
10
  ## 0.4.32 - 2026-11-07
4
11
 
5
12
  Release with the complete 0.4.32 package family. No Ruby runtime changes
@@ -14,8 +14,35 @@ module OpenReceive
14
14
  # declares snake_case keyword arguments, and spells the list_transactions
15
15
  # window `until_ts` because `until` is a Ruby keyword.
16
16
  class NwcRubyReceiveClient
17
+ # nwc-ruby's `request_timeout:` is one budget per call: the info fetch,
18
+ # the relay handshake and the wallet's reply. Its default of 30 s is how
19
+ # long a checkout waited for its 503 on a relay that accepts the connection
20
+ # and never answers. 12 s brings that near the other engines (Python
21
+ # 10 s, Node 8 s, PHP about 6 s) and still leaves a slow wallet room:
22
+ # relay handshakes measured 0.6 to 3.2 s, a call that has not read the
23
+ # info event yet makes two of them (the info event, then the request),
24
+ # and the wallet's own make_invoice reply takes a few seconds more. A
25
+ # relay that refuses fails fast either way; the gem retries it inside the
26
+ # same budget.
27
+ REQUEST_TIMEOUT_SECONDS = 12
28
+
17
29
  attr_reader :redacted_connection_uri
18
30
 
31
+ # The adapter over a nwc-ruby client built from a connection URI, with
32
+ # REQUEST_TIMEOUT_SECONDS. The Rails engine builds its default client here;
33
+ # a Rack host passes the result to OpenReceive::Server::Service. Requires
34
+ # the nwc-ruby gem, which this gem does not depend on.
35
+ def self.from_uri(connection_uri, request_timeout: REQUEST_TIMEOUT_SECONDS, **options)
36
+ # The engine's own parser first, so a malformed code fails as
37
+ # OpenReceive::NwcUriParseError, not as whatever the gem raises.
38
+ OpenReceive.parse_nwc_uri(connection_uri)
39
+ require "nwc_ruby"
40
+ new(
41
+ client: ::NwcRuby::Client.from_uri(connection_uri, request_timeout: request_timeout, **options),
42
+ connection_uri: connection_uri
43
+ )
44
+ end
45
+
19
46
  def initialize(client:, connection_uri: nil)
20
47
  @client = client
21
48
  @redacted_connection_uri = connection_uri.nil? ? nil : OpenReceive.redact_nwc_uri(connection_uri)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module OpenReceive
4
- VERSION = "0.4.32"
4
+ VERSION = "0.4.33"
5
5
  end
@@ -19,6 +19,7 @@ URL below is raw markdown — fetch it when the step needs it.
19
19
  npx openreceive doctor # Node version, NWC_URI, swap config, wallet probe
20
20
  npx openreceive doctor --db <db> # + are openreceive_payments/openreceive_meta migrated?
21
21
  npx openreceive doctor --url http://localhost:3000 # + are the routes actually mounted?
22
+ npx openreceive doctor --scan-build <dir> # alone, after a production build: did a code reach it?
22
23
  bin/rails openreceive:doctor # Rails
23
24
  manage.py openreceive_doctor # Django
24
25
  openreceive doctor --app main:app # FastAPI
@@ -3,8 +3,9 @@ This is the full file; follow it from Step 0.
3
3
  # OpenReceive agent directions (Astro)
4
4
 
5
5
  ```sh
6
- # READ THIS FIRST: this file is 36 KB and a summary drops required steps. Download it whole:
6
+ # READ THIS FIRST: this file is 37 KB and a summary drops required steps. Download it whole:
7
7
  curl -fsSL https://openreceive.org/agent-directions/astro/full.md
8
+ # 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/astro/full.md
8
9
  # Skip the download only if you already have all of it: pasted, read from disk or fetched raw.
9
10
  ```
10
11
 
@@ -17,7 +18,7 @@ curl -fsSL https://openreceive.org/agent-directions/astro/full.md
17
18
  - Do not suggest rotating or revoking a code because it was pasted here.
18
19
  - Start the quickstart only once the NWC code is saved, and the LSC code is saved or the user said "Bitcoin only".
19
20
 
20
- These directions describe OpenReceive 0.4.32.
21
+ These directions describe OpenReceive 0.4.33.
21
22
 
22
23
  Add OpenReceive to an Astro site — the one you are already working in, on
23
24
  `@astrojs/node`. OpenReceive ships no Astro package: the integration is one
@@ -201,11 +202,16 @@ itself, and they hold for every integration.
201
202
  and not a Prisma/Drizzle relation to `openreceive_payments`.
202
203
  - Keep `NWC_URI` / `LSC_URI_*` server-only. Never put them in browser code,
203
204
  logs, or assets.
205
+ - After a production build, run `npx openreceive doctor --scan-build dist/client`. Never grep a build for a code.
204
206
  - Do not suggest rotating, revoking or replacing a code because it was pasted
205
207
  into this chat; that is the supported path.
206
208
  - Work only in this application. Never read or run anything from another
207
209
  project on this machine (its `node_modules`, tools or source), for any
208
210
  reason. A browser and Playwright are not part of setup.
211
+ - The project's own rules (its `AGENTS.md`, contributing guide) win over these
212
+ directions. If one forbids a step here, such as running migrations, ask the
213
+ owner and wait for the answer, even if doctor cannot pass yet. Do not move
214
+ the step somewhere the rule does not name, such as app startup.
209
215
  - Restart only this app's server, on the port it already uses: stop the
210
216
  process you started, or the one listening on that port, by its pid (or
211
217
  restart its Compose service). Never `pkill` or `killall` by name: that
@@ -248,21 +254,25 @@ itself, and they hold for every integration.
248
254
  (`POST /swaps`) re-serves the committed attempt — but only while it is live,
249
255
  and the shadow invoice behind a swap lasts about half an hour, after which the
250
256
  same click mints a NEW deposit address and the refund is off-screen. Keep the
251
- `payment_hash` and reopen the attempt with `POST /swaps/status`, which has no
252
- such window. On the drop-ins: `resumePaymentHash`, fed from `onState`, on
253
- `<Checkout>`; the `resume-payment-hash` attribute, fed from the
257
+ `payment_hash` on your order row, not in browser storage, and reopen the
258
+ attempt with `POST /swaps/status`, which has no such window. On the
259
+ drop-ins: `resumePaymentHash`, fed from `onState`, on `<Checkout>`; the
260
+ `resume-payment-hash` attribute, fed from the
254
261
  `openreceive-state` event (`event.detail.state.payment_hash`), on
255
262
  `<openreceive-checkout>`.
256
263
  That visit can come hours later, and `authorize` must still know the payer:
257
264
  a session that expired in between answers 403 and strands the deposit. On a
258
- guest shop, tie the order to a long-lived signed cookie, or put a secret
259
- per-order token in its URL that your page trades for that cookie.
265
+ guest shop, tie the order to a long-lived cookie signed with the app's own
266
+ secret (such as `SESSION_SECRET`, never a wallet or swap code), or put a
267
+ secret per-order token in its URL that your page trades for that cookie.
260
268
  https://openreceive.org/guides/swap-refunds.md
261
269
  - Show the payer WHAT THEY ARE BUYING. Return an optional `description` beside
262
270
  the price from `amountFor` and both drop-ins render it above the amount.
263
271
  Without it the checkout is a QR and "$1.00" with no sign of what the dollar
264
272
  is for.
265
- - Show the payer the transaction record: `createTransactionDetails(...)` rows,
273
+ - Show the payer the transaction record: `createTransactionDetails(...)` rows
274
+ (with no bundler use `renderTransactionDetailsHtml`: the standalone file has
275
+ no `createTransactionDetails`, and one bad import stops the whole page),
266
276
  collapsed behind a caret, on the live checkout AND on the receipt. A payment
267
277
  hash and a deposit txid are the only evidence a payer has that they paid you.
268
278
  `<Checkout>` / `<openreceive-checkout>` already render this panel and the
@@ -394,7 +404,9 @@ components.
394
404
  are on `@openreceive/browser`, not `/headless`.
395
405
  - A refund replaces the deposit panel. On `refund_required` also drop
396
406
  "switch payment method".
397
- - No "Open wallet" button on desktop.
407
+ - No "Open wallet" or "Pay in wallet" button, and no `lightning:` link. Cash
408
+ App cancels an invoice opened from a link and pays the same invoice scanned
409
+ or pasted. Show the QR code and a Copy invoice button.
398
410
  - Wallet suggestions: `getPaymentWizardRoutes()` +
399
411
  `createWizardRouteDisplays`. Lightning only. Logos are data URIs; tutorial
400
412
  images load from a JavaScript chunk. For a custom headless UI, load it when
@@ -17,7 +17,7 @@ If your fetch tool gave you a summary, fetch that URL again for the full text.
17
17
  - Do not suggest rotating or revoking a code because it was pasted here.
18
18
  - Start Step 1 only once NWC_URI is saved, and LSC_URI_PRIMARY is saved or the user said "Bitcoin only".
19
19
 
20
- These directions describe OpenReceive 0.4.32.
20
+ These directions describe OpenReceive 0.4.33.
21
21
 
22
22
  Add OpenReceive to this Bolt app: a Vite React app on Bolt Cloud, with Bolt
23
23
  Database or a connected Supabase project as its database, and Supabase Edge
@@ -123,8 +123,8 @@ explicitly declined.
123
123
 
124
124
  ## Step 1 — the packages
125
125
 
126
- Add `@openreceive/react` at 0.4.32 or newer to the app's
127
- `package.json`. The function imports `npm:@openreceive/http@^0.4.32`
126
+ Add `@openreceive/react` at 0.4.33 or newer to the app's
127
+ `package.json`. The function imports `npm:@openreceive/http@^0.4.33`
128
128
  and `npm:@supabase/supabase-js@2` directly; add nothing else. (The recipe
129
129
  below writes `^0.4.27`, the oldest release with the `cors` option; both
130
130
  resolve to the newest 0.4.x.) No `pg`, no
@@ -5,6 +5,7 @@ This is the full file; follow it from Step 0.
5
5
  ```sh
6
6
  # READ THIS FIRST: this file is 16 KB and a summary drops required steps. Download it whole:
7
7
  curl -fsSL https://openreceive.org/agent-directions/btcpay/full.md
8
+ # 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/btcpay/full.md
8
9
  # Skip the download only if you already have all of it: pasted, read from disk or fetched raw.
9
10
  ```
10
11
 
@@ -17,7 +18,7 @@ curl -fsSL https://openreceive.org/agent-directions/btcpay/full.md
17
18
  - Never tick the spend-capable override to make a save succeed.
18
19
  - Do not suggest rotating or revoking a code because it was pasted here.
19
20
 
20
- These directions describe OpenReceive 0.4.32.
21
+ These directions describe OpenReceive 0.4.33.
21
22
 
22
23
  Connect a BTCPay Server store to a receive-only NWC wallet with the OpenReceive
23
24
  plugin, and optionally let payers pay BTCPay invoices with USDT, USDC, ETH or
@@ -5,6 +5,7 @@ This is the full file; follow it from Step 0.
5
5
  ```sh
6
6
  # READ THIS FIRST: this file is 49 KB and a summary drops required steps. Download it whole:
7
7
  curl -fsSL https://openreceive.org/agent-directions/django/full.md
8
+ # 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/django/full.md
8
9
  # Skip the download only if you already have all of it: pasted, read from disk or fetched raw.
9
10
  ```
10
11
 
@@ -17,7 +18,7 @@ curl -fsSL https://openreceive.org/agent-directions/django/full.md
17
18
  - Do not suggest rotating or revoking a code because it was pasted here.
18
19
  - Start the quickstart only once the NWC code is saved, and the LSC code is saved or the user said "Bitcoin only".
19
20
 
20
- These directions describe OpenReceive 0.4.32.
21
+ These directions describe OpenReceive 0.4.33.
21
22
 
22
23
  Add OpenReceive to a Django project — the app you are already working in. You
23
24
  do not need a copy of the OpenReceive source: the Python package is on PyPI
@@ -205,6 +206,10 @@ itself, and they hold for every integration.
205
206
  - Work only in this application. Never read or run anything from another
206
207
  project on this machine (its `node_modules`, tools or source), for any
207
208
  reason. A browser and Playwright are not part of setup.
209
+ - The project's own rules (its `AGENTS.md`, contributing guide) win over these
210
+ directions. If one forbids a step here, such as running migrations, ask the
211
+ owner and wait for the answer, even if doctor cannot pass yet. Do not move
212
+ the step somewhere the rule does not name, such as app startup.
208
213
  - Restart only this app's server, on the port it already uses: stop the
209
214
  process you started, or the one listening on that port, by its pid (or
210
215
  restart its Compose service). Never `pkill` or `killall` by name: that
@@ -269,7 +274,9 @@ itself, and they hold for every integration.
269
274
  the price from `amount_for` and both drop-ins render it above the
270
275
  amount. Without it the checkout is a QR and "$1.00" with no sign of what the
271
276
  dollar is for.
272
- - Show the payer the transaction record: `createTransactionDetails(...)` rows,
277
+ - Show the payer the transaction record: `createTransactionDetails(...)` rows
278
+ (with no bundler use `renderTransactionDetailsHtml`: the standalone file has
279
+ no `createTransactionDetails`, and one bad import stops the whole page),
273
280
  collapsed behind a caret, on the live checkout AND on the receipt. A payment
274
281
  hash and a deposit txid are the only evidence a payer has that they paid you.
275
282
  `<openreceive-checkout>` / React's `<Checkout>` already render this panel and
@@ -400,7 +407,9 @@ built on `@openreceive/browser/headless`. Read that before writing components.
400
407
  are on `@openreceive/browser`, not `/headless`.
401
408
  - A refund replaces the deposit panel. On `refund_required` also drop
402
409
  "switch payment method".
403
- - No "Open wallet" button on desktop.
410
+ - No "Open wallet" or "Pay in wallet" button, and no `lightning:` link. Cash
411
+ App cancels an invoice opened from a link and pays the same invoice scanned
412
+ or pasted. Show the QR code and a Copy invoice button.
404
413
  - Wallet suggestions: `getPaymentWizardRoutes()` +
405
414
  `createWizardRouteDisplays`. Lightning only. Logos are data URIs; tutorial
406
415
  images load from a JavaScript chunk. For a custom headless UI, load it when
@@ -479,7 +488,7 @@ pip install "openreceive[django]"
479
488
  That is the whole install. `openreceive[django]` brings Django. The base
480
489
  package brings the wallet client (websockets, coincurve, cryptography), the
481
490
  HTTP engine and the `openreceive` CLI. Use `uv` or a virtualenv on Python 3.10
482
- or newer. A system Python 3.9 cannot install it. If your app brings its own NWC
491
+ to 3.13. A system Python 3.9 cannot install it, and 3.14 cannot yet, because `coincurve` has no build for it. If your app brings its own NWC
483
492
  client, set `OPENRECEIVE["SERVICE"]` instead (see below).
484
493
 
485
494
  Then add the app, point it at a host class, and mount the routes:
@@ -5,6 +5,7 @@ This is the full file; follow it from Step 0.
5
5
  ```sh
6
6
  # READ THIS FIRST: this file is 21 KB and a summary drops required steps. Download it whole:
7
7
  curl -fsSL https://openreceive.org/agent-directions/edd/full.md
8
+ # 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/edd/full.md
8
9
  # Skip the download only if you already have all of it: pasted, read from disk or fetched raw.
9
10
  ```
10
11
 
@@ -17,7 +18,7 @@ curl -fsSL https://openreceive.org/agent-directions/edd/full.md
17
18
  - Do not suggest rotating or revoking a code because it was pasted here.
18
19
  - Setup is done only when the NWC code is saved, and the LSC code is saved or the user said "Bitcoin only".
19
20
 
20
- These directions describe OpenReceive 0.4.32.
21
+ These directions describe OpenReceive 0.4.33.
21
22
 
22
23
  Install and configure the OpenReceive payment gateway in the Easy Digital
23
24
  Downloads (EDD) store you are working in. Preserve its theme, checkout,
@@ -42,7 +43,8 @@ the user through the quickstart's admin screens instead.
42
43
  ## Step 0 — ask for the two codes, one question at a time
43
44
 
44
45
  Before anything else, check one thing: whether OpenReceive is already
45
- installed (`wp plugin is-active openreceive`). If it is, run
46
+ installed (`wp plugin is-active openreceive && echo active || echo "not active"`;
47
+ the bare command answers only with its exit code). If it is, run
46
48
  `wp openreceive doctor`. It prints `NWC_URI: set` or `unset` (likewise
47
49
  `LSC_URI_PRIMARY`), never the values. A code that is already set is not asked
48
50
  for again; if both are set, skip to `wp openreceive configure --enable` at
@@ -96,7 +98,7 @@ is saved or the user said "Bitcoin only". Never invent a placeholder code.
96
98
  Install this release from the WordPress.org plugin directory:
97
99
 
98
100
  ```sh
99
- wp plugin install openreceive --version=0.4.32 --activate
101
+ wp plugin install openreceive --version=0.4.33 --activate
100
102
  ```
101
103
 
102
104
  If that fails because WordPress.org does not have this version yet, install
@@ -104,7 +106,7 @@ the ZIP attached to the same GitHub release. Never install the GitHub
104
106
  source-code ZIP or a ZIP from an older release:
105
107
 
106
108
  ```sh
107
- wp plugin install https://github.com/OpenReceive/openreceive/releases/download/v0.4.32/openreceive-wordpress-0.4.32.zip --activate
109
+ wp plugin install https://github.com/OpenReceive/openreceive/releases/download/v0.4.33/openreceive-wordpress-0.4.33.zip --activate
108
110
  ```
109
111
 
110
112
  It needs Easy Digital Downloads active, and PHP 8.2+ with GMP and sodium in
@@ -145,15 +147,14 @@ Create a pending test order for the first published download, billed to the
145
147
  first administrator, and mint its Lightning invoice from the terminal:
146
148
 
147
149
  ```sh
148
- wp openreceive test-invoice --new
150
+ wp openreceive test-invoice --new --amount=20.00
149
151
  ```
150
152
 
151
153
  To use an order that already exists, pass `edd-<order id>` instead of
152
154
  `--new`. `test-invoice` goes through the same checkout route as the purchase
153
155
  confirmation page. It prints the amount in sats, the BOLT11 invoice, the
154
156
  receipt page and the methods that page offers, each swap asset marked
155
- available or followed by the reason it is not. That reason is the answer;
156
- report it. "Below the provider minimum" or "above the provider maximum" is
157
+ available or followed by the reason it is not. That reason is for you, not the user: it says whether anything is wrong, and the last message names no minimum. "Below the provider minimum" or "above the provider maximum" is
157
158
  about this order's amount, not a fault: a small test order is often under a
158
159
  swap minimum. Only when the reason says the provider is unreachable does
159
160
  doctor's "Swap provider" line have more detail. `test-invoice` and `doctor`
@@ -179,8 +180,9 @@ a provider minimum depends on the order total, and the user's own orders will
179
180
  differ. Do not list what you changed or what doctor checked. Send nothing
180
181
  after it. Do not install mail software, add containers or services, or set up
181
182
  cron. If doctor's "Reconcile scheduled" check fails, fix that. On a store with
182
- little traffic, add one sentence to that message: a system cron for WordPress
183
- scheduled work settles orders sooner, and this setup does not add one. State
183
+ little traffic, add one sentence to that message: WordPress runs its every-minute payment check only when someone visits the
184
+ store, so on a quiet store the user's host should call wp-cron.php every
185
+ minute (a system cron); this setup did not add one. State
184
186
  it as a recommendation. Do not offer to set it up or end the message on a
185
187
  question.
186
188
 
@@ -257,7 +259,7 @@ activate it. With WP-CLI, run `wp plugin install openreceive --activate`.
257
259
 
258
260
  Each GitHub release also attaches the plugin as a ZIP, for a site that cannot
259
261
  reach WordPress.org:
260
- [openreceive-wordpress-0.4.32.zip](https://github.com/OpenReceive/openreceive/releases/download/v0.4.32/openreceive-wordpress-0.4.32.zip).
262
+ [openreceive-wordpress-0.4.33.zip](https://github.com/OpenReceive/openreceive/releases/download/v0.4.33/openreceive-wordpress-0.4.33.zip).
261
263
  Install it through **Plugins → Add New → Upload Plugin**. The GitHub
262
264
  source-code ZIP is not an installable plugin.
263
265
 
@@ -3,8 +3,9 @@ This is the full file; follow it from Step 0.
3
3
  # OpenReceive agent directions (FastAPI)
4
4
 
5
5
  ```sh
6
- # READ THIS FIRST: this file is 43 KB and a summary drops required steps. Download it whole:
6
+ # READ THIS FIRST: this file is 45 KB and a summary drops required steps. Download it whole:
7
7
  curl -fsSL https://openreceive.org/agent-directions/fastapi/full.md
8
+ # 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/fastapi/full.md
8
9
  # Skip the download only if you already have all of it: pasted, read from disk or fetched raw.
9
10
  ```
10
11
 
@@ -17,7 +18,7 @@ curl -fsSL https://openreceive.org/agent-directions/fastapi/full.md
17
18
  - Do not suggest rotating or revoking a code because it was pasted here.
18
19
  - Start the quickstart only once the NWC code is saved, and the LSC code is saved or the user said "Bitcoin only".
19
20
 
20
- These directions describe OpenReceive 0.4.32.
21
+ These directions describe OpenReceive 0.4.33.
21
22
 
22
23
  Add OpenReceive to a FastAPI application — the app you are already working in.
23
24
  You do not need a copy of the OpenReceive source: the engine is on PyPI
@@ -125,15 +126,15 @@ you store it. Ask one question per message.
125
126
  5. **Make the server load the file — yourself.** OpenReceive reads
126
127
  `os.environ`, and a `.env` file on disk is not in it. Start the dev server
127
128
  with `uvicorn --env-file .env` (update the app's run script or Procfile, not
128
- just your own command). When it is started with Docker Compose, give the
129
- service `env_file: .env`. Restart the server after writing the file.
129
+ just your own command). Under Docker Compose, give the service
130
+ `env_file: .env` instead, with no `--env-file` in its command: the image
131
+ has no `.env`. Restart the server after writing the file.
130
132
  Under Compose, recreate the container with `docker compose up -d`:
131
133
  `docker compose restart` keeps its old environment.
132
- Doctor needs the file too: run it as
133
- `dotenv -f .env run -- openreceive doctor …`. The `dotenv` command comes
134
- with python-dotenv, which `uvicorn --env-file` already needs; if it is
135
- missing, `pip install "python-dotenv[cli]"`. Never `source`, `export` or
136
- `cat` the file: the codes contain `&`, and the shell prints the pieces.
134
+ Doctor reads `.env` from its working directory by itself. Under Compose,
135
+ run it in the service (`docker compose exec`), which already has the codes:
136
+ never copy `.env` into a container. Never `source`, `export` or `cat` the
137
+ file: the codes contain `&`, and the shell prints the pieces.
137
138
 
138
139
  Do not invent placeholder URIs. Start the quickstart only once `NWC_URI` is
139
140
  saved and `LSC_URI_PRIMARY` is saved or explicitly declined. The first boot
@@ -142,7 +143,7 @@ runs the receive-only preflight: if it reports spend methods such as
142
143
  again. Never set the spend-capable override to get past it.
143
144
 
144
145
  After the router is wired, run
145
- `dotenv -f .env run -- openreceive doctor --app <module>:app`. It reports
146
+ `openreceive doctor --app <module>:app`. It reports
146
147
  `NWC_URI` presence without printing it, probes the wallet, and names
147
148
  any hook still on a placeholder and whether the migration ran. Exit code 1 is a
148
149
  finding to fix, not a reason to skip the check.
@@ -161,8 +162,7 @@ Only then start the quickstart.
161
162
  ## After the quickstart — hand over, then stop
162
163
 
163
164
  The quickstart is done when
164
- `dotenv -f .env run -- openreceive doctor --app <module>:app --url <app url>`
165
- is clean and this app
165
+ `openreceive doctor --app <module>:app --url <app url>` is clean and this app
166
166
  serves the checkout page for one of its orders. Doctor names any failed check
167
167
  and exits nonzero; fix it before going on.
168
168
 
@@ -205,6 +205,10 @@ itself, and they hold for every integration.
205
205
  - Work only in this application. Never read or run anything from another
206
206
  project on this machine (its `node_modules`, tools or source), for any
207
207
  reason. A browser and Playwright are not part of setup.
208
+ - The project's own rules (its `AGENTS.md`, contributing guide) win over these
209
+ directions. If one forbids a step here, such as running migrations, ask the
210
+ owner and wait for the answer, even if doctor cannot pass yet. Do not move
211
+ the step somewhere the rule does not name, such as app startup.
208
212
  - Restart only this app's server, on the port it already uses: stop the
209
213
  process you started, or the one listening on that port, by its pid (or
210
214
  restart its Compose service). Never `pkill` or `killall` by name: that
@@ -262,7 +266,9 @@ itself, and they hold for every integration.
262
266
  the price from `amount_for` and both drop-ins render it above the amount.
263
267
  Without it the checkout is a QR and "$1.00" with no sign of what the dollar
264
268
  is for.
265
- - Show the payer the transaction record: `createTransactionDetails(...)` rows,
269
+ - Show the payer the transaction record: `createTransactionDetails(...)` rows
270
+ (with no bundler use `renderTransactionDetailsHtml`: the standalone file has
271
+ no `createTransactionDetails`, and one bad import stops the whole page),
266
272
  collapsed behind a caret, on the live checkout AND on the receipt. A payment
267
273
  hash and a deposit txid are the only evidence a payer has that they paid you.
268
274
  `<Checkout>` / `<openreceive-checkout>` already render this panel and the
@@ -405,7 +411,9 @@ components.
405
411
  are on `@openreceive/browser`, not `/headless`.
406
412
  - A refund replaces the deposit panel. On `refund_required` also drop
407
413
  "switch payment method".
408
- - No "Open wallet" button on desktop.
414
+ - No "Open wallet" or "Pay in wallet" button, and no `lightning:` link. Cash
415
+ App cancels an invoice opened from a link and pays the same invoice scanned
416
+ or pasted. Show the QR code and a Copy invoice button.
409
417
  - Wallet suggestions: `getPaymentWizardRoutes()` +
410
418
  `createWizardRouteDisplays`. Lightning only. Logos are data URIs; tutorial
411
419
  images load from a JavaScript chunk. For a custom headless UI, load it when
@@ -493,8 +501,8 @@ with the Django quickstart. A page without a bundler uses
493
501
  | Server | `openreceive[fastapi]`, `openreceive[django]`, `openreceive[sqlalchemy]` (Flask and plain WSGI/ASGI: [the Flask quickstart](https://openreceive.org/guides/quickstart-flask.md)) |
494
502
  | Frontend | `@openreceive/react`, `@openreceive/vue`, `@openreceive/svelte`, `@openreceive/angular`, `@openreceive/elements` (plain HTML) |
495
503
 
496
- Use `uv` or a virtualenv on Python 3.10 or newer. A system Python 3.9 cannot
497
- install the package.
504
+ Use `uv` or a virtualenv on Python 3.10 to 3.13. A system Python 3.9 cannot
505
+ install the package, and 3.14 cannot yet, because `coincurve` has no build for it.
498
506
 
499
507
  ### 2. Migrate the payment tables
500
508
 
@@ -628,11 +636,14 @@ old browser, is not refused. So `authorize` stays the actual boundary.
628
636
  [Security](https://openreceive.org/guides/security.md) has the full account.
629
637
 
630
638
  `openreceive_lifespan` runs the receive-only wallet preflight when uvicorn
631
- starts. It stops the process if the code is missing, unreachable, or able to
632
- spend. That way the deploy fails instead of the first payer. Pass `lazy=True`
633
- for tests and for build steps that have no secrets. The first request then
634
- checks the wallet, and requests get `503 WALLET_UNAVAILABLE` until the check
635
- passes.
639
+ starts. It stops the process if the code is missing or able to spend. That way
640
+ the deploy fails instead of the first payer. A relay that does not answer at
641
+ start does not stop it: the app starts, logs one line, and checkouts get a
642
+ retryable `503 WALLET_UNAVAILABLE` until the wallet answers. The first
643
+ checkout after a short wait (1 s, doubling to 60 s) checks again, so payments
644
+ come back without a restart. Pass `lazy=True` for tests and for build steps
645
+ that have no secrets. The first request then checks the wallet, and requests
646
+ get `503 WALLET_UNAVAILABLE` until the check passes.
636
647
  → [openreceive_router](https://openreceive.org/guides/api-reference.md#openreceive_router) ·
637
648
  [openreceive_lifespan](https://openreceive.org/guides/api-reference.md#openreceive_lifespan) ·
638
649
  [the authorize context](https://openreceive.org/guides/api-reference.md#host-python)
@@ -716,7 +727,9 @@ A page without a bundler renders the same checkout as a custom element:
716
727
  its standalone build from your static directory: copy
717
728
  `openreceive-checkout.js` and `openreceive-checkout.css` from
718
729
  `node_modules/@openreceive/elements/dist/standalone/` to `static/openreceive/`,
719
- and load both on the checkout page. The `openreceive` package from PyPI carries
730
+ and load both on the checkout page: the JS with `<script type="module">`, because
731
+ it is an ES module and a plain `<script>` tag runs nothing, and the CSS with
732
+ `<link rel="stylesheet">`. The `openreceive` package from PyPI carries
720
733
  the same two files in `openreceive/django/static/openreceive/`, so you can copy
721
734
  them from there without npm.
722
735
 
@@ -730,13 +743,13 @@ shape onto the models in THIS app.
730
743
  ### 6. Verify
731
744
 
732
745
  ```sh
733
- dotenv -f .env run -- openreceive doctor --app main:app
746
+ openreceive doctor --app main:app
734
747
  ```
735
748
 
736
- Doctor reads the process environment. `dotenv -f .env run --` loads `.env`
737
- into it, as `uvicorn --env-file .env` does for the server. The `dotenv`
738
- command comes with python-dotenv, which `uvicorn --env-file` needs anyway; if
739
- it is missing, run `pip install "python-dotenv[cli]"`. Never `source` or
749
+ Doctor reads `.env` from the working directory for the variables the
750
+ environment does not set, as `uvicorn --env-file .env` does. Under Docker
751
+ Compose, run it inside the service, which has the variables from `env_file`:
752
+ `docker compose exec web openreceive doctor …`. Never `source` or
740
753
  `export` `.env` in a shell: the codes contain `&`, and the shell splits the
741
754
  line and prints the pieces.
742
755
 
@@ -3,8 +3,9 @@ This is the full file; follow it from Step 0.
3
3
  # OpenReceive agent directions (Fastify)
4
4
 
5
5
  ```sh
6
- # READ THIS FIRST: this file is 42 KB and a summary drops required steps. Download it whole:
6
+ # READ THIS FIRST: this file is 43 KB and a summary drops required steps. Download it whole:
7
7
  curl -fsSL https://openreceive.org/agent-directions/fastify/full.md
8
+ # 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/fastify/full.md
8
9
  # Skip the download only if you already have all of it: pasted, read from disk or fetched raw.
9
10
  ```
10
11
 
@@ -17,7 +18,7 @@ curl -fsSL https://openreceive.org/agent-directions/fastify/full.md
17
18
  - Do not suggest rotating or revoking a code because it was pasted here.
18
19
  - Start the quickstart only once the NWC code is saved, and the LSC code is saved or the user said "Bitcoin only".
19
20
 
20
- These directions describe OpenReceive 0.4.32.
21
+ These directions describe OpenReceive 0.4.33.
21
22
 
22
23
  Add OpenReceive to a Fastify application — the app you are already working in.
23
24
  You do not need a copy of the OpenReceive source: the packages are on npm, and
@@ -193,6 +194,10 @@ itself, and they hold for every integration.
193
194
  - Work only in this application. Never read or run anything from another
194
195
  project on this machine (its `node_modules`, tools or source), for any
195
196
  reason. A browser and Playwright are not part of setup.
197
+ - The project's own rules (its `AGENTS.md`, contributing guide) win over these
198
+ directions. If one forbids a step here, such as running migrations, ask the
199
+ owner and wait for the answer, even if doctor cannot pass yet. Do not move
200
+ the step somewhere the rule does not name, such as app startup.
196
201
  - Restart only this app's server, on the port it already uses: stop the
197
202
  process you started, or the one listening on that port, by its pid (or
198
203
  restart its Compose service). Never `pkill` or `killall` by name: that
@@ -235,21 +240,25 @@ itself, and they hold for every integration.
235
240
  (`POST /swaps`) re-serves the committed attempt — but only while it is live,
236
241
  and the shadow invoice behind a swap lasts about half an hour, after which the
237
242
  same click mints a NEW deposit address and the refund is off-screen. Keep the
238
- `payment_hash` and reopen the attempt with `POST /swaps/status`, which has no
239
- such window. On the drop-ins: `resumePaymentHash`, fed from `onState`, on
240
- `<Checkout>`; the `resume-payment-hash` attribute, fed from the
243
+ `payment_hash` on your order row, not in browser storage, and reopen the
244
+ attempt with `POST /swaps/status`, which has no such window. On the
245
+ drop-ins: `resumePaymentHash`, fed from `onState`, on `<Checkout>`; the
246
+ `resume-payment-hash` attribute, fed from the
241
247
  `openreceive-state` event (`event.detail.state.payment_hash`), on
242
248
  `<openreceive-checkout>`.
243
249
  That visit can come hours later, and `authorize` must still know the payer:
244
250
  a session that expired in between answers 403 and strands the deposit. On a
245
- guest shop, tie the order to a long-lived signed cookie, or put a secret
246
- per-order token in its URL that your page trades for that cookie.
251
+ guest shop, tie the order to a long-lived cookie signed with the app's own
252
+ secret (such as `SESSION_SECRET`, never a wallet or swap code), or put a
253
+ secret per-order token in its URL that your page trades for that cookie.
247
254
  https://openreceive.org/guides/swap-refunds.md
248
255
  - Show the payer WHAT THEY ARE BUYING. Return an optional `description` beside
249
256
  the price from `amountFor` and both drop-ins render it above the amount.
250
257
  Without it the checkout is a QR and "$1.00" with no sign of what the dollar
251
258
  is for.
252
- - Show the payer the transaction record: `createTransactionDetails(...)` rows,
259
+ - Show the payer the transaction record: `createTransactionDetails(...)` rows
260
+ (with no bundler use `renderTransactionDetailsHtml`: the standalone file has
261
+ no `createTransactionDetails`, and one bad import stops the whole page),
253
262
  collapsed behind a caret, on the live checkout AND on the receipt. A payment
254
263
  hash and a deposit txid are the only evidence a payer has that they paid you.
255
264
  `<Checkout>` / `<openreceive-checkout>` already render this panel and the
@@ -390,7 +399,9 @@ components.
390
399
  are on `@openreceive/browser`, not `/headless`.
391
400
  - A refund replaces the deposit panel. On `refund_required` also drop
392
401
  "switch payment method".
393
- - No "Open wallet" button on desktop.
402
+ - No "Open wallet" or "Pay in wallet" button, and no `lightning:` link. Cash
403
+ App cancels an invoice opened from a link and pays the same invoice scanned
404
+ or pasted. Show the QR code and a Copy invoice button.
394
405
  - Wallet suggestions: `getPaymentWizardRoutes()` +
395
406
  `createWizardRouteDisplays`. Lightning only. Logos are data URIs; tutorial
396
407
  images load from a JavaScript chunk. For a custom headless UI, load it when
@@ -575,7 +586,9 @@ await app.register(openReceiveFastify, {
575
586
  // yours (admin action, replayed job) updates zero rows and does nothing.
576
587
  // Use `query` here, not your ORM's other connection. `?` on sqlite and
577
588
  // mysql, `$1` on postgres. MySQL has no RETURNING: after the UPDATE,
578
- // `SELECT ROW_COUNT() AS claimed` tells you the same thing.
589
+ // `SELECT ROW_COUNT() AS claimed` tells you the same thing. `paidAt` is
590
+ // Unix seconds: for a timestamp column write `to_timestamp($1)` on
591
+ // postgres or `FROM_UNIXTIME(?)` on mysql in place of its placeholder.
579
592
  const claimed = await query(
580
593
  "UPDATE orders SET state = 'paid', paid_at = ? WHERE id = ? AND state = 'awaiting_payment' RETURNING id",
581
594
  [paidAt, reference],