@openreceive/browser 0.4.9 → 0.4.11
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.
- package/dist/{chunk-CPVYEWVM.js → chunk-5F7F2ZAM.js} +291 -238
- package/dist/headless.d.ts +14 -3
- package/dist/headless.js +70 -8
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/{status-Doh8Wz4D.d.ts → status-hEzap3jk.d.ts} +8 -4
- package/package.json +3 -3
- package/skills/debug-openreceive-payment/SKILL.md +8 -0
- package/skills/integrate-openreceive/SKILL.md +11 -0
- package/skills/integrate-openreceive/references/btcpay.md +9 -7
- package/skills/integrate-openreceive/references/django.md +12 -3
- package/skills/integrate-openreceive/references/fastapi.md +13 -4
- package/skills/integrate-openreceive/references/fastify.md +13 -4
- package/skills/integrate-openreceive/references/laravel.md +12 -3
- package/skills/integrate-openreceive/references/next.md +13 -4
- package/skills/integrate-openreceive/references/node.md +13 -4
- package/skills/integrate-openreceive/references/php.md +12 -3
- package/skills/integrate-openreceive/references/rails.md +12 -3
- package/skills/integrate-openreceive/references/woocommerce.md +3 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# OpenReceive agent directions (Node.js)
|
|
2
2
|
|
|
3
|
-
These directions describe OpenReceive 0.4.
|
|
3
|
+
These directions describe OpenReceive 0.4.11.
|
|
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
|
|
@@ -104,7 +104,7 @@ itself, and they hold for every integration.
|
|
|
104
104
|
payer-supplied amounts.
|
|
105
105
|
- `authorize` runs on every request, and the `resource` it receives is a CLAIM
|
|
106
106
|
the payer made, not proof. Read a framework session; never trust a body field.
|
|
107
|
-
- `onPaid` must be idempotent.
|
|
107
|
+
- `onPaid` must be idempotent. Its database fulfillment commits once per `reference` — your order id, one
|
|
108
108
|
per thing you fulfill, created before checkout, kept across retries, never
|
|
109
109
|
reused. A fresh id per page load lets one order be paid twice.
|
|
110
110
|
- Receive-only NWC is required; a spend-capable code fails closed at boot unless
|
|
@@ -203,6 +203,13 @@ components.
|
|
|
203
203
|
- `createSwapDisplayModel` → `display.copyRows` for deposits: address, memo,
|
|
204
204
|
and the bare amount each get a copy row. Render `swap.networkWarning*` as
|
|
205
205
|
the model gives it.
|
|
206
|
+
- `swap.deposit_amount` is the only amount a payer is told to send. Never put
|
|
207
|
+
a fiat valuation of it (`swap.fee.pay_in_fiat`) next to a stablecoin amount:
|
|
208
|
+
"$50.03" under "50.05 USDC" reads as a typo, and the payer asks which one to
|
|
209
|
+
send. The one fiat figure on a USDT/USDC deposit panel is the cart total
|
|
210
|
+
(`payout_fiat`); express "you send" and the fee in the token. Use
|
|
211
|
+
`createSwapFeeBreakdown(fee, swap)` — with the swap, not the fee alone — and
|
|
212
|
+
it applies this for you; SOL and ETH keep a fiat breakdown.
|
|
206
213
|
- `createCheckoutSession` owns mint and swap start. To start swaps, pass its
|
|
207
214
|
`swap` option (`selection`, `prefix`, `fetch`) together. Without it
|
|
208
215
|
`startSwap` reports through `onError`.
|
|
@@ -269,6 +276,8 @@ enough; drop the `.md` for the same page a person would read.
|
|
|
269
276
|
Questions, or a problem with the library itself:
|
|
270
277
|
https://openreceive.org/contact
|
|
271
278
|
|
|
279
|
+
- https://openreceive.org/guides/payment-safety-upgrade.md — coordinated upgrades and reviewed repair of existing attempts
|
|
280
|
+
|
|
272
281
|
---
|
|
273
282
|
|
|
274
283
|
## The quickstart, in full
|
|
@@ -447,7 +456,7 @@ the `reference`. OpenReceive never prices from payer input.
|
|
|
447
456
|
The `reference` is a string you choose, and it is the fulfillment identity:
|
|
448
457
|
your order id — one per thing you fulfill, created before checkout, kept
|
|
449
458
|
across retries, never reused. OpenReceive never looks inside it, but `onPaid`
|
|
450
|
-
|
|
459
|
+
commits fulfillment once per reference, a new checkout under a reference that already
|
|
451
460
|
settled is refused with 409, and a fresh id per page load lets one order be
|
|
452
461
|
paid twice.
|
|
453
462
|
|
|
@@ -496,7 +505,7 @@ Content-Security-Policy has a strict `img-src`, allow `data:`
|
|
|
496
505
|
([Provider registry](https://openreceive.org/guides/provider-registry.md#assets)).
|
|
497
506
|
|
|
498
507
|
That is the whole loop: your server owns the price and the order, the payer gets
|
|
499
|
-
an invoice, and `onPaid` runs
|
|
508
|
+
an invoice, and `onPaid` runs inside the settlement transaction. Rolled-back transactions may retry the callback; use a host outbox for external delivery.
|
|
500
509
|
|
|
501
510
|
A runnable illustration of this boundary — not a template to copy models from —
|
|
502
511
|
is Buy a Button
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# OpenReceive agent directions (PHP)
|
|
2
2
|
|
|
3
|
-
These directions describe OpenReceive 0.4.
|
|
3
|
+
These directions describe OpenReceive 0.4.11.
|
|
4
4
|
|
|
5
5
|
Add OpenReceive to a PHP application — the app you are already working in. You
|
|
6
6
|
do not need a copy of the OpenReceive source: the engine is on Packagist
|
|
@@ -125,7 +125,7 @@ itself, and they hold for every integration.
|
|
|
125
125
|
is a placeholder that allows everything (the engine warns at boot while a
|
|
126
126
|
host uses it) — replace it with this app's real ownership check, same as
|
|
127
127
|
`onPaid`'s `Hosts\LoggingOnPaid`.
|
|
128
|
-
- `onPaid` must be idempotent.
|
|
128
|
+
- `onPaid` must be idempotent. Its database fulfillment commits once per `reference` — your order id, one
|
|
129
129
|
per thing you fulfill, created before checkout, kept across retries, never
|
|
130
130
|
reused. A fresh id per page load lets one order be paid twice.
|
|
131
131
|
- Receive-only NWC is required; a spend-capable code fails closed at boot unless
|
|
@@ -229,6 +229,13 @@ of https://openreceive.org/guides/checkout-ux.md, for a UI built on
|
|
|
229
229
|
- `createSwapDisplayModel` → `display.copyRows` for deposits: address, memo,
|
|
230
230
|
and the bare amount each get a copy row. Render `swap.networkWarning*` as
|
|
231
231
|
the model gives it.
|
|
232
|
+
- `swap.deposit_amount` is the only amount a payer is told to send. Never put
|
|
233
|
+
a fiat valuation of it (`swap.fee.pay_in_fiat`) next to a stablecoin amount:
|
|
234
|
+
"$50.03" under "50.05 USDC" reads as a typo, and the payer asks which one to
|
|
235
|
+
send. The one fiat figure on a USDT/USDC deposit panel is the cart total
|
|
236
|
+
(`payout_fiat`); express "you send" and the fee in the token. Use
|
|
237
|
+
`createSwapFeeBreakdown(fee, swap)` — with the swap, not the fee alone — and
|
|
238
|
+
it applies this for you; SOL and ETH keep a fiat breakdown.
|
|
232
239
|
- `createCheckoutSession` owns mint and swap start. To start swaps, pass its
|
|
233
240
|
`swap` option (`selection`, `prefix`, `fetch`) together. Without it
|
|
234
241
|
`startSwap` reports through `onError`.
|
|
@@ -294,6 +301,8 @@ enough; drop the `.md` for the same page a person would read.
|
|
|
294
301
|
Questions, or a problem with the library itself:
|
|
295
302
|
https://openreceive.org/contact
|
|
296
303
|
|
|
304
|
+
- https://openreceive.org/guides/payment-safety-upgrade.md — coordinated upgrades and reviewed repair of existing attempts
|
|
305
|
+
|
|
297
306
|
---
|
|
298
307
|
|
|
299
308
|
## The quickstart, in full
|
|
@@ -505,7 +514,7 @@ prices with exact decimal math, and returns the order id the page will pass as
|
|
|
505
514
|
the `reference`. OpenReceive never prices from payer input. The `reference` is
|
|
506
515
|
a string you choose, and it is the fulfillment identity: your order id — one
|
|
507
516
|
per thing you fulfill, created before checkout, kept across retries, never
|
|
508
|
-
reused. `onPaid`
|
|
517
|
+
reused. `onPaid` commits fulfillment once per reference, a new checkout under a reference
|
|
509
518
|
that already settled is refused with 409, and a fresh id per page load lets
|
|
510
519
|
one order be paid twice.
|
|
511
520
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# OpenReceive agent directions (Rails)
|
|
2
2
|
|
|
3
|
-
These directions describe OpenReceive 0.4.
|
|
3
|
+
These directions describe OpenReceive 0.4.11.
|
|
4
4
|
|
|
5
5
|
Add OpenReceive to a Rails application — the app you are already working in. You
|
|
6
6
|
do not need a copy of the OpenReceive source: the gem is on RubyGems, the
|
|
@@ -116,7 +116,7 @@ itself, and they hold for every integration.
|
|
|
116
116
|
body field. The generator installs `OpenReceive::ALLOW_ALL_AUTHORIZE`, a
|
|
117
117
|
placeholder that allows everything (the engine warns at boot while it is
|
|
118
118
|
set) — replace it with this app's real ownership check, same as `on_paid`.
|
|
119
|
-
- `config.on_paid` must be idempotent.
|
|
119
|
+
- `config.on_paid` must be idempotent. Its database fulfillment commits once per `reference` — your order
|
|
120
120
|
id, one per thing you fulfill, created before checkout, kept across retries,
|
|
121
121
|
never reused. A fresh id per page load lets one order be paid twice.
|
|
122
122
|
- Receive-only NWC is required; a spend-capable code fails closed at boot unless
|
|
@@ -210,6 +210,13 @@ built on `@openreceive/browser/headless`. Read that before writing components.
|
|
|
210
210
|
- `createSwapDisplayModel` → `display.copyRows` for deposits: address, memo,
|
|
211
211
|
and the bare amount each get a copy row. Render `swap.networkWarning*` as
|
|
212
212
|
the model gives it.
|
|
213
|
+
- `swap.deposit_amount` is the only amount a payer is told to send. Never put
|
|
214
|
+
a fiat valuation of it (`swap.fee.pay_in_fiat`) next to a stablecoin amount:
|
|
215
|
+
"$50.03" under "50.05 USDC" reads as a typo, and the payer asks which one to
|
|
216
|
+
send. The one fiat figure on a USDT/USDC deposit panel is the cart total
|
|
217
|
+
(`payout_fiat`); express "you send" and the fee in the token. Use
|
|
218
|
+
`createSwapFeeBreakdown(fee, swap)` — with the swap, not the fee alone — and
|
|
219
|
+
it applies this for you; SOL and ETH keep a fiat breakdown.
|
|
213
220
|
- `createCheckoutSession` owns mint and swap start. To start swaps, pass its
|
|
214
221
|
`swap` option (`selection`, `prefix`, `fetch`) together. Without it
|
|
215
222
|
`startSwap` reports through `onError`.
|
|
@@ -278,6 +285,8 @@ enough; drop the `.md` for the same page a person would read.
|
|
|
278
285
|
Questions, or a problem with the library itself:
|
|
279
286
|
https://openreceive.org/contact
|
|
280
287
|
|
|
288
|
+
- https://openreceive.org/guides/payment-safety-upgrade.md — coordinated upgrades and reviewed repair of existing attempts
|
|
289
|
+
|
|
281
290
|
---
|
|
282
291
|
|
|
283
292
|
## The quickstart, in full
|
|
@@ -425,7 +434,7 @@ The initializer needs three things: authorization, the trusted price, and
|
|
|
425
434
|
fulfillment. All three receive the `reference` — a string you choose, and the
|
|
426
435
|
fulfillment identity: your order id, one per thing you fulfill, created before
|
|
427
436
|
checkout, kept across retries, never reused. OpenReceive never looks inside
|
|
428
|
-
it, but `on_paid`
|
|
437
|
+
it, but `on_paid` commits fulfillment once per reference, a new checkout under a reference
|
|
429
438
|
that already settled is refused with 409, and a fresh id per page load lets
|
|
430
439
|
one order be paid twice.
|
|
431
440
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# OpenReceive agent directions (WordPress + WooCommerce)
|
|
2
2
|
|
|
3
|
-
These directions describe OpenReceive 0.4.
|
|
3
|
+
These directions describe OpenReceive 0.4.11.
|
|
4
4
|
|
|
5
5
|
Install and configure the OpenReceive gateway in the existing WooCommerce
|
|
6
6
|
store. Preserve its theme, checkout, customer accounts, order model and prices.
|
|
@@ -73,6 +73,8 @@ flows; a receive-only NWC wallet cannot send payments.
|
|
|
73
73
|
- [Agent Directions: BTCPay Server](https://openreceive.org/guides/agent-directions-btcpay.md)
|
|
74
74
|
- [WordPress + WooCommerce Quickstart](https://openreceive.org/guides/quickstart-woocommerce.md)
|
|
75
75
|
|
|
76
|
+
- https://openreceive.org/guides/payment-safety-upgrade.md — coordinated upgrades and reviewed repair of existing attempts
|
|
77
|
+
|
|
76
78
|
---
|
|
77
79
|
|
|
78
80
|
## The quickstart, in full
|