openreceive 0.4.28 → 0.4.30

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 (32) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +12 -0
  3. data/lib/openreceive/version.rb +1 -1
  4. data/skills/integrate-openreceive/SKILL.md +10 -1
  5. data/skills/integrate-openreceive/references/astro.md +8 -9
  6. data/skills/integrate-openreceive/references/bolt.md +9 -7
  7. data/skills/integrate-openreceive/references/btcpay.md +3 -4
  8. data/skills/integrate-openreceive/references/django.md +2 -3
  9. data/skills/integrate-openreceive/references/edd.md +4 -5
  10. data/skills/integrate-openreceive/references/fastapi.md +4 -5
  11. data/skills/integrate-openreceive/references/fastify.md +4 -5
  12. data/skills/integrate-openreceive/references/flask.md +2 -3
  13. data/skills/integrate-openreceive/references/fossbilling.md +48 -16
  14. data/skills/integrate-openreceive/references/laravel.md +3 -4
  15. data/skills/integrate-openreceive/references/lovable.md +16 -12
  16. data/skills/integrate-openreceive/references/medusa.md +12 -5
  17. data/skills/integrate-openreceive/references/mobile.md +1 -1
  18. data/skills/integrate-openreceive/references/nestjs.md +2 -3
  19. data/skills/integrate-openreceive/references/next.md +4 -5
  20. data/skills/integrate-openreceive/references/node.md +4 -5
  21. data/skills/integrate-openreceive/references/nuxt.md +9 -10
  22. data/skills/integrate-openreceive/references/odoo.md +446 -0
  23. data/skills/integrate-openreceive/references/paymenter.md +5 -6
  24. data/skills/integrate-openreceive/references/php.md +2 -3
  25. data/skills/integrate-openreceive/references/prestashop.md +476 -0
  26. data/skills/integrate-openreceive/references/rails.md +2 -3
  27. data/skills/integrate-openreceive/references/react-router.md +8 -9
  28. data/skills/integrate-openreceive/references/sveltekit.md +9 -10
  29. data/skills/integrate-openreceive/references/tanstack-start.md +14 -11
  30. data/skills/integrate-openreceive/references/vendure.md +544 -0
  31. data/skills/integrate-openreceive/references/woocommerce.md +5 -6
  32. metadata +4 -1
@@ -3,7 +3,7 @@ This is the full file; follow it from Step 0.
3
3
  # OpenReceive agent directions (Lovable)
4
4
 
5
5
  ```text
6
- READ THIS FIRST: this file is 26 KB and a summary drops required steps. Read all of it:
6
+ READ THIS FIRST: this file is 27 KB and a summary drops required steps. Read all of it:
7
7
  https://openreceive.org/agent-directions/lovable/full.md
8
8
  If your fetch tool gave you a summary, fetch that URL again for the full text.
9
9
  ```
@@ -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.28.
20
+ These directions describe OpenReceive 0.4.30.
21
21
 
22
22
  Add OpenReceive to this Lovable app: a TanStack Start app on Cloudflare
23
23
  Workers, with Lovable Cloud or a connected Supabase project as its database.
@@ -121,7 +121,7 @@ saved or explicitly declined.
121
121
 
122
122
  ## Step 1 — the packages
123
123
 
124
- Add `@openreceive/http` and `@openreceive/react` at 0.4.28 or newer.
124
+ Add `@openreceive/http` and `@openreceive/react` at 0.4.30 or newer.
125
125
  Nothing else: no `pg`, no Postgres driver, no OpenReceive scaffold. Do not
126
126
  change the Vite or Wrangler configuration.
127
127
 
@@ -182,7 +182,7 @@ begin
182
182
  update public.orders
183
183
  set status = 'paid'
184
184
  where id = p_reference::uuid -- or just p_reference, if the ids are text
185
- and status = 'pending';
185
+ and status = 'awaiting_payment'; -- this app's own unpaid status
186
186
  end
187
187
  $$;
188
188
  ```
@@ -410,12 +410,12 @@ export async function handleOpenReceive(request: Request): Promise<Response> {
410
410
  ```
411
411
 
412
412
  `authorize` sees the incoming request with its cookies, so check it with
413
- the session your app already has. The Next.js quickstart
413
+ the session your app already has. The [Next.js quickstart](https://openreceive.org/guides/quickstart-next.md)
414
414
  explains each hook. They are the same here.
415
415
 
416
416
  Create OpenReceive's two tables with your migrations, or run
417
417
  `paymentsSchemaSql("postgres")` from `@openreceive/http` once. It is
418
- idempotent. See Payment storage.
418
+ idempotent. See [Payment storage](https://openreceive.org/guides/storage.md).
419
419
 
420
420
  ### On Supabase (Lovable)
421
421
 
@@ -440,7 +440,7 @@ npm install @openreceive/http @openreceive/react
440
440
  ) returns void language plpgsql as $$
441
441
  begin
442
442
  update public.orders set status = 'paid'
443
- where id = p_reference::uuid and status = 'pending';
443
+ where id = p_reference::uuid and status = 'awaiting_payment'; -- your unpaid status
444
444
  end
445
445
  $$;
446
446
  ```
@@ -492,17 +492,21 @@ There is no `onPaid`: `openreceive_on_paid` is the fulfillment. `findOrder`
492
492
  reads the order with your server-side Supabase client; in a Lovable app that
493
493
  is `supabaseAdmin` from `@/integrations/supabase/client.server`.
494
494
 
495
- The checkout calls the payment routes from the browser with the page's
496
- cookies, and nothing else. A Lovable app keeps its Supabase sign-in in the
497
- browser, not in a cookie, so `authorize` cannot see who is signed in. Give
498
- the buyer a cookie of their own instead: create orders in a server function
495
+ By default the checkout calls the payment routes from the browser with the
496
+ page's cookies and nothing else. A Lovable app keeps its Supabase sign-in in
497
+ the browser, not in a cookie, so `authorize` cannot see who is signed in from
498
+ those cookies. Since 0.4.25 the React `<Checkout>` also takes a `fetch` that
499
+ sends the access token
500
+ ([Use Supabase Auth in `authorize`](https://openreceive.org/guides/supabase.md#4-use-supabase-auth-in-authorize)), but
501
+ this recipe keeps the simpler route that works with every checkout: give the
502
+ buyer a cookie of their own. Create orders in a server function
499
503
  that sets an HttpOnly `buyer` cookie (a random value, kept across orders) and
500
504
  stores the same value on the order as `buyer_token`. `currentBuyer` reads it
501
505
  back from the request's `cookie` header.
502
506
 
503
507
  Before it serves, the server checks the database, and the payment routes
504
508
  answer 503 until the migration is applied and `openreceive_on_paid` is
505
- yours; the log names the fix. More: Supabase over HTTPS.
509
+ yours; the log names the fix. More: [Supabase over HTTPS](https://openreceive.org/guides/supabase.md#supabase-over-https).
506
510
 
507
511
  ### The checkout page
508
512
 
@@ -3,7 +3,7 @@ This is the full file; follow it from Step 0.
3
3
  # OpenReceive agent directions (Medusa)
4
4
 
5
5
  ```sh
6
- # READ THIS FIRST: this file is 21 KB and a summary drops required steps. Download it whole:
6
+ # READ THIS FIRST: this file is 22 KB and a summary drops required steps. Download it whole:
7
7
  curl -fsSL https://openreceive.org/agent-directions/medusa/full.md
8
8
  # Skip the download only if you already have all of it: pasted, read from disk or fetched raw.
9
9
  ```
@@ -17,7 +17,7 @@ curl -fsSL https://openreceive.org/agent-directions/medusa/full.md
17
17
  - Do not suggest rotating or revoking a code because it was pasted here.
18
18
  - Start the quickstart only once the NWC code is saved, and the LSC code is saved or the user said "Bitcoin only".
19
19
 
20
- These directions describe OpenReceive 0.4.28.
20
+ These directions describe OpenReceive 0.4.30.
21
21
 
22
22
  Add OpenReceive to the Medusa store you are working in: a Medusa server, and
23
23
  usually a storefront in its own project (Medusa's Next.js starter or another).
@@ -199,7 +199,6 @@ Medusa.
199
199
  - [Lightning Swap Connect URI](https://openreceive.org/guides/lightning-swap-connect.md)
200
200
  - [Security](https://openreceive.org/guides/security.md)
201
201
  - [Price Feeds](https://openreceive.org/guides/price-feeds.md)
202
- - [Payment Safety Upgrade](https://openreceive.org/guides/payment-safety-upgrade.md)
203
202
 
204
203
  ---
205
204
 
@@ -321,13 +320,14 @@ starter's Tailwind build:
321
320
 
322
321
  ```ts
323
322
  import { readFile } from "node:fs/promises"
324
- import { createRequire } from "node:module"
325
323
  import path from "node:path"
326
324
  import { NextRequest } from "next/server"
327
325
 
328
326
  const BACKEND_URL = process.env.MEDUSA_BACKEND_URL ?? "http://localhost:9000"
329
327
 
330
328
  async function stylesheet() {
329
+ // Node's own createRequire: Next's bundler would replace an imported one.
330
+ const { createRequire } = await import(/* webpackIgnore: true */ "node:module")
331
331
  const resolve = createRequire(path.join(process.cwd(), "package.json")).resolve
332
332
  const css = await readFile(resolve("@openreceive/react/styles.css"))
333
333
  return new Response(css, {
@@ -460,7 +460,14 @@ and a buyer paying an order by Lightning and by USDT on Solana in Chromium,
460
460
  after which the order is placed with its payment captured. A payment whose
461
461
  buyer never placed the order was placed by the plugin's job. An unknown
462
462
  session, another provider's session and a request without the publishable
463
- key were refused, and an admin refund was recorded.
463
+ key were refused, and an admin refund was recorded. The repository's CI runs
464
+ the plugin in a real Medusa 2.21.2 on PostgreSQL on every push: those payments
465
+ through the store API, the refusals, the refund and the job.
466
+
467
+ Tested on 2026-10-19 with the starter's production build (`next build`, then
468
+ `next start`): a buyer paid by Lightning and by USDT on Solana as above, and
469
+ the route served the checkout's stylesheet, as it also does under
470
+ `next dev --turbopack`.
464
471
 
465
472
  Not tested: Medusa split into a server and a worker, Medusa Cloud, storefronts
466
473
  other than the Next.js starter, and a storefront calling Medusa from the
@@ -17,7 +17,7 @@ curl -fsSL https://openreceive.org/agent-directions/mobile/full.md
17
17
  - The app never decides paid: it asks the server. A link back to the app is navigation only.
18
18
  - Do not suggest rotating or revoking a code because it was pasted here.
19
19
 
20
- These directions describe OpenReceive 0.4.28.
20
+ These directions describe OpenReceive 0.4.30.
21
21
 
22
22
  Add Bitcoin checkout, with optional USDT, USDC, ETH and SOL, to a mobile app:
23
23
  React Native or Expo, Flutter, Swift or Kotlin. OpenReceive has no mobile SDK
@@ -17,7 +17,7 @@ curl -fsSL https://openreceive.org/agent-directions/nestjs/full.md
17
17
  - Do not suggest rotating or revoking a code because it was pasted here.
18
18
  - Start the quickstart only once the NWC code is saved, and the LSC code is saved or the user said "Bitcoin only".
19
19
 
20
- These directions describe OpenReceive 0.4.28.
20
+ These directions describe OpenReceive 0.4.30.
21
21
 
22
22
  Add OpenReceive to a NestJS application — the app you are already working in,
23
23
  on Nest's default Express platform. You do not need a copy of the OpenReceive
@@ -447,13 +447,12 @@ enough; drop the `.md` for the same page a person would read.
447
447
  - https://openreceive.org/guides/api-reference.md — every route, option and error code
448
448
  - https://openreceive.org/guides/custom-checkout-route.md — advanced: replacing the shipped adapter's routes with your own
449
449
  - https://openreceive.org/guides/react-material-ui-recipe.md — a worked custom UI on a component library
450
+ - https://openreceive.org/guides/payment-safety-upgrade.md — coordinated upgrades and reviewed repair of existing attempts
450
451
  - https://openreceive.org/guides.md — the index, if what you need is not above
451
452
 
452
453
  Questions, or a problem with the library itself:
453
454
  https://openreceive.org/contact
454
455
 
455
- - https://openreceive.org/guides/payment-safety-upgrade.md — coordinated upgrades and reviewed repair of existing attempts
456
-
457
456
  ---
458
457
 
459
458
  ## The quickstart, in full
@@ -17,7 +17,7 @@ curl -fsSL https://openreceive.org/agent-directions/next/full.md
17
17
  - Do not suggest rotating or revoking a code because it was pasted here.
18
18
  - Start the quickstart only once the NWC code is saved, and the LSC code is saved or the user said "Bitcoin only".
19
19
 
20
- These directions describe OpenReceive 0.4.28.
20
+ These directions describe OpenReceive 0.4.30.
21
21
 
22
22
  Add OpenReceive to a Next.js App Router application — the app you are already
23
23
  working in. You do not need a copy of the OpenReceive source: the packages are
@@ -438,13 +438,12 @@ enough; drop the `.md` for the same page a person would read.
438
438
  - https://openreceive.org/guides/react-material-ui-recipe.md — a worked custom UI on a component library
439
439
  - https://openreceive.org/guides/tanstack-start-recipe.md — the same handler as a TanStack Start server route, if this app is TanStack Start after all
440
440
  - https://openreceive.org/guides/sveltekit-recipe.md, https://openreceive.org/guides/nuxt-recipe.md, https://openreceive.org/guides/astro-recipe.md and https://openreceive.org/guides/react-router-recipe.md — the same handler as a SvelteKit, Nuxt, Astro or React Router route, if this app is one of those
441
+ - https://openreceive.org/guides/payment-safety-upgrade.md — coordinated upgrades and reviewed repair of existing attempts
441
442
  - https://openreceive.org/guides.md — the index, if what you need is not above
442
443
 
443
444
  Questions, or a problem with the library itself:
444
445
  https://openreceive.org/contact
445
446
 
446
- - https://openreceive.org/guides/payment-safety-upgrade.md — coordinated upgrades and reviewed repair of existing attempts
447
-
448
447
  ---
449
448
 
450
449
  ## The quickstart, in full
@@ -473,8 +472,8 @@ stays the same.
473
472
  | Server | `@openreceive/next`, `@openreceive/express`, `@openreceive/fastify` |
474
473
  | Frontend | `@openreceive/react`, `@openreceive/vue`, `@openreceive/svelte`, `@openreceive/angular`, `@openreceive/elements` (plain HTML) |
475
474
 
476
- Express: [quickstart-node.md](https://openreceive.org/guides/quickstart-node.md) · Fastify:
477
- [quickstart-fastify.md](https://openreceive.org/guides/quickstart-fastify.md). This page is the Next.js one.
475
+ Express: [Express quickstart](https://openreceive.org/guides/quickstart-node.md) · Fastify:
476
+ [Fastify quickstart](https://openreceive.org/guides/quickstart-fastify.md). This page is the Next.js one.
478
477
  An agent given the Express guide goes wrong on Next.js in three places: Next
479
478
  needs no `dotenv`, no `app.use`, and it needs a client component for the
480
479
  checkout.
@@ -17,7 +17,7 @@ curl -fsSL https://openreceive.org/agent-directions/node/full.md
17
17
  - Do not suggest rotating or revoking a code because it was pasted here.
18
18
  - Start the quickstart only once the NWC code is saved, and the LSC code is saved or the user said "Bitcoin only".
19
19
 
20
- These directions describe OpenReceive 0.4.28.
20
+ These directions describe OpenReceive 0.4.30.
21
21
 
22
22
  Add OpenReceive to a Node application — the app you are already working in. You
23
23
  do not need a copy of the OpenReceive source: the packages are on npm, and the
@@ -428,13 +428,12 @@ enough; drop the `.md` for the same page a person would read.
428
428
  - https://openreceive.org/guides/custom-checkout-route.md — advanced: replacing the shipped adapter's routes with your own
429
429
  - https://openreceive.org/guides/react-material-ui-recipe.md — a worked custom UI on a component library
430
430
  - https://openreceive.org/guides/sveltekit-recipe.md, https://openreceive.org/guides/nuxt-recipe.md, https://openreceive.org/guides/astro-recipe.md and https://openreceive.org/guides/react-router-recipe.md — the same handler as a SvelteKit, Nuxt, Astro or React Router route, if this app is one of those
431
+ - https://openreceive.org/guides/payment-safety-upgrade.md — coordinated upgrades and reviewed repair of existing attempts
431
432
  - https://openreceive.org/guides.md — the index, if what you need is not above
432
433
 
433
434
  Questions, or a problem with the library itself:
434
435
  https://openreceive.org/contact
435
436
 
436
- - https://openreceive.org/guides/payment-safety-upgrade.md — coordinated upgrades and reviewed repair of existing attempts
437
-
438
437
  ---
439
438
 
440
439
  ## The quickstart, in full
@@ -463,8 +462,8 @@ stays the same.
463
462
  | Server | `@openreceive/express`, `@openreceive/fastify`, `@openreceive/next` |
464
463
  | Frontend | `@openreceive/react`, `@openreceive/vue`, `@openreceive/svelte`, `@openreceive/angular`, `@openreceive/elements` (plain HTML) |
465
464
 
466
- Fastify: [quickstart-fastify.md](https://openreceive.org/guides/quickstart-fastify.md) · Next.js:
467
- [quickstart-next.md](https://openreceive.org/guides/quickstart-next.md). This page is the Express one.
465
+ Fastify: [Fastify quickstart](https://openreceive.org/guides/quickstart-fastify.md) · Next.js:
466
+ [Next.js quickstart](https://openreceive.org/guides/quickstart-next.md). This page is the Express one.
468
467
 
469
468
  On a fresh project, also install what this guide assumes you already have: the
470
469
  framework and an env loader (`npm install express dotenv`). Install your ORM
@@ -3,7 +3,7 @@ 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 33 KB and a summary drops required steps. Download it whole:
6
+ # READ THIS FIRST: this file is 34 KB and a summary drops required steps. Download it whole:
7
7
  curl -fsSL https://openreceive.org/agent-directions/nuxt/full.md
8
8
  # Skip the download only if you already have all of it: pasted, read from disk or fetched raw.
9
9
  ```
@@ -17,7 +17,7 @@ curl -fsSL https://openreceive.org/agent-directions/nuxt/full.md
17
17
  - Do not suggest rotating or revoking a code because it was pasted here.
18
18
  - Start the quickstart only once the NWC code is saved, and the LSC code is saved or the user said "Bitcoin only".
19
19
 
20
- These directions describe OpenReceive 0.4.28.
20
+ These directions describe OpenReceive 0.4.30.
21
21
 
22
22
  Add OpenReceive to a Nuxt application — the app you are already working in,
23
23
  on Nitro's `node-server` preset. OpenReceive ships no Nuxt package: the
@@ -419,13 +419,12 @@ enough; drop the `.md` for the same page a person would read.
419
419
  - https://openreceive.org/guides/custom-checkout-route.md — advanced: replacing the shipped adapter's routes with your own
420
420
  - https://openreceive.org/guides/react-material-ui-recipe.md — a worked custom UI on a component library
421
421
  - https://openreceive.org/guides/quickstart-next.md — each hook explained step by step, on Next.js; they are the same here
422
+ - https://openreceive.org/guides/payment-safety-upgrade.md — coordinated upgrades and reviewed repair of existing attempts
422
423
  - https://openreceive.org/guides.md — the index, if what you need is not above
423
424
 
424
425
  Questions, or a problem with the library itself:
425
426
  https://openreceive.org/contact
426
427
 
427
- - https://openreceive.org/guides/payment-safety-upgrade.md — coordinated upgrades and reviewed repair of existing attempts
428
-
429
428
  ---
430
429
 
431
430
  ## The quickstart, in full
@@ -464,7 +463,7 @@ npm install @openreceive/http @openreceive/vue pg
464
463
  On Node, with Nitro's default `node-server` preset. The wallet connection and
465
464
  your database driver need Node, so the route cannot run on an edge runtime.
466
465
  The Vercel, Netlify and AWS Lambda presets deploy Node functions: read
467
- Bitcoin checkout on serverless hosts first. For
466
+ [Bitcoin checkout on serverless hosts](https://openreceive.org/guides/serverless.md) first. For
468
467
  Cloudflare Workers, the [TanStack Start recipe](https://openreceive.org/guides/tanstack-start-recipe.md#where-it-runs)
469
468
  explains what a Worker needs. This recipe was not run on those hosts.
470
469
 
@@ -529,24 +528,24 @@ export default defineEventHandler((event) => handleOpenReceive(event));
529
528
  Put it in `server/routes/`, not `server/api/`, which would add `/api` to
530
529
  the path. `native` is the request's `H3Event`, so `authorize` can check the
531
530
  session your app already has: its cookies, or the user your session module
532
- reads from the event. The Next.js quickstart
531
+ reads from the event. The [Next.js quickstart](https://openreceive.org/guides/quickstart-next.md)
533
532
  explains each hook. They are the same here.
534
533
 
535
534
  One stack serves the whole server process. `getRequestIP` returns the socket
536
535
  address. Behind your own reverse proxy, `{ xForwardedFor: true }` reads the
537
536
  first address in `x-forwarded-for`, which is safe only when that proxy sets
538
- the header (Rate limiting).
537
+ the header ([Rate limiting](https://openreceive.org/guides/rate-limiting.md)).
539
538
 
540
539
  ### Your database
541
540
 
542
541
  `db` is a `pg` Pool, `node:sqlite` or `better-sqlite3`, or one of the
543
- adapters in Node ORM recipes. With Drizzle, pass
542
+ adapters in [Node ORM recipes](https://openreceive.org/guides/node-orms.md). With Drizzle, pass
544
543
  the `pg` Pool underneath it.
545
544
 
546
545
  Create OpenReceive's two tables with your migrations
547
546
  (`npx openreceive scaffold payments --orm <your orm>`), or run
548
547
  `paymentsSchemaSql("postgres")` from `@openreceive/http` once. It is
549
- idempotent. See Payment storage.
548
+ idempotent. See [Payment storage](https://openreceive.org/guides/storage.md).
550
549
 
551
550
  ### The checkout page
552
551
 
@@ -585,7 +584,7 @@ if (error.value) {
585
584
  The page renders on the server and starts the checkout in the browser. The
586
585
  payer picks Bitcoin and gets the invoice. Keep it at the order's own URL: a
587
586
  payer with a swap deposit in flight comes back to it
588
- (Swap refunds).
587
+ ([Swap refunds](https://openreceive.org/guides/swap-refunds.md)).
589
588
 
590
589
  ### Settings
591
590