openreceive 0.4.32 → 0.4.34

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 +12 -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 (SvelteKit)
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 38 KB and a summary drops required steps. Download it whole:
7
7
  curl -fsSL https://openreceive.org/agent-directions/sveltekit/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/sveltekit/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/sveltekit/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.34.
21
22
 
22
23
  Add OpenReceive to a SvelteKit application — the app you are already working
23
24
  in, on `@sveltejs/adapter-node`. OpenReceive ships no SvelteKit package: the
@@ -200,11 +201,16 @@ itself, and they hold for every integration.
200
201
  and not a Prisma/Drizzle relation to `openreceive_payments`.
201
202
  - Keep `NWC_URI` / `LSC_URI_*` server-only. Never put them in browser code,
202
203
  logs, or assets.
204
+ - After a production build, run `npx openreceive doctor --scan-build build/client`. Never grep a build for a code.
203
205
  - Do not suggest rotating, revoking or replacing a code because it was pasted
204
206
  into this chat; that is the supported path.
205
207
  - Work only in this application. Never read or run anything from another
206
208
  project on this machine (its `node_modules`, tools or source), for any
207
209
  reason. A browser and Playwright are not part of setup.
210
+ - The project's own rules (its `AGENTS.md`, contributing guide) win over these
211
+ directions. If one forbids a step here, such as running migrations, ask the
212
+ owner and wait for the answer, even if doctor cannot pass yet. Do not move
213
+ the step somewhere the rule does not name, such as app startup.
208
214
  - Restart only this app's server, on the port it already uses: stop the
209
215
  process you started, or the one listening on that port, by its pid (or
210
216
  restart its Compose service). Never `pkill` or `killall` by name: that
@@ -247,21 +253,25 @@ itself, and they hold for every integration.
247
253
  (`POST /swaps`) re-serves the committed attempt — but only while it is live,
248
254
  and the shadow invoice behind a swap lasts about half an hour, after which the
249
255
  same click mints a NEW deposit address and the refund is off-screen. Keep the
250
- `payment_hash` and reopen the attempt with `POST /swaps/status`, which has no
251
- such window. On the drop-ins: `resumePaymentHash`, fed from `onState`, on
252
- `<Checkout>`; the `resume-payment-hash` attribute, fed from the
256
+ `payment_hash` on your order row, not in browser storage, and reopen the
257
+ attempt with `POST /swaps/status`, which has no such window. On the
258
+ drop-ins: `resumePaymentHash`, fed from `onState`, on `<Checkout>`; the
259
+ `resume-payment-hash` attribute, fed from the
253
260
  `openreceive-state` event (`event.detail.state.payment_hash`), on
254
261
  `<openreceive-checkout>`.
255
262
  That visit can come hours later, and `authorize` must still know the payer:
256
263
  a session that expired in between answers 403 and strands the deposit. On a
257
- guest shop, tie the order to a long-lived signed cookie, or put a secret
258
- per-order token in its URL that your page trades for that cookie.
264
+ guest shop, tie the order to a long-lived cookie signed with the app's own
265
+ secret (such as `SESSION_SECRET`, never a wallet or swap code), or put a
266
+ secret per-order token in its URL that your page trades for that cookie.
259
267
  https://openreceive.org/guides/swap-refunds.md
260
268
  - Show the payer WHAT THEY ARE BUYING. Return an optional `description` beside
261
269
  the price from `amountFor` and both drop-ins render it above the amount.
262
270
  Without it the checkout is a QR and "$1.00" with no sign of what the dollar
263
271
  is for.
264
- - Show the payer the transaction record: `createTransactionDetails(...)` rows,
272
+ - Show the payer the transaction record: `createTransactionDetails(...)` rows
273
+ (with no bundler use `renderTransactionDetailsHtml`: the standalone file has
274
+ no `createTransactionDetails`, and one bad import stops the whole page),
265
275
  collapsed behind a caret, on the live checkout AND on the receipt. A payment
266
276
  hash and a deposit txid are the only evidence a payer has that they paid you.
267
277
  `<Checkout>` / `<openreceive-checkout>` already render this panel and the
@@ -287,8 +297,14 @@ itself, and they hold for every integration.
287
297
  `ADDRESS_HEADER` and `XFF_DEPTH`, or every payer shares the proxy's address.
288
298
  - `<Checkout>` comes from `@openreceive/svelte/checkout.svelte`, with
289
299
  `@openreceive/svelte/styles.css`, on the order's own page: its resumable
290
- URL. SvelteKit's CSRF check refuses cross-site form posts; the checkout
291
- posts JSON, which it lets through, so leave the check on.
300
+ URL. The checkout posts JSON, which SvelteKit's CSRF check lets through.
301
+ SvelteKit 3 checks a form's Origin against `paths.origin`, else `https://`
302
+ plus the Host header (`ORIGIN` is SvelteKit 2's). If the shop's own forms
303
+ answer 403 (plain HTTP, no proxy), set
304
+ `paths: { origin: process.env.ORIGIN || undefined }` and pass the deploy's
305
+ public URL as `ORIGIN` at `vite build`, never a literal host:port. Never
306
+ widen the check (`trustedOrigins: ['*']`, `checkOrigin: false`); replace a
307
+ widening the app has with that origin.
292
308
  - HTTP JSON is snake_case; TypeScript APIs are camelCase.
293
309
  - Money is integers or decimal strings — never binary floats.
294
310
 
@@ -389,7 +405,9 @@ components.
389
405
  are on `@openreceive/browser`, not `/headless`.
390
406
  - A refund replaces the deposit panel. On `refund_required` also drop
391
407
  "switch payment method".
392
- - No "Open wallet" button on desktop.
408
+ - No "Open wallet" or "Pay in wallet" button, and no `lightning:` link. Cash
409
+ App cancels an invoice opened from a link and pays the same invoice scanned
410
+ or pasted. Show the QR code and a Copy invoice button.
393
411
  - Wallet suggestions: `getPaymentWizardRoutes()` +
394
412
  `createWizardRouteDisplays`. Lightning only. Logos are data URIs; tutorial
395
413
  images load from a JavaScript chunk. For a custom headless UI, load it when
@@ -3,8 +3,9 @@ This is the full file; follow it from Step 0.
3
3
  # OpenReceive agent directions (TanStack Start)
4
4
 
5
5
  ```sh
6
- # READ THIS FIRST: this file is 40 KB and a summary drops required steps. Download it whole:
6
+ # READ THIS FIRST: this file is 41 KB and a summary drops required steps. Download it whole:
7
7
  curl -fsSL https://openreceive.org/agent-directions/tanstack-start/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/tanstack-start/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/tanstack-start/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.34.
21
22
 
22
23
  Add OpenReceive to a TanStack Start application on Node — the app you are
23
24
  already working in, with its own Postgres. OpenReceive ships no TanStack
@@ -202,11 +203,16 @@ itself, and they hold for every integration.
202
203
  and not a Prisma/Drizzle relation to `openreceive_payments`.
203
204
  - Keep `NWC_URI` / `LSC_URI_*` server-only. Never put them in browser code,
204
205
  logs, or assets.
206
+ - After a production build, run `npx openreceive doctor --scan-build .output/public`. Never grep a build for a code.
205
207
  - Do not suggest rotating, revoking or replacing a code because it was pasted
206
208
  into this chat; that is the supported path.
207
209
  - Work only in this application. Never read or run anything from another
208
210
  project on this machine (its `node_modules`, tools or source), for any
209
211
  reason. A browser and Playwright are not part of setup.
212
+ - The project's own rules (its `AGENTS.md`, contributing guide) win over these
213
+ directions. If one forbids a step here, such as running migrations, ask the
214
+ owner and wait for the answer, even if doctor cannot pass yet. Do not move
215
+ the step somewhere the rule does not name, such as app startup.
210
216
  - Restart only this app's server, on the port it already uses: stop the
211
217
  process you started, or the one listening on that port, by its pid (or
212
218
  restart its Compose service). Never `pkill` or `killall` by name: that
@@ -249,21 +255,25 @@ itself, and they hold for every integration.
249
255
  (`POST /swaps`) re-serves the committed attempt — but only while it is live,
250
256
  and the shadow invoice behind a swap lasts about half an hour, after which the
251
257
  same click mints a NEW deposit address and the refund is off-screen. Keep the
252
- `payment_hash` and reopen the attempt with `POST /swaps/status`, which has no
253
- such window. On the drop-ins: `resumePaymentHash`, fed from `onState`, on
254
- `<Checkout>`; the `resume-payment-hash` attribute, fed from the
258
+ `payment_hash` on your order row, not in browser storage, and reopen the
259
+ attempt with `POST /swaps/status`, which has no such window. On the
260
+ drop-ins: `resumePaymentHash`, fed from `onState`, on `<Checkout>`; the
261
+ `resume-payment-hash` attribute, fed from the
255
262
  `openreceive-state` event (`event.detail.state.payment_hash`), on
256
263
  `<openreceive-checkout>`.
257
264
  That visit can come hours later, and `authorize` must still know the payer:
258
265
  a session that expired in between answers 403 and strands the deposit. On a
259
- guest shop, tie the order to a long-lived signed cookie, or put a secret
260
- per-order token in its URL that your page trades for that cookie.
266
+ guest shop, tie the order to a long-lived cookie signed with the app's own
267
+ secret (such as `SESSION_SECRET`, never a wallet or swap code), or put a
268
+ secret per-order token in its URL that your page trades for that cookie.
261
269
  https://openreceive.org/guides/swap-refunds.md
262
270
  - Show the payer WHAT THEY ARE BUYING. Return an optional `description` beside
263
271
  the price from `amountFor` and both drop-ins render it above the amount.
264
272
  Without it the checkout is a QR and "$1.00" with no sign of what the dollar
265
273
  is for.
266
- - Show the payer the transaction record: `createTransactionDetails(...)` rows,
274
+ - Show the payer the transaction record: `createTransactionDetails(...)` rows
275
+ (with no bundler use `renderTransactionDetailsHtml`: the standalone file has
276
+ no `createTransactionDetails`, and one bad import stops the whole page),
267
277
  collapsed behind a caret, on the live checkout AND on the receipt. A payment
268
278
  hash and a deposit txid are the only evidence a payer has that they paid you.
269
279
  `<Checkout>` / `<openreceive-checkout>` already render this panel and the
@@ -434,7 +444,9 @@ components.
434
444
  are on `@openreceive/browser`, not `/headless`.
435
445
  - A refund replaces the deposit panel. On `refund_required` also drop
436
446
  "switch payment method".
437
- - No "Open wallet" button on desktop.
447
+ - No "Open wallet" or "Pay in wallet" button, and no `lightning:` link. Cash
448
+ App cancels an invoice opened from a link and pays the same invoice scanned
449
+ or pasted. Show the QR code and a Copy invoice button.
438
450
  - Wallet suggestions: `getPaymentWizardRoutes()` +
439
451
  `createWizardRouteDisplays`. Lightning only. Logos are data URIs; tutorial
440
452
  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 25 KB and a summary drops required steps. Download it whole:
7
7
  curl -fsSL https://openreceive.org/agent-directions/vendure/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/vendure/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/vendure/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.34.
21
22
 
22
23
  Add OpenReceive to the Vendure shop you are working in: a Vendure server with
23
24
  its worker, and usually a storefront in its own project (Vendure's Next.js
@@ -3,8 +3,9 @@ This is the full file; follow it from Step 0.
3
3
  # OpenReceive agent directions (WordPress + WooCommerce)
4
4
 
5
5
  ```sh
6
- # READ THIS FIRST: this file is 23 KB and a summary drops required steps. Download it whole:
6
+ # READ THIS FIRST: this file is 24 KB and a summary drops required steps. Download it whole:
7
7
  curl -fsSL https://openreceive.org/agent-directions/woocommerce/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/woocommerce/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/woocommerce/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.34.
21
22
 
22
23
  Install and configure the OpenReceive payment gateway in the WooCommerce store
23
24
  you are working in. Preserve its theme, checkout, customer accounts, order
@@ -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
@@ -95,7 +97,7 @@ is saved or the user said "Bitcoin only". Never invent a placeholder code.
95
97
  Install this release from the WordPress.org plugin directory:
96
98
 
97
99
  ```sh
98
- wp plugin install openreceive --version=0.4.32 --activate
100
+ wp plugin install openreceive --version=0.4.34 --activate
99
101
  ```
100
102
 
101
103
  If that fails because WordPress.org does not have this version yet, install
@@ -103,7 +105,7 @@ the ZIP attached to the same GitHub release. Never install the GitHub
103
105
  source-code ZIP or a ZIP from an older release:
104
106
 
105
107
  ```sh
106
- wp plugin install https://github.com/OpenReceive/openreceive/releases/download/v0.4.32/openreceive-wordpress-0.4.32.zip --activate
108
+ wp plugin install https://github.com/OpenReceive/openreceive/releases/download/v0.4.34/openreceive-wordpress-0.4.34.zip --activate
107
109
  ```
108
110
 
109
111
  It needs WooCommerce active, and PHP 8.2+ with GMP and sodium in BOTH the web
@@ -143,7 +145,10 @@ Doctor names any failed check and exits nonzero; fix it before going on.
143
145
  ## Step 3 — mint a test invoice, then stop
144
146
 
145
147
  Create a pending test order that pays with OpenReceive, then mint its
146
- Lightning invoice from the terminal:
148
+ Lightning invoice from the terminal. Pick a quantity that brings the order to
149
+ at least $20 (or the same in the store's currency): smaller orders are often
150
+ under a swap minimum, and the user will want to try every method on the link
151
+ you give them.
147
152
 
148
153
  ```sh
149
154
  wp wc shop_order create --user=<admin user id> --payment_method=openreceive \
@@ -154,7 +159,7 @@ wp openreceive test-invoice <order id>
154
159
  `test-invoice` goes through the same checkout route as the order-pay page. It
155
160
  prints the amount in sats, the BOLT11 invoice, the order-pay link and the
156
161
  methods that page offers, each swap asset marked available or followed by the
157
- reason it is not. That reason is the answer; report it. "Below the provider
162
+ 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
158
163
  minimum" or "above the provider maximum" is about this order's amount, not a
159
164
  fault: a small test order is often under a swap minimum. Only when the reason
160
165
  says the provider is unreachable does doctor's "Swap provider" line have more
@@ -179,8 +184,9 @@ provider minimum depends on the order total, and the user's own orders will
179
184
  differ. Do not list what you changed or what doctor checked. Send nothing
180
185
  after it. Do not install mail software, add containers or services, or set up
181
186
  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
187
+ little traffic, add one sentence to that message: WordPress runs its every-minute payment check only when someone visits the
188
+ store, so on a quiet store the user's host should call wp-cron.php every
189
+ minute (a system cron); this setup did not add one. State
184
190
  it as a recommendation. Do not offer to set it up or end the message on a
185
191
  question.
186
192
 
@@ -253,7 +259,7 @@ database or application.
253
259
 
254
260
  Each GitHub release also attaches the same plugin as a ZIP, for a site that
255
261
  cannot reach WordPress.org or when WordPress.org does not list a release yet.
256
- Download [openreceive-wordpress-0.4.32.zip](https://github.com/OpenReceive/openreceive/releases/download/v0.4.32/openreceive-wordpress-0.4.32.zip)
262
+ Download [openreceive-wordpress-0.4.34.zip](https://github.com/OpenReceive/openreceive/releases/download/v0.4.34/openreceive-wordpress-0.4.34.zip)
257
263
  and install it through **Plugins → Add New → Upload Plugin**. Historical
258
264
  releases may lack this asset. If that exact URL returns 404, build the same tag
259
265
  below; never silently install an older ZIP. The GitHub source-code ZIP is not
@@ -263,7 +269,7 @@ GMP/sodium, Composer and WP-CLI:
263
269
  ```sh
264
270
  git clone https://github.com/OpenReceive/openreceive.git
265
271
  cd openreceive
266
- git checkout v0.4.32
272
+ git checkout v0.4.34
267
273
  npm ci
268
274
  npm run build:packages
269
275
  composer install --working-dir=packages/php/wordpress
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: openreceive
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.32
4
+ version: 0.4.34
5
5
  platform: ruby
6
6
  authors:
7
7
  - OpenReceive