openreceive 0.4.10 → 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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +17 -0
- data/lib/openreceive/core.rb +30 -5
- data/lib/openreceive/nwc_ruby.rb +13 -1
- data/lib/openreceive/version.rb +1 -1
- data/skills/integrate-openreceive/references/btcpay.md +6 -4
- data/skills/integrate-openreceive/references/django.md +5 -3
- data/skills/integrate-openreceive/references/fastapi.md +6 -4
- data/skills/integrate-openreceive/references/fastify.md +6 -4
- data/skills/integrate-openreceive/references/laravel.md +5 -3
- data/skills/integrate-openreceive/references/next.md +6 -4
- data/skills/integrate-openreceive/references/node.md +6 -4
- data/skills/integrate-openreceive/references/php.md +5 -3
- data/skills/integrate-openreceive/references/rails.md +5 -3
- data/skills/integrate-openreceive/references/woocommerce.md +3 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: aee376cce5e82f9c6ae2ee504114fa40d2995777e7086dac85e0680090c3d8d8
|
|
4
|
+
data.tar.gz: 9f110e0321f717f63f1bd8680a7d541288022dc9d0635141c6b9ad2a5ee45fa4
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 8e66dba7f7fad1c0ef978822f8d1780bc16bfe7af21d848a16e61744e7c2bc48b62829f0398842baa86d7e046f4c0a91c57e6ce8a9ade61b2ba4c356acf4f025
|
|
7
|
+
data.tar.gz: c32ecc88207d4b80cb582ef7f810efd7e31872e4bc7ef5278920116206057ffcf69cc4acaa0af72425044aabc05653635671baa0d04cde460d3a7ff6419596c0
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.4.11 - 2026-09-21
|
|
4
|
+
|
|
5
|
+
Wallet history scans stop trusting a page's usable length. A page the wallet
|
|
6
|
+
sent full but that lost a malformed row to normalization no longer reads as
|
|
7
|
+
the end of the history, the skipped-row count survives a second normalization
|
|
8
|
+
(the walk normalizes a page the client already normalized), and the offset
|
|
9
|
+
advances by the rows the wallet actually sent. A non-object transaction row is
|
|
10
|
+
now a skipped row rather than a normalization crash. Two new cases in
|
|
11
|
+
`spec/test-vectors/wallet-scan-truncation.json` cover both shapes.
|
|
12
|
+
|
|
13
|
+
Normalized wallet errors are redacted: `nostr+walletconnect:` and
|
|
14
|
+
`lightning+swapconnect:` URIs and `key=`/`token=`/`preimage=`-style parameters
|
|
15
|
+
never survive into a message, and `redact_secrets` is available for diagnostic
|
|
16
|
+
payloads. The nwc-ruby adapter enforces a scan deadline inside the wallet
|
|
17
|
+
request itself (`_deadline`), bounding only wallet I/O — no database
|
|
18
|
+
transaction or fulfillment callback is interrupted.
|
|
19
|
+
|
|
3
20
|
## 0.4.10 - 2026-09-16
|
|
4
21
|
|
|
5
22
|
Release in lockstep with the 0.4.10 stablecoin checkout fix. The shared
|
data/lib/openreceive/core.rb
CHANGED
|
@@ -185,9 +185,13 @@ module OpenReceive
|
|
|
185
185
|
# settle nor close pending attempts (a permanent livelock while the bad
|
|
186
186
|
# row stays inside the scan window). Bad rows are skipped and counted.
|
|
187
187
|
# Mirrors the JS normalizeListTransactionsResult policy.
|
|
188
|
+
# A page a client already normalized arrives with its count: the wallet
|
|
189
|
+
# walk normalizes again, and must still see how many rows the wallet sent.
|
|
188
190
|
transactions = []
|
|
189
|
-
skipped_rows = 0
|
|
191
|
+
skipped_rows = data["skipped_rows"].is_a?(Integer) ? data["skipped_rows"] : 0
|
|
190
192
|
rows.each do |row|
|
|
193
|
+
raise ArgumentError, "non-object transaction row" unless row.respond_to?(:each_pair)
|
|
194
|
+
|
|
191
195
|
transactions << normalize_transaction(row)
|
|
192
196
|
rescue StandardError
|
|
193
197
|
skipped_rows += 1
|
|
@@ -357,6 +361,23 @@ module OpenReceive
|
|
|
357
361
|
# Normalize any wallet/library failure into the canonical error body shape
|
|
358
362
|
# shared with JS (spec/test-vectors/error-normalization.json):
|
|
359
363
|
# { "code", "message", "retryable", "request_id"?, "details"? }.
|
|
364
|
+
def redact_error_text(value)
|
|
365
|
+
value.to_s.gsub(/nostr\+walletconnect:[^\s"'`<>]+/i, "[REDACTED_NWC]")
|
|
366
|
+
.gsub(/lightning\+swapconnect:[^\s"'`<>]+/i, "[REDACTED_LSC]")
|
|
367
|
+
.gsub(/((?:key|secret|client_secret|provider_token|api_key|apikey|token|preimage)=)[^&\s"'<>]+/i, '\\1[REDACTED]')
|
|
368
|
+
end
|
|
369
|
+
|
|
370
|
+
def redact_secrets(value)
|
|
371
|
+
case value
|
|
372
|
+
when String then redact_error_text(value)
|
|
373
|
+
when Array then value.map { |item| redact_secrets(item) }
|
|
374
|
+
when Hash
|
|
375
|
+
sensitive = %w[secret clientsecret providertoken apikey key token preimage invoice bolt11 swapdata authorization password nwc nwcuri lscuri]
|
|
376
|
+
value.to_h { |key, item| [key, sensitive.include?(key.to_s.downcase.gsub(/[^a-z0-9]/, "")) ? "[REDACTED]" : redact_secrets(item)] }
|
|
377
|
+
else value
|
|
378
|
+
end
|
|
379
|
+
end
|
|
380
|
+
|
|
360
381
|
def normalize_wallet_error(raw)
|
|
361
382
|
records = collect_error_records(raw)
|
|
362
383
|
code = error_code_from_records(records) ||
|
|
@@ -364,7 +385,7 @@ module OpenReceive
|
|
|
364
385
|
"OTHER"
|
|
365
386
|
{
|
|
366
387
|
"code" => code,
|
|
367
|
-
"message" => error_message_from(records, raw, code),
|
|
388
|
+
"message" => redact_error_text(error_message_from(records, raw, code)),
|
|
368
389
|
"retryable" => first_boolean(records, "retryable") { RETRYABLE_ERROR_CODES.include?(code) },
|
|
369
390
|
"request_id" => first_string(records, %w[request_id requestId]),
|
|
370
391
|
"details" => records.filter_map { |record| record["details"] if record["details"].is_a?(Hash) }.first
|
|
@@ -496,7 +517,8 @@ module OpenReceive
|
|
|
496
517
|
request["unpaid"] = true if include_unpaid
|
|
497
518
|
request["from"] = scan_from unless scan_from.nil?
|
|
498
519
|
request["until"] = scan_until unless scan_until.nil?
|
|
499
|
-
|
|
520
|
+
response = Nwc.normalize_list_transactions_response(client.list_transactions(request))
|
|
521
|
+
page = response.fetch("transactions")
|
|
500
522
|
page.each do |row|
|
|
501
523
|
next unless row["type"].nil? || row["type"] == "incoming"
|
|
502
524
|
payment_hash = row_payment_hash(row)
|
|
@@ -504,7 +526,10 @@ module OpenReceive
|
|
|
504
526
|
rows[payment_hash] = row
|
|
505
527
|
outstanding.delete(payment_hash)
|
|
506
528
|
end
|
|
507
|
-
|
|
529
|
+
# The wallet ran out of rows only when the page IT sent was short: a
|
|
530
|
+
# row the normalizer dropped was still a row, and a full page with one
|
|
531
|
+
# of them dropped must not read as the end of the history.
|
|
532
|
+
if outstanding.empty? || page.length + response.fetch("skipped_rows", 0) == 0
|
|
508
533
|
truncated = false
|
|
509
534
|
break
|
|
510
535
|
end
|
|
@@ -513,7 +538,7 @@ module OpenReceive
|
|
|
513
538
|
page_key = page.map { |row| row["payment_hash"].to_s }.join(",")
|
|
514
539
|
break if page_key == previous_page
|
|
515
540
|
previous_page = page_key
|
|
516
|
-
offset +=
|
|
541
|
+
offset += page.length + response.fetch("skipped_rows", 0)
|
|
517
542
|
end
|
|
518
543
|
{ rows: rows, truncated: truncated }
|
|
519
544
|
end
|
data/lib/openreceive/nwc_ruby.rb
CHANGED
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
# `openreceive` umbrella, which loads this adapter — carries everything the
|
|
7
7
|
# adapter calls, so requiring this file directly keeps working.
|
|
8
8
|
require_relative "core"
|
|
9
|
+
require "timeout"
|
|
9
10
|
|
|
10
11
|
module OpenReceive
|
|
11
12
|
# Thin adapter binding the engine to the nwc-ruby gem (NwcRuby::Client).
|
|
@@ -29,7 +30,18 @@ module OpenReceive
|
|
|
29
30
|
def list_transactions(request)
|
|
30
31
|
params = symbolize_keys(OpenReceive.list_transactions_nip47_request(request))
|
|
31
32
|
params[:until_ts] = params.delete(:until) if params.key?(:until)
|
|
32
|
-
|
|
33
|
+
deadline = request["_deadline"]
|
|
34
|
+
response = if deadline.nil?
|
|
35
|
+
@client.list_transactions(**params)
|
|
36
|
+
else
|
|
37
|
+
remaining = deadline - Process.clock_gettime(Process::CLOCK_MONOTONIC)
|
|
38
|
+
raise Timeout::Error, "Wallet history scan deadline exceeded." unless remaining.positive?
|
|
39
|
+
|
|
40
|
+
# Bound only wallet I/O. The gem closes its per-call socket in
|
|
41
|
+
# ensure; no database transaction or fulfillment is interrupted.
|
|
42
|
+
Timeout.timeout(remaining) { @client.list_transactions(**params) }
|
|
43
|
+
end
|
|
44
|
+
OpenReceive.normalize_list_transactions_response(response)
|
|
33
45
|
end
|
|
34
46
|
|
|
35
47
|
def preflight
|
data/lib/openreceive/version.rb
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# OpenReceive agent directions (BTCPay Server)
|
|
2
2
|
|
|
3
|
-
These directions describe OpenReceive 0.4.
|
|
3
|
+
These directions describe OpenReceive 0.4.11.
|
|
4
4
|
|
|
5
5
|
Connect a BTCPay Server store to a receive-only NWC wallet with the OpenReceive
|
|
6
6
|
plugin, and optionally let payers pay BTCPay invoices with USDT, USDC, ETH or
|
|
@@ -119,6 +119,8 @@ enough; drop the `.md` for the same page a person would read.
|
|
|
119
119
|
Questions, or a problem with the plugin itself:
|
|
120
120
|
https://openreceive.org/contact
|
|
121
121
|
|
|
122
|
+
- https://openreceive.org/guides/payment-safety-upgrade.md — coordinated upgrades and reviewed repair of existing attempts
|
|
123
|
+
|
|
122
124
|
---
|
|
123
125
|
|
|
124
126
|
## The quickstart, in full
|
|
@@ -157,9 +159,9 @@ invoices, checkout, webhooks and Greenfield API are the host.
|
|
|
157
159
|
|
|
158
160
|
In BTCPay, open **Server Settings → Plugins**, search the plugin directory
|
|
159
161
|
for **OpenReceive**, click **Install**, and restart BTCPay when prompted.
|
|
160
|
-
BTCPay creates the plugin's
|
|
161
|
-
`BTCPayServer.Plugins.OpenReceive`) in its own
|
|
162
|
-
else is created.
|
|
162
|
+
BTCPay creates the plugin's two tables (`openreceive_invoices` and
|
|
163
|
+
`openreceive_swaps`, schema `BTCPayServer.Plugins.OpenReceive`) in its own
|
|
164
|
+
Postgres at startup; nothing else is created.
|
|
163
165
|
|
|
164
166
|
To build the plugin from source instead, follow
|
|
165
167
|
[the .NET workspace README](https://github.com/OpenReceive/openreceive/blob/master/packages/dotnet/README.md).
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# OpenReceive agent directions (Django)
|
|
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 Django project — the app you are already working in. You
|
|
6
6
|
do not need a copy of the OpenReceive source: the Python package is on PyPI
|
|
@@ -130,7 +130,7 @@ itself, and they hold for every integration.
|
|
|
130
130
|
a placeholder that allows everything (`manage.py check` warns
|
|
131
131
|
`openreceive.W002` while it is set) — replace it with this app's real
|
|
132
132
|
ownership check, same as `on_paid`.
|
|
133
|
-
- `on_paid` must be idempotent.
|
|
133
|
+
- `on_paid` must be idempotent. Its database fulfillment commits once per `reference` — your order
|
|
134
134
|
id, one per thing you fulfill, created before checkout, kept across retries,
|
|
135
135
|
never reused. A fresh id per page load lets one order be paid twice.
|
|
136
136
|
- Receive-only NWC is required; a spend-capable code fails closed at boot unless
|
|
@@ -307,6 +307,8 @@ enough; drop the `.md` for the same page a person would read.
|
|
|
307
307
|
Questions, or a problem with the library itself:
|
|
308
308
|
https://openreceive.org/contact
|
|
309
309
|
|
|
310
|
+
- https://openreceive.org/guides/payment-safety-upgrade.md — coordinated upgrades and reviewed repair of existing attempts
|
|
311
|
+
|
|
310
312
|
---
|
|
311
313
|
|
|
312
314
|
## The quickstart, in full
|
|
@@ -480,7 +482,7 @@ The host class needs three things: authorization, the trusted price, and
|
|
|
480
482
|
fulfillment. All three receive the `reference` — a string you choose, and the
|
|
481
483
|
fulfillment identity: your order id, one per thing you fulfill, created before
|
|
482
484
|
checkout, kept across retries, never reused. OpenReceive never looks inside
|
|
483
|
-
it, but `on_paid`
|
|
485
|
+
it, but `on_paid` commits fulfillment once per reference, a new checkout under a reference
|
|
484
486
|
that already settled is refused with 409, and a fresh id per page load lets
|
|
485
487
|
one order be paid twice.
|
|
486
488
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# OpenReceive agent directions (FastAPI)
|
|
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 FastAPI application — the app you are already working in.
|
|
6
6
|
You do not need a copy of the OpenReceive source: the engine is on PyPI
|
|
@@ -116,7 +116,7 @@ itself, and they hold for every integration.
|
|
|
116
116
|
- `authorize` runs on every request, and the `resource` it receives is a CLAIM
|
|
117
117
|
the payer made, not proof. Read the Starlette request's session, cookie or
|
|
118
118
|
auth dependency; never trust a body field.
|
|
119
|
-
- `on_paid` must be idempotent.
|
|
119
|
+
- `on_paid` must be idempotent. Its database fulfillment commits once per `reference` — your order id, one
|
|
120
120
|
per thing you fulfill, created before checkout, kept across retries, never
|
|
121
121
|
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
|
|
@@ -301,6 +301,8 @@ enough; drop the `.md` for the same page a person would read.
|
|
|
301
301
|
Questions, or a problem with the library itself:
|
|
302
302
|
https://openreceive.org/contact
|
|
303
303
|
|
|
304
|
+
- https://openreceive.org/guides/payment-safety-upgrade.md — coordinated upgrades and reviewed repair of existing attempts
|
|
305
|
+
|
|
304
306
|
---
|
|
305
307
|
|
|
306
308
|
## The quickstart, in full
|
|
@@ -475,7 +477,7 @@ the `reference`. OpenReceive never prices from payer input.
|
|
|
475
477
|
The `reference` is a string you choose, and it is the fulfillment identity:
|
|
476
478
|
your order id — one per thing you fulfill, created before checkout, kept
|
|
477
479
|
across retries, never reused. OpenReceive never looks inside it, but `on_paid`
|
|
478
|
-
|
|
480
|
+
commits fulfillment once per reference, a new checkout under a reference that already
|
|
479
481
|
settled is refused with 409, and a fresh id per page load lets one order be
|
|
480
482
|
paid twice.
|
|
481
483
|
|
|
@@ -524,7 +526,7 @@ Content-Security-Policy has a strict `img-src`, allow `data:`
|
|
|
524
526
|
([Provider registry](https://openreceive.org/guides/provider-registry.md#assets)).
|
|
525
527
|
|
|
526
528
|
That is the whole loop: your server owns the price and the order, the payer gets
|
|
527
|
-
an invoice, and `onPaid` runs
|
|
529
|
+
an invoice, and `onPaid` runs inside the settlement transaction. Rolled-back transactions may retry the callback; use a host outbox for external delivery.
|
|
528
530
|
|
|
529
531
|
A page without a bundler renders the same checkout as a custom element:
|
|
530
532
|
`<openreceive-checkout reference="…" prefix="/openreceive">` from
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# OpenReceive agent directions (Fastify)
|
|
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 Fastify application — the app you are already working in.
|
|
6
6
|
You do not need a copy of the OpenReceive source: the packages are on npm, and
|
|
@@ -107,7 +107,7 @@ itself, and they hold for every integration.
|
|
|
107
107
|
payer-supplied amounts.
|
|
108
108
|
- `authorize` runs on every request, and the `resource` it receives is a CLAIM
|
|
109
109
|
the payer made, not proof. Read a framework session; never trust a body field.
|
|
110
|
-
- `onPaid` must be idempotent.
|
|
110
|
+
- `onPaid` must be idempotent. Its database fulfillment commits once per `reference` — your order id, one
|
|
111
111
|
per thing you fulfill, created before checkout, kept across retries, never
|
|
112
112
|
reused. A fresh id per page load lets one order be paid twice.
|
|
113
113
|
- Receive-only NWC is required; a spend-capable code fails closed at boot unless
|
|
@@ -284,6 +284,8 @@ enough; drop the `.md` for the same page a person would read.
|
|
|
284
284
|
Questions, or a problem with the library itself:
|
|
285
285
|
https://openreceive.org/contact
|
|
286
286
|
|
|
287
|
+
- https://openreceive.org/guides/payment-safety-upgrade.md — coordinated upgrades and reviewed repair of existing attempts
|
|
288
|
+
|
|
287
289
|
---
|
|
288
290
|
|
|
289
291
|
## The quickstart, in full
|
|
@@ -477,7 +479,7 @@ the `reference`. OpenReceive never prices from payer input.
|
|
|
477
479
|
The `reference` is a string you choose, and it is the fulfillment identity:
|
|
478
480
|
your order id — one per thing you fulfill, created before checkout, kept
|
|
479
481
|
across retries, never reused. OpenReceive never looks inside it, but `onPaid`
|
|
480
|
-
|
|
482
|
+
commits fulfillment once per reference, a new checkout under a reference that already
|
|
481
483
|
settled is refused with 409, and a fresh id per page load lets one order be
|
|
482
484
|
paid twice.
|
|
483
485
|
|
|
@@ -526,7 +528,7 @@ Content-Security-Policy has a strict `img-src`, allow `data:`
|
|
|
526
528
|
([Provider registry](https://openreceive.org/guides/provider-registry.md#assets)).
|
|
527
529
|
|
|
528
530
|
That is the whole loop: your server owns the price and the order, the payer gets
|
|
529
|
-
an invoice, and `onPaid` runs
|
|
531
|
+
an invoice, and `onPaid` runs inside the settlement transaction. Rolled-back transactions may retry the callback; use a host outbox for external delivery.
|
|
530
532
|
|
|
531
533
|
A runnable illustration of this boundary — not a template to copy models from —
|
|
532
534
|
is Buy a Button
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# OpenReceive agent directions (Laravel)
|
|
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 Laravel application — the app you are already working in.
|
|
6
6
|
You do not need a copy of the OpenReceive source: the package is on Packagist
|
|
@@ -121,7 +121,7 @@ itself, and they hold for every integration.
|
|
|
121
121
|
scaffolds `use AllowAllAuthorize;`, a placeholder trait that allows
|
|
122
122
|
everything (the engine warns at boot while it is there) — replace it with
|
|
123
123
|
this app's real ownership check, same as `onPaid`.
|
|
124
|
-
- `onPaid` must be idempotent.
|
|
124
|
+
- `onPaid` must be idempotent. Its database fulfillment commits once per `reference` — your order
|
|
125
125
|
id, one per thing you fulfill, created before checkout, kept across retries,
|
|
126
126
|
never reused. A fresh id per page load lets one order be paid twice.
|
|
127
127
|
- Receive-only NWC is required; a spend-capable code fails closed at boot unless
|
|
@@ -291,6 +291,8 @@ enough; drop the `.md` for the same page a person would read.
|
|
|
291
291
|
Questions, or a problem with the library itself:
|
|
292
292
|
https://openreceive.org/contact
|
|
293
293
|
|
|
294
|
+
- https://openreceive.org/guides/payment-safety-upgrade.md — coordinated upgrades and reviewed repair of existing attempts
|
|
295
|
+
|
|
294
296
|
---
|
|
295
297
|
|
|
296
298
|
## The quickstart, in full
|
|
@@ -456,7 +458,7 @@ variable as set/unset only.
|
|
|
456
458
|
price, and fulfillment. All three receive the `reference` — a string you
|
|
457
459
|
choose, and the fulfillment identity: your order id, one per thing you
|
|
458
460
|
fulfill, created before checkout, kept across retries, never reused.
|
|
459
|
-
OpenReceive never looks inside it, but `onPaid`
|
|
461
|
+
OpenReceive never looks inside it, but `onPaid` commits fulfillment once per reference, a new
|
|
460
462
|
checkout under a reference that already settled is refused with 409, and a
|
|
461
463
|
fresh id per page load lets one order be paid twice.
|
|
462
464
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# OpenReceive agent directions (Next.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 Next.js App Router application — the app you are already
|
|
6
6
|
working in. You do not need a copy of the OpenReceive source: the packages are
|
|
@@ -109,7 +109,7 @@ itself, and they hold for every integration.
|
|
|
109
109
|
payer-supplied amounts.
|
|
110
110
|
- `authorize` runs on every request, and the `resource` it receives is a CLAIM
|
|
111
111
|
the payer made, not proof. Read a framework session; never trust a body field.
|
|
112
|
-
- `onPaid` must be idempotent.
|
|
112
|
+
- `onPaid` must be idempotent. Its database fulfillment commits once per `reference` — your order id, one
|
|
113
113
|
per thing you fulfill, created before checkout, kept across retries, never
|
|
114
114
|
reused. A fresh id per page load lets one order be paid twice.
|
|
115
115
|
- Receive-only NWC is required; a spend-capable code fails closed at boot unless
|
|
@@ -290,6 +290,8 @@ enough; drop the `.md` for the same page a person would read.
|
|
|
290
290
|
Questions, or a problem with the library itself:
|
|
291
291
|
https://openreceive.org/contact
|
|
292
292
|
|
|
293
|
+
- https://openreceive.org/guides/payment-safety-upgrade.md — coordinated upgrades and reviewed repair of existing attempts
|
|
294
|
+
|
|
293
295
|
---
|
|
294
296
|
|
|
295
297
|
## The quickstart, in full
|
|
@@ -496,7 +498,7 @@ the `reference`. OpenReceive never prices from payer input.
|
|
|
496
498
|
The `reference` is a string you choose, and it is the fulfillment identity:
|
|
497
499
|
your order id — one per thing you fulfill, created before checkout, kept
|
|
498
500
|
across retries, never reused. OpenReceive never looks inside it, but `onPaid`
|
|
499
|
-
|
|
501
|
+
commits fulfillment once per reference, a new checkout under a reference that already
|
|
500
502
|
settled is refused with 409, and a fresh id per page load lets one order be
|
|
501
503
|
paid twice.
|
|
502
504
|
|
|
@@ -576,7 +578,7 @@ Content-Security-Policy has a strict `img-src`, allow `data:`
|
|
|
576
578
|
([Provider registry](https://openreceive.org/guides/provider-registry.md#assets)).
|
|
577
579
|
|
|
578
580
|
That is the whole loop: your server owns the price and the order, the payer gets
|
|
579
|
-
an invoice, and `onPaid` runs
|
|
581
|
+
an invoice, and `onPaid` runs inside the settlement transaction. Rolled-back transactions may retry the callback; use a host outbox for external delivery.
|
|
580
582
|
|
|
581
583
|
A runnable illustration of this boundary — not a template to copy models from —
|
|
582
584
|
is Buy a Button
|
|
@@ -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
|
|
@@ -276,6 +276,8 @@ enough; drop the `.md` for the same page a person would read.
|
|
|
276
276
|
Questions, or a problem with the library itself:
|
|
277
277
|
https://openreceive.org/contact
|
|
278
278
|
|
|
279
|
+
- https://openreceive.org/guides/payment-safety-upgrade.md — coordinated upgrades and reviewed repair of existing attempts
|
|
280
|
+
|
|
279
281
|
---
|
|
280
282
|
|
|
281
283
|
## The quickstart, in full
|
|
@@ -454,7 +456,7 @@ the `reference`. OpenReceive never prices from payer input.
|
|
|
454
456
|
The `reference` is a string you choose, and it is the fulfillment identity:
|
|
455
457
|
your order id — one per thing you fulfill, created before checkout, kept
|
|
456
458
|
across retries, never reused. OpenReceive never looks inside it, but `onPaid`
|
|
457
|
-
|
|
459
|
+
commits fulfillment once per reference, a new checkout under a reference that already
|
|
458
460
|
settled is refused with 409, and a fresh id per page load lets one order be
|
|
459
461
|
paid twice.
|
|
460
462
|
|
|
@@ -503,7 +505,7 @@ Content-Security-Policy has a strict `img-src`, allow `data:`
|
|
|
503
505
|
([Provider registry](https://openreceive.org/guides/provider-registry.md#assets)).
|
|
504
506
|
|
|
505
507
|
That is the whole loop: your server owns the price and the order, the payer gets
|
|
506
|
-
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.
|
|
507
509
|
|
|
508
510
|
A runnable illustration of this boundary — not a template to copy models from —
|
|
509
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
|
|
@@ -301,6 +301,8 @@ enough; drop the `.md` for the same page a person would read.
|
|
|
301
301
|
Questions, or a problem with the library itself:
|
|
302
302
|
https://openreceive.org/contact
|
|
303
303
|
|
|
304
|
+
- https://openreceive.org/guides/payment-safety-upgrade.md — coordinated upgrades and reviewed repair of existing attempts
|
|
305
|
+
|
|
304
306
|
---
|
|
305
307
|
|
|
306
308
|
## The quickstart, in full
|
|
@@ -512,7 +514,7 @@ prices with exact decimal math, and returns the order id the page will pass as
|
|
|
512
514
|
the `reference`. OpenReceive never prices from payer input. The `reference` is
|
|
513
515
|
a string you choose, and it is the fulfillment identity: your order id — one
|
|
514
516
|
per thing you fulfill, created before checkout, kept across retries, never
|
|
515
|
-
reused. `onPaid`
|
|
517
|
+
reused. `onPaid` commits fulfillment once per reference, a new checkout under a reference
|
|
516
518
|
that already settled is refused with 409, and a fresh id per page load lets
|
|
517
519
|
one order be paid twice.
|
|
518
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
|
|
@@ -285,6 +285,8 @@ enough; drop the `.md` for the same page a person would read.
|
|
|
285
285
|
Questions, or a problem with the library itself:
|
|
286
286
|
https://openreceive.org/contact
|
|
287
287
|
|
|
288
|
+
- https://openreceive.org/guides/payment-safety-upgrade.md — coordinated upgrades and reviewed repair of existing attempts
|
|
289
|
+
|
|
288
290
|
---
|
|
289
291
|
|
|
290
292
|
## The quickstart, in full
|
|
@@ -432,7 +434,7 @@ The initializer needs three things: authorization, the trusted price, and
|
|
|
432
434
|
fulfillment. All three receive the `reference` — a string you choose, and the
|
|
433
435
|
fulfillment identity: your order id, one per thing you fulfill, created before
|
|
434
436
|
checkout, kept across retries, never reused. OpenReceive never looks inside
|
|
435
|
-
it, but `on_paid`
|
|
437
|
+
it, but `on_paid` commits fulfillment once per reference, a new checkout under a reference
|
|
436
438
|
that already settled is refused with 409, and a fresh id per page load lets
|
|
437
439
|
one order be paid twice.
|
|
438
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
|