openreceive 0.4.3 → 0.4.4

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.
@@ -1,6 +1,6 @@
1
1
  # OpenReceive agent directions (Node.js)
2
2
 
3
- These directions describe OpenReceive 0.4.3.
3
+ These directions describe OpenReceive 0.4.4.
4
4
 
5
5
  Add OpenReceive to a Node application — the app you are already working in. You
6
6
  do not need a copy of the OpenReceive source: the packages are on npm, and the
@@ -13,6 +13,12 @@ models (`ShopOrder`, a signed-cookie visitor, an in-memory catalog) over tables
13
13
  that already exist. Find this application's order, product, and user models —
14
14
  whatever they are actually named — and map the three hooks onto those.
15
15
 
16
+ Keep this application's frontend framework, authentication and database. Pick
17
+ the UI package that matches the frontend that is already here
18
+ (`@openreceive/react`, `/vue`, `/svelte`, `/angular`, or `/elements` for
19
+ plain HTML) — do not add React to a Vue app. Reuse the app's existing
20
+ session/auth in `authorize` and its existing database handle in `storage.db`.
21
+
16
22
  ## What OpenReceive is
17
23
 
18
24
  A payment library that runs inside YOUR server. It mounts HTTP routes in the
@@ -211,8 +217,11 @@ components.
211
217
  "switch payment method".
212
218
  - No "Open wallet" button on desktop.
213
219
  - Wallet suggestions: `getPaymentWizardRoutes()` +
214
- `createWizardRouteDisplays`. Lightning only. Host the icons with
215
- `assetBaseUrl` / `asset-base-url`.
220
+ `createWizardRouteDisplays`. Lightning only. Every image ships inside
221
+ the JavaScript — logos as data URIs, tutorials once `loadPayTutorialImages()`
222
+ resolves (`image` is `undefined` until then) — so serve nothing and set no
223
+ asset option. When it works, the logos and payment icons render; a missing
224
+ image means a CSP `img-src` that blocks `data:`, and the console names it.
216
225
 
217
226
  ## More documentation
218
227
 
@@ -226,10 +235,9 @@ enough; drop the `.md` for the same page a person would read.
226
235
  - https://openreceive.org/guides/frontend-checkout.md — the drop-in's props, attributes and slots
227
236
  - https://openreceive.org/guides/checkout-ux.md — read before building any custom UI
228
237
  - https://openreceive.org/guides/headless-checkout.md — the controller, the display models, refunds
229
- - https://openreceive.org/guides/provider-registry.md — where the packaged icons and pay
230
- tutorials come from, and how to serve them. The asset rule is the one a custom
231
- UI is most likely to get wrong; this is the page that owns it, not the summary
232
- in checkout-ux.md
238
+ - https://openreceive.org/guides/provider-registry.md — where the wallet logos and pay
239
+ tutorials come from: inside the JavaScript, nothing to serve. This is the page
240
+ that owns the image rule, not the summary in checkout-ux.md
233
241
  - https://openreceive.org/guides/automated-swaps.md — only if `LSC_URI_PRIMARY` is set
234
242
  - https://openreceive.org/guides/swap-refunds.md — the refund flow, and the route back to it. Read it before you turn swaps on
235
243
  - https://openreceive.org/guides/lightning-swap-connect.md — what an `LSC_URI_*` code actually is
@@ -252,7 +260,7 @@ https://openreceive.org/contact
252
260
  Inlined verbatim so this file needs no network access — follow it once Step 0
253
261
  passes. The page it comes from is https://openreceive.org/guides/quickstart-node.
254
262
 
255
- ## Node quickstart
263
+ ## Node quickstart (Express)
256
264
 
257
265
  Express + React. Requires Node ≥ 22.
258
266
 
@@ -273,6 +281,9 @@ identical.
273
281
  | Server | `@openreceive/express`, `@openreceive/fastify`, `@openreceive/next` |
274
282
  | Frontend | `@openreceive/react`, `@openreceive/vue`, `@openreceive/svelte`, `@openreceive/angular`, `@openreceive/elements` (plain HTML) |
275
283
 
284
+ Fastify: [quickstart-fastify.md](https://openreceive.org/guides/quickstart-fastify.md) · Next.js:
285
+ [quickstart-next.md](https://openreceive.org/guides/quickstart-next.md). This page is the Express one.
286
+
276
287
  On a fresh project, also install what this guide assumes is already there: the
277
288
  framework and an env loader (`npm install express dotenv`), plus your ORM
278
289
  before step 2 (`npm install prisma @prisma/client` on the Prisma path) —
@@ -455,12 +466,13 @@ so a white card never lands on a dark page. The checkout is styled by CSS
455
466
  variables under `data-theme`; [Frontend checkout](https://openreceive.org/guides/frontend-checkout.md) has
456
467
  the knobs.
457
468
 
458
- The payment-method icons are compiled into `@openreceive/browser` and need
459
- nothing from your bundler. The wallet logos and pay tutorials are files in
460
- `@openreceive/provider-data`, and outside Vite/Rollup (esbuild, webpack, a
461
- plain script tag) they cannot resolve their own URLs — the drop-in needs this
462
- exactly as a custom UI does. Serve that package's `dist/assets` tree and pass
463
- the base as `assetBaseUrl="/openreceive-assets"`
469
+ Everything the checkout draws ships inside the JavaScript: the payment-method
470
+ icons, the wallet logos and the pay tutorials. There is no image file to copy
471
+ or serve and no asset option to set. Deploy your normal JavaScript and CSS
472
+ build output, including any generated JavaScript chunks. Bundlers with code
473
+ splitting can defer tutorial screenshots until first open; single-file builds
474
+ (including the standalone checkout) include them upfront. If your
475
+ Content-Security-Policy has a strict `img-src`, allow `data:`
464
476
  ([Provider registry](https://openreceive.org/guides/provider-registry.md#assets)).
465
477
 
466
478
  That is the whole loop: your server owns the price and the order, the payer gets
@@ -484,3 +496,10 @@ and probes the wallet relay to confirm the code is receive-only. Add
484
496
  `--url http://localhost:3000` to confirm the routes are mounted; every failing
485
497
  line states its own fix.
486
498
  → [openreceive doctor](https://openreceive.org/guides/api-reference.md#openreceive-doctor)
499
+
500
+ Then open the checkout in a browser, confirm the payment-method icons and
501
+ wallet logos render, and open a wallet's pay tutorial to check its screenshots.
502
+ If an image is missing, inspect the console for CSP violations and the Network
503
+ panel for failed JavaScript chunks. Allow `data:` in `img-src` and deploy the
504
+ complete build output. Do not add image routes, copy package source images, or
505
+ use registry `icon_path` / tutorial `path` keys as browser URLs.