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
@@ -3,8 +3,9 @@ This is the full file; follow it from Step 0.
3
3
  # OpenReceive agent directions (Nuxt)
4
4
 
5
5
  ```sh
6
- # READ THIS FIRST: this file is 35 KB and a summary drops required steps. Download it whole:
6
+ # READ THIS FIRST: this file is 36 KB and a summary drops required steps. Download it whole:
7
7
  curl -fsSL https://openreceive.org/agent-directions/nuxt/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/nuxt/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/nuxt/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 Nuxt application — the app you are already working in,
23
24
  on Nitro's `node-server` preset. OpenReceive ships no Nuxt package: the
@@ -198,11 +199,16 @@ itself, and they hold for every integration.
198
199
  and not a Prisma/Drizzle relation to `openreceive_payments`.
199
200
  - Keep `NWC_URI` / `LSC_URI_*` server-only. Never put them in browser code,
200
201
  logs, or assets.
202
+ - After a production build, run `npx openreceive doctor --scan-build .output/public`. Never grep a build for a code.
201
203
  - Do not suggest rotating, revoking or replacing a code because it was pasted
202
204
  into this chat; that is the supported path.
203
205
  - Work only in this application. Never read or run anything from another
204
206
  project on this machine (its `node_modules`, tools or source), for any
205
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.
206
212
  - Restart only this app's server, on the port it already uses: stop the
207
213
  process you started, or the one listening on that port, by its pid (or
208
214
  restart its Compose service). Never `pkill` or `killall` by name: that
@@ -245,21 +251,25 @@ itself, and they hold for every integration.
245
251
  (`POST /swaps`) re-serves the committed attempt — but only while it is live,
246
252
  and the shadow invoice behind a swap lasts about half an hour, after which the
247
253
  same click mints a NEW deposit address and the refund is off-screen. Keep the
248
- `payment_hash` and reopen the attempt with `POST /swaps/status`, which has no
249
- such window. On the drop-ins: `resumePaymentHash`, fed from `onState`, on
250
- `<Checkout>`; the `resume-payment-hash` attribute, fed from the
254
+ `payment_hash` on your order row, not in browser storage, and reopen the
255
+ attempt with `POST /swaps/status`, which has no such window. On the
256
+ drop-ins: `resumePaymentHash`, fed from `onState`, on `<Checkout>`; the
257
+ `resume-payment-hash` attribute, fed from the
251
258
  `openreceive-state` event (`event.detail.state.payment_hash`), on
252
259
  `<openreceive-checkout>`.
253
260
  That visit can come hours later, and `authorize` must still know the payer:
254
261
  a session that expired in between answers 403 and strands the deposit. On a
255
- guest shop, tie the order to a long-lived signed cookie, or put a secret
256
- per-order token in its URL that your page trades for that cookie.
262
+ guest shop, tie the order to a long-lived cookie signed with the app's own
263
+ secret (such as `SESSION_SECRET`, never a wallet or swap code), or put a
264
+ secret per-order token in its URL that your page trades for that cookie.
257
265
  https://openreceive.org/guides/swap-refunds.md
258
266
  - Show the payer WHAT THEY ARE BUYING. Return an optional `description` beside
259
267
  the price from `amountFor` and both drop-ins render it above the amount.
260
268
  Without it the checkout is a QR and "$1.00" with no sign of what the dollar
261
269
  is for.
262
- - Show the payer the transaction record: `createTransactionDetails(...)` rows,
270
+ - Show the payer the transaction record: `createTransactionDetails(...)` rows
271
+ (with no bundler use `renderTransactionDetailsHtml`: the standalone file has
272
+ no `createTransactionDetails`, and one bad import stops the whole page),
263
273
  collapsed behind a caret, on the live checkout AND on the receipt. A payment
264
274
  hash and a deposit txid are the only evidence a payer has that they paid you.
265
275
  `<Checkout>` / `<openreceive-checkout>` already render this panel and the
@@ -379,7 +389,9 @@ components.
379
389
  are on `@openreceive/browser`, not `/headless`.
380
390
  - A refund replaces the deposit panel. On `refund_required` also drop
381
391
  "switch payment method".
382
- - No "Open wallet" button on desktop.
392
+ - No "Open wallet" or "Pay in wallet" button, and no `lightning:` link. Cash
393
+ App cancels an invoice opened from a link and pays the same invoice scanned
394
+ or pasted. Show the QR code and a Copy invoice button.
383
395
  - Wallet suggestions: `getPaymentWizardRoutes()` +
384
396
  `createWizardRouteDisplays`. Lightning only. Logos are data URIs; tutorial
385
397
  images load from a JavaScript chunk. For a custom headless UI, load it when
@@ -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 23 KB and a summary drops required steps. Download it whole:
7
7
  curl -fsSL https://openreceive.org/agent-directions/odoo/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/odoo/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/odoo/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 provider in the Odoo you are
23
24
  working in. Preserve its website, customers, products, orders, invoices and
@@ -102,7 +103,7 @@ manager, so build an image that adds it:
102
103
  FROM odoo:<tag>
103
104
  USER root
104
105
  RUN pip3 install --no-cache-dir --break-system-packages --ignore-installed typing_extensions h11 \
105
- && pip3 install --no-cache-dir --break-system-packages openreceive==0.4.32
106
+ && pip3 install --no-cache-dir --break-system-packages openreceive==0.4.33
106
107
  USER odoo
107
108
  ```
108
109
 
@@ -113,9 +114,9 @@ manager, so build an image that adds it:
113
114
  (the folder that holds the Dockerfile). Change nothing else in the file.
114
115
  3. Run `docker compose up -d --build`.
115
116
 
116
- On a server, install `openreceive==0.4.32` with the pip of the Python
117
+ On a server, install `openreceive==0.4.33` with the pip of the Python
117
118
  that runs Odoo (its virtualenv when it has one). On Odoo.sh, add
118
- `openreceive==0.4.32` to the repository's `requirements.txt`. If you
119
+ `openreceive==0.4.33` to the repository's `requirements.txt`. If you
119
120
  cannot tell which Python runs Odoo, say so and stop.
120
121
 
121
122
  The module is the ZIP attached to this GitHub release, with its folder,
@@ -126,8 +127,8 @@ folder on the config file's `addons_path`. Never install the GitHub
126
127
  source-code ZIP or a ZIP from an older release.
127
128
 
128
129
  ```sh
129
- curl -fsSLO https://github.com/OpenReceive/openreceive/releases/download/v0.4.32/openreceive-odoo-0.4.32.zip
130
- unzip -oq openreceive-odoo-0.4.32.zip -d <that folder> && rm openreceive-odoo-0.4.32.zip
130
+ curl -fsSLO https://github.com/OpenReceive/openreceive/releases/download/v0.4.33/openreceive-odoo-0.4.33.zip
131
+ unzip -oq openreceive-odoo-0.4.33.zip -d <that folder> && rm openreceive-odoo-0.4.33.zip
131
132
  ```
132
133
 
133
134
  Then install it into the database and restart Odoo:
@@ -184,7 +185,7 @@ To use a transaction that already exists, pass `--reference <its reference>`
184
185
  instead of `--new`. `test-invoice` goes through the same route as the
185
186
  checkout page. It prints the amount in sats, the BOLT11 invoice and the
186
187
  methods the checkout offers, each swap asset marked available or followed by
187
- the reason it is not. That reason is the answer; report it. A reason about the
188
+ 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. A reason about the
188
189
  provider's minimum or maximum is about this amount, not a fault. `test-invoice`
189
190
  and `doctor` are the whole check.
190
191
 
@@ -281,16 +282,16 @@ from a terminal:
281
282
 
282
283
  ```sh
283
284
  cd /path/to/your/addons
284
- curl -fsSLO https://github.com/OpenReceive/openreceive/releases/download/v0.4.32/openreceive-odoo-0.4.32.zip
285
- unzip -oq openreceive-odoo-0.4.32.zip && rm openreceive-odoo-0.4.32.zip
285
+ curl -fsSLO https://github.com/OpenReceive/openreceive/releases/download/v0.4.33/openreceive-odoo-0.4.33.zip
286
+ unzip -oq openreceive-odoo-0.4.33.zip && rm openreceive-odoo-0.4.33.zip
286
287
  odoo -d <database> -i payment_openreceive --stop-after-init
287
288
  ```
288
289
 
289
290
  How the Python package gets in depends on how Odoo runs:
290
291
 
291
292
  - **Odoo.sh**: commit the `payment_openreceive` folder to your repository and
292
- add `openreceive==0.4.32` to the repository's `requirements.txt`.
293
- - **A source install with a virtualenv**: `pip install openreceive==0.4.32`
293
+ add `openreceive==0.4.33` to the repository's `requirements.txt`.
294
+ - **A source install with a virtualenv**: `pip install openreceive==0.4.33`
294
295
  in Odoo's virtualenv.
295
296
  - **Odoo's Docker image** or **its Debian package**: see below.
296
297
 
@@ -310,7 +311,7 @@ manager. Build your own image on top of it: put this `Dockerfile` next to your
310
311
  FROM odoo:19.0
311
312
  USER root
312
313
  RUN pip3 install --no-cache-dir --break-system-packages --ignore-installed typing_extensions h11 \
313
- && pip3 install --no-cache-dir --break-system-packages openreceive==0.4.32
314
+ && pip3 install --no-cache-dir --break-system-packages openreceive==0.4.33
314
315
  USER odoo
315
316
  ```
316
317
 
@@ -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 19 KB and a summary drops required steps. Download it whole:
7
7
  curl -fsSL https://openreceive.org/agent-directions/paymenter/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/paymenter/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/paymenter/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 Paymenter billing
23
24
  panel you are working in. Preserve its theme, clients, products, invoices and
@@ -97,7 +98,7 @@ release. With Paymenter's official Docker image, download and unpack it inside
97
98
  the container, as the web user:
98
99
 
99
100
  ```sh
100
- docker compose exec -T -u nginx paymenter sh -c 'cd /app/extensions/Gateways && curl -fsSLO https://github.com/OpenReceive/openreceive/releases/download/v0.4.32/openreceive-paymenter-0.4.32.zip && unzip -q openreceive-paymenter-0.4.32.zip && rm openreceive-paymenter-0.4.32.zip'
101
+ docker compose exec -T -u nginx paymenter sh -c 'cd /app/extensions/Gateways && curl -fsSLO https://github.com/OpenReceive/openreceive/releases/download/v0.4.33/openreceive-paymenter-0.4.33.zip && unzip -q openreceive-paymenter-0.4.33.zip && rm openreceive-paymenter-0.4.33.zip'
101
102
  docker compose exec -T -u nginx paymenter php artisan app:extension:install gateway OpenReceive
102
103
  ```
103
104
 
@@ -140,14 +141,17 @@ Create a small unpaid test invoice, billed to the first admin account without
140
141
  Paymenter's new-invoice email, and mint its Lightning invoice:
141
142
 
142
143
  ```sh
143
- php artisan openreceive:test-invoice --new
144
+ php artisan openreceive:test-invoice --new --amount 20.00
144
145
  ```
145
146
 
147
+ `--amount 20.00` (in the shop's currency) keeps the test invoice above the swap
148
+ providers' minimums, so the user can try every method on the link you give them.
149
+
146
150
  To use an invoice that already exists, pass its id instead of `--new`.
147
151
  `test-invoice` goes through the same route as the invoice's payment dialog. It
148
152
  prints the amount in sats, the BOLT11 invoice, the invoice page and the
149
153
  methods the dialog offers, each swap asset marked available or followed by
150
- the reason it is not. That reason is the answer; report it. "Below the
154
+ 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
151
155
  provider minimum" or "above the provider maximum" is about this invoice's
152
156
  amount, not a fault. Only when the reason says the provider is unreachable
153
157
  does doctor's "Swap provider" line have more detail. `test-invoice` and
@@ -242,9 +246,9 @@ directory, next to Stripe and PayPal:
242
246
 
243
247
  ```sh
244
248
  cd /var/www/paymenter
245
- curl -fsSLO https://github.com/OpenReceive/openreceive/releases/download/v0.4.32/openreceive-paymenter-0.4.32.zip
246
- unzip -q openreceive-paymenter-0.4.32.zip -d extensions/Gateways
247
- rm openreceive-paymenter-0.4.32.zip
249
+ curl -fsSLO https://github.com/OpenReceive/openreceive/releases/download/v0.4.33/openreceive-paymenter-0.4.33.zip
250
+ unzip -q openreceive-paymenter-0.4.33.zip -d extensions/Gateways
251
+ rm openreceive-paymenter-0.4.33.zip
248
252
  chown -R www-data:www-data extensions/Gateways/OpenReceive
249
253
  sudo -u www-data php artisan app:extension:install gateway OpenReceive
250
254
  ```
@@ -3,8 +3,9 @@ This is the full file; follow it from Step 0.
3
3
  # OpenReceive agent directions (PHP)
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/php/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/php/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/php/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 PHP application — the app you are already working in. You
23
24
  do not need a copy of the OpenReceive source: the engine is on Packagist
@@ -137,8 +138,8 @@ again. Never set the spend-capable override to get past it.
137
138
  Then check the PHP runtime: `php -m` must list `gmp`, `sodium`, `mbstring`,
138
139
  `json`, `pdo` and one PDO driver. `ext-gmp` is REQUIRED — the NWC transport
139
140
  signs every request with it — and `php:*-cli`/`-fpm` images do not ship it:
140
- install `libgmp-dev` first, then `docker-php-ext-install gmp`, in the
141
- Dockerfile. Never pass `--ignore-platform-req=ext-gmp` to Composer. PHP must
141
+ install `libgmp-dev` first (on Alpine, `apk add gmp` plus `$PHPIZE_DEPS
142
+ gmp-dev` for the build), then `docker-php-ext-install gmp`, in the Dockerfile. Never pass `--ignore-platform-req=ext-gmp` to Composer. PHP must
142
143
  be ≥ 8.2 and 64-bit.
143
144
 
144
145
  ### Upgrading an existing install
@@ -202,6 +203,10 @@ itself, and they hold for every integration.
202
203
  - Work only in this application. Never read or run anything from another
203
204
  project on this machine (its `node_modules`, tools or source), for any
204
205
  reason. A browser and Playwright are not part of setup.
206
+ - The project's own rules (its `AGENTS.md`, contributing guide) win over these
207
+ directions. If one forbids a step here, such as running migrations, ask the
208
+ owner and wait for the answer, even if doctor cannot pass yet. Do not move
209
+ the step somewhere the rule does not name, such as app startup.
205
210
  - Restart only this app's server, on the port it already uses: stop the
206
211
  process you started, or the one listening on that port, by its pid (or
207
212
  restart its Compose service). Never `pkill` or `killall` by name: that
@@ -259,7 +264,9 @@ itself, and they hold for every integration.
259
264
  the price from `amountFor` and the drop-in renders it above the amount.
260
265
  Without it the checkout is a QR and "$1.00" with no sign of what the dollar
261
266
  is for.
262
- - Show the payer the transaction record: `createTransactionDetails(...)` rows,
267
+ - Show the payer the transaction record: `createTransactionDetails(...)` rows
268
+ (with no bundler use `renderTransactionDetailsHtml`: the standalone file has
269
+ no `createTransactionDetails`, and one bad import stops the whole page),
263
270
  collapsed behind a caret, on the live checkout AND on the receipt. A payment
264
271
  hash and a deposit txid are the only evidence a payer has that they paid you.
265
272
  `<openreceive-checkout>` already renders this panel and the `description` —
@@ -373,7 +380,9 @@ of https://openreceive.org/guides/checkout-ux.md, for a UI built on
373
380
  are on `@openreceive/browser`, not `/headless`.
374
381
  - A refund replaces the deposit panel. On `refund_required` also drop
375
382
  "switch payment method".
376
- - No "Open wallet" button on desktop.
383
+ - No "Open wallet" or "Pay in wallet" button, and no `lightning:` link. Cash
384
+ App cancels an invoice opened from a link and pays the same invoice scanned
385
+ or pasted. Show the QR code and a Copy invoice button.
377
386
  - Wallet suggestions: `getPaymentWizardRoutes()` +
378
387
  `createWizardRouteDisplays`. Lightning only. Logos are data URIs; tutorial
379
388
  images load from a JavaScript chunk. For a custom headless UI, load it when
@@ -442,7 +451,10 @@ thin adapter over this engine).
442
451
  Requires PHP ≥ 8.2 (64-bit) with `ext-gmp`, `ext-sodium`, `ext-mbstring`,
443
452
  `ext-json`, `ext-pdo` and one PDO driver (`pdo_pgsql`, `pdo_sqlite` or
444
453
  `pdo_mysql`). `ext-gmp` is **required**, not optional. The NWC transport signs
445
- every wallet request with it.
454
+ every wallet request with it. The official `php` Docker images do not ship it.
455
+ On Debian images, install `libgmp-dev` and then run `docker-php-ext-install gmp`.
456
+ On Alpine images, run `apk add gmp` and install `$PHPIZE_DEPS gmp-dev` for the
457
+ build.
446
458
 
447
459
  ### 1. Install
448
460
 
@@ -577,6 +589,8 @@ $host = new class($orders) implements Host {
577
589
  // same commit as the payment record. The WHERE clause is the lock: a second
578
590
  // fulfillment path of yours updates zero rows. Database writes only here;
579
591
  // emails and webhooks go after commit (implement Hosts\AfterPaid for that).
592
+ // `paidAt` is Unix seconds: for a timestamp column write `FROM_UNIXTIME(?)`
593
+ // (MySQL) or `to_timestamp(?)` (Postgres) in place of its placeholder.
580
594
  public function onPaid(PaymentSettlement $settlement): void
581
595
  {
582
596
  $settlement->connection->execute(
@@ -3,8 +3,9 @@ This is the full file; follow it from Step 0.
3
3
  # OpenReceive agent directions (PrestaShop)
4
4
 
5
5
  ```sh
6
- # READ THIS FIRST: this file is 25 KB and a summary drops required steps. Download it whole:
6
+ # READ THIS FIRST: this file is 26 KB and a summary drops required steps. Download it whole:
7
7
  curl -fsSL https://openreceive.org/agent-directions/prestashop/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/prestashop/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/prestashop/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 module in the PrestaShop store
23
24
  you are working in. Preserve its theme, customers, products, orders and
@@ -123,7 +124,7 @@ With the Docker image, download and unpack it inside the container, as the
123
124
  web user, then install the module with PrestaShop's own console:
124
125
 
125
126
  ```sh
126
- docker compose exec -T -u www-data prestashop sh -c 'curl -fsSLO https://github.com/OpenReceive/openreceive/releases/download/v0.4.32/openreceive-prestashop-0.4.32.zip && unzip -oq openreceive-prestashop-0.4.32.zip -d modules && rm openreceive-prestashop-0.4.32.zip'
127
+ docker compose exec -T -u www-data prestashop sh -c 'curl -fsSLO https://github.com/OpenReceive/openreceive/releases/download/v0.4.33/openreceive-prestashop-0.4.33.zip && unzip -oq openreceive-prestashop-0.4.33.zip -d modules && rm openreceive-prestashop-0.4.33.zip'
127
128
  docker compose exec -T -u www-data prestashop php bin/console prestashop:module install openreceive
128
129
  ```
129
130
 
@@ -166,15 +167,18 @@ real customer sees it and no email reaches anyone), and mint its Lightning
166
167
  invoice:
167
168
 
168
169
  ```sh
169
- php bin/console openreceive:test-invoice --new
170
+ php bin/console openreceive:test-invoice --new --amount 20.00
170
171
  ```
171
172
 
173
+ `--amount 20.00` (in the shop's currency) keeps the test order above the swap
174
+ providers' minimums, so the user can try every method on the link you give them.
175
+
172
176
  To use an order that already awaits its OpenReceive payment, pass its id
173
177
  instead of `--new`. `test-invoice` goes through the same route as the order's
174
178
  confirmation page. It prints the amount in sats, the BOLT11 invoice, the
175
179
  order's confirmation page and the methods the checkout offers, each swap asset
176
- marked available or followed by the reason it is not. That reason is the
177
- answer; report it. "Below the provider minimum" or "above the provider
180
+ marked available or followed by the reason it is not. That reason is for you, not the user: it says whether
181
+ anything is wrong, and the last message names no minimum. "Below the provider minimum" or "above the provider
178
182
  maximum" is about this order's amount, not a fault. Only when the reason says
179
183
  the provider is unreachable does doctor's "Swap provider" line have more
180
184
  detail. `test-invoice` and `doctor` are the whole check.
@@ -192,17 +196,20 @@ pay from the order's page with their own wallet; afterwards the order reads
192
196
  Setup ends here. Once doctor is clean and the user has the link, your last
193
197
  message starts "Setup is finished" and has at most six short lines: the
194
198
  order's page, the methods the checkout offers (Bitcoin, plus USDT, USDC, ETH
195
- and SOL when the swap code is saved), the cron line below, and one line of
199
+ and SOL when the swap code is saved), the crontab entry below, and one line of
196
200
  what to look at. Do not list each coin's availability, mention a minimum, or
197
201
  say a coin will not work: a provider minimum depends on the order total, and
198
202
  real orders will differ. Do not list what you changed or what doctor checked.
199
203
  Send nothing after it.
200
204
 
201
205
  PrestaShop has no scheduler, so the module's pass for customers who leave the
202
- page before their payment settles needs one cron line, every five minutes:
203
- `php bin/console openreceive:reconcile` as the web user. Give the user that
204
- line in your last message; do not add it yourself, and do not add containers,
205
- services or workers.
206
+ page before their payment settles needs one crontab entry. Give the user the
207
+ whole entry in your last message, with this shop's real folder, and
208
+ do not add it yourself, or any containers, services or workers. Under Docker,
209
+ for the host's crontab:
210
+ `*/5 * * * * cd /path/to/shop && docker compose exec -T -u www-data prestashop php bin/console openreceive:reconcile`.
211
+ Otherwise, for the web user's crontab:
212
+ `*/5 * * * * php /path/to/prestashop/bin/console openreceive:reconcile`.
206
213
 
207
214
  ## Non-negotiables
208
215
 
@@ -285,9 +292,9 @@ install it with PrestaShop's own console, in the folder that holds `bin/console`
285
292
 
286
293
  ```sh
287
294
  cd /var/www/html
288
- curl -fsSLO https://github.com/OpenReceive/openreceive/releases/download/v0.4.32/openreceive-prestashop-0.4.32.zip
289
- unzip -oq openreceive-prestashop-0.4.32.zip -d modules
290
- rm openreceive-prestashop-0.4.32.zip
295
+ curl -fsSLO https://github.com/OpenReceive/openreceive/releases/download/v0.4.33/openreceive-prestashop-0.4.33.zip
296
+ unzip -oq openreceive-prestashop-0.4.33.zip -d modules
297
+ rm openreceive-prestashop-0.4.33.zip
291
298
  chown -R www-data:www-data modules/openreceive
292
299
  sudo -u www-data php bin/console prestashop:module install openreceive
293
300
  ```
@@ -323,7 +330,7 @@ Run every command inside the container, in `/var/www/html`, as its web user
323
330
  `www-data`. Unpack the release there too:
324
331
 
325
332
  ```sh
326
- docker compose exec -T -u www-data prestashop sh -c 'curl -fsSLO https://github.com/OpenReceive/openreceive/releases/download/v0.4.32/openreceive-prestashop-0.4.32.zip && unzip -oq openreceive-prestashop-0.4.32.zip -d modules && rm openreceive-prestashop-0.4.32.zip'
333
+ docker compose exec -T -u www-data prestashop sh -c 'curl -fsSLO https://github.com/OpenReceive/openreceive/releases/download/v0.4.33/openreceive-prestashop-0.4.33.zip && unzip -oq openreceive-prestashop-0.4.33.zip -d modules && rm openreceive-prestashop-0.4.33.zip'
327
334
  docker compose exec -T -u www-data prestashop php bin/console prestashop:module install openreceive
328
335
  ```
329
336
 
@@ -378,9 +385,12 @@ from cron, as the web server's user:
378
385
 
379
386
  That line goes in `/etc/cron.d/`; in the web user's own crontab, leave out
380
387
  `www-data`. On hosting with a control panel, add a cron job with the same
381
- `php …/bin/console openreceive:reconcile` command. With Docker, the host's cron
382
- runs `docker compose exec -T -u www-data prestashop php bin/console openreceive:reconcile`
383
- from the Compose project's folder.
388
+ `php …/bin/console openreceive:reconcile` command. With Docker, add this to
389
+ the host's crontab, with your Compose project's folder:
390
+
391
+ ```cron
392
+ */5 * * * * cd /path/to/shop && docker compose exec -T -u www-data prestashop php bin/console openreceive:reconcile
393
+ ```
384
394
 
385
395
  Each pass also finishes any order whose payment settled but which did not
386
396
  move to "Payment accepted", and every checkout request runs one pass too.
@@ -3,8 +3,9 @@ This is the full file; follow it from Step 0.
3
3
  # OpenReceive agent directions (Rails)
4
4
 
5
5
  ```sh
6
- # READ THIS FIRST: this file is 44 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/rails/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/rails/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/rails/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 Rails application — the app you are already working in. You
23
24
  do not need a copy of the OpenReceive source: the gem is on RubyGems, the
@@ -192,6 +193,10 @@ itself, and they hold for every integration.
192
193
  - Work only in this application. Never read or run anything from another
193
194
  project on this machine (its `node_modules`, tools or source), for any
194
195
  reason. A browser and Playwright are not part of setup.
196
+ - The project's own rules (its `AGENTS.md`, contributing guide) win over these
197
+ directions. If one forbids a step here, such as running migrations, ask the
198
+ owner and wait for the answer, even if doctor cannot pass yet. Do not move
199
+ the step somewhere the rule does not name, such as app startup.
195
200
  - Restart only this app's server, on the port it already uses: stop the
196
201
  process you started, or the one listening on that port, by its pid (or
197
202
  restart its Compose service). Never `pkill` or `killall` by name: that
@@ -251,7 +256,9 @@ itself, and they hold for every integration.
251
256
  the price from `config.amount_for` and both drop-ins render it above the
252
257
  amount. Without it the checkout is a QR and "$1.00" with no sign of what the
253
258
  dollar is for.
254
- - 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),
255
262
  collapsed behind a caret, on the live checkout AND on the receipt. A payment
256
263
  hash and a deposit txid are the only evidence a payer has that they paid you.
257
264
  `<openreceive-checkout>` / React's `<Checkout>` already render this panel and
@@ -302,7 +309,8 @@ not replace your orders, users, or products, and you do not join them.
302
309
  settled (409).
303
310
  - **A paid order's page says it is paid and shows no checkout.** Nothing is left
304
311
  to pay, and a checkout cannot start a new payment for a paid order. Mount the
305
- checkout only while the order is unpaid. When it settles on the page, update
312
+ checkout, and any line about coming back to pay or for a refund, only while
313
+ the order is unpaid. When it settles on the page, update
306
314
  the page's status line from the `openreceive-settled` event on
307
315
  `<openreceive-checkout>`: `on_paid` has already marked the order paid. Keep
308
316
  that checkout mounted, because it is the payer's receipt.
@@ -354,7 +362,9 @@ built on `@openreceive/browser/headless`. Read that before writing components.
354
362
  are on `@openreceive/browser`, not `/headless`.
355
363
  - A refund replaces the deposit panel. On `refund_required` also drop
356
364
  "switch payment method".
357
- - No "Open wallet" button on desktop.
365
+ - No "Open wallet" or "Pay in wallet" button, and no `lightning:` link. Cash
366
+ App cancels an invoice opened from a link and pays the same invoice scanned
367
+ or pasted. Show the QR code and a Copy invoice button.
358
368
  - Wallet suggestions: `getPaymentWizardRoutes()` +
359
369
  `createWizardRouteDisplays`. Lightning only. Logos are data URIs; tutorial
360
370
  images load from a JavaScript chunk. For a custom headless UI, load it when
@@ -444,6 +454,13 @@ Docker builds) have neither. Install them before bundling:
444
454
  apt-get install -y autoconf automake libtool build-essential pkg-config libssl-dev
445
455
  ```
446
456
 
457
+ On Alpine (`ruby:*-alpine`), install these instead. `tzdata` is for Rails itself,
458
+ which will not boot without it there:
459
+
460
+ ```sh
461
+ apk add --no-cache build-base autoconf automake libtool pkgconf openssl-dev tzdata
462
+ ```
463
+
447
464
  Full Ruby images and typical developer machines already have these.
448
465
 
449
466
  Then run:
@@ -680,11 +697,14 @@ share one IP. → [Rate limiting](https://openreceive.org/guides/rate-limiting.m
680
697
 
681
698
  In production, the engine builds the wallet client when your app boots. It
682
699
  also runs the receive-only preflight right away: it reaches the wallet and
683
- checks that the code cannot spend. A missing `NWC_URI`, a dead relay, or a
684
- spend-capable wallet then stops the deploy. Otherwise those problems would
685
- show up as 500 errors for customers on the first checkout. Outside production
686
- (tests, consoles), the engine builds the client lazily, on first use, so no
687
- live wallet is needed.
700
+ checks that the code cannot spend. A missing `NWC_URI` or a spend-capable
701
+ wallet then stops the deploy. Otherwise those problems would show up as errors
702
+ for customers on the first checkout. A relay that does not answer at boot does
703
+ not stop it: the app boots, logs one line, and checkouts get a retryable
704
+ `503 WALLET_UNAVAILABLE` until the wallet answers. The first checkout after a
705
+ short wait (1 s, doubling to 60 s) checks again, so payments come back without
706
+ a restart. Outside production (tests, consoles), the engine builds the client
707
+ lazily, on first use, so no live wallet is needed.
688
708
 
689
709
  ### Render the checkout
690
710
 
@@ -3,8 +3,9 @@ This is the full file; follow it from Step 0.
3
3
  # OpenReceive agent directions (React Router)
4
4
 
5
5
  ```sh
6
- # READ THIS FIRST: this file is 35 KB and a summary drops required steps. Download it whole:
6
+ # READ THIS FIRST: this file is 36 KB and a summary drops required steps. Download it whole:
7
7
  curl -fsSL https://openreceive.org/agent-directions/react-router/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/react-router/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/react-router/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 React Router application in framework mode — the app
23
24
  you are already working in, on Node. OpenReceive ships no React Router
@@ -199,11 +200,16 @@ itself, and they hold for every integration.
199
200
  and not a Prisma/Drizzle relation to `openreceive_payments`.
200
201
  - Keep `NWC_URI` / `LSC_URI_*` server-only. Never put them in browser code,
201
202
  logs, or assets.
203
+ - After a production build, run `npx openreceive doctor --scan-build build/client`. Never grep a build for a code.
202
204
  - Do not suggest rotating, revoking or replacing a code because it was pasted
203
205
  into this chat; that is the supported path.
204
206
  - Work only in this application. Never read or run anything from another
205
207
  project on this machine (its `node_modules`, tools or source), for any
206
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.
207
213
  - Restart only this app's server, on the port it already uses: stop the
208
214
  process you started, or the one listening on that port, by its pid (or
209
215
  restart its Compose service). Never `pkill` or `killall` by name: that
@@ -246,21 +252,25 @@ itself, and they hold for every integration.
246
252
  (`POST /swaps`) re-serves the committed attempt — but only while it is live,
247
253
  and the shadow invoice behind a swap lasts about half an hour, after which the
248
254
  same click mints a NEW deposit address and the refund is off-screen. Keep the
249
- `payment_hash` and reopen the attempt with `POST /swaps/status`, which has no
250
- such window. On the drop-ins: `resumePaymentHash`, fed from `onState`, on
251
- `<Checkout>`; the `resume-payment-hash` attribute, fed from the
255
+ `payment_hash` on your order row, not in browser storage, and reopen the
256
+ attempt with `POST /swaps/status`, which has no such window. On the
257
+ drop-ins: `resumePaymentHash`, fed from `onState`, on `<Checkout>`; the
258
+ `resume-payment-hash` attribute, fed from the
252
259
  `openreceive-state` event (`event.detail.state.payment_hash`), on
253
260
  `<openreceive-checkout>`.
254
261
  That visit can come hours later, and `authorize` must still know the payer:
255
262
  a session that expired in between answers 403 and strands the deposit. On a
256
- guest shop, tie the order to a long-lived signed cookie, or put a secret
257
- per-order token in its URL that your page trades for that cookie.
263
+ guest shop, tie the order to a long-lived cookie signed with the app's own
264
+ secret (such as `SESSION_SECRET`, never a wallet or swap code), or put a
265
+ secret per-order token in its URL that your page trades for that cookie.
258
266
  https://openreceive.org/guides/swap-refunds.md
259
267
  - Show the payer WHAT THEY ARE BUYING. Return an optional `description` beside
260
268
  the price from `amountFor` and both drop-ins render it above the amount.
261
269
  Without it the checkout is a QR and "$1.00" with no sign of what the dollar
262
270
  is for.
263
- - Show the payer the transaction record: `createTransactionDetails(...)` rows,
271
+ - Show the payer the transaction record: `createTransactionDetails(...)` rows
272
+ (with no bundler use `renderTransactionDetailsHtml`: the standalone file has
273
+ no `createTransactionDetails`, and one bad import stops the whole page),
264
274
  collapsed behind a caret, on the live checkout AND on the receipt. A payment
265
275
  hash and a deposit txid are the only evidence a payer has that they paid you.
266
276
  `<Checkout>` / `<openreceive-checkout>` already render this panel and the
@@ -381,7 +391,9 @@ components.
381
391
  are on `@openreceive/browser`, not `/headless`.
382
392
  - A refund replaces the deposit panel. On `refund_required` also drop
383
393
  "switch payment method".
384
- - No "Open wallet" button on desktop.
394
+ - No "Open wallet" or "Pay in wallet" button, and no `lightning:` link. Cash
395
+ App cancels an invoice opened from a link and pays the same invoice scanned
396
+ or pasted. Show the QR code and a Copy invoice button.
385
397
  - Wallet suggestions: `getPaymentWizardRoutes()` +
386
398
  `createWizardRouteDisplays`. Lightning only. Logos are data URIs; tutorial
387
399
  images load from a JavaScript chunk. For a custom headless UI, load it when