openreceive-server 0.2.2 → 0.3.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fab55d2a945025a4385ca22446b7294709abfbd114fe8c096fbd78f6a6c05412
4
- data.tar.gz: 82e04197ecfa6c41b41e2254454319bc1010af1dbb3b037cd625a68fbda9e852
3
+ metadata.gz: 709f10b4ec4f14ebd43b63977d10ea992365c3329e81b5eb1ebe02b004dce2db
4
+ data.tar.gz: 8ed1bc203385cbd35f7f6d1a4b45a1ed5846723ebb70a2cad7651c56c8111ed7
5
5
  SHA512:
6
- metadata.gz: 7cb275bc3fb480877c2896e6ccee09b08ced3646253e2b7e300213727596aee0cfb85b81e4b9839359c5aace091d95c46ba66211ea62176ce5eb4bb0c9266072
7
- data.tar.gz: 9ef8d4268b7a0698e6fb773f1fe96ee1b0f93a264986975ff76ef50223407a15ae57a7aae7d64225b224dca4b46595a6e99f674f43ef67d6072eed1585c21422
6
+ metadata.gz: d791c3f1c8b0d0f53f7cb44e7cf810fd5c6854efc1b43aa852a27057cd1744845c4ca6ecd99b9ab6025b3e68c5dc75003aecad87db155521794524d16443d727
7
+ data.tar.gz: 3066169a2f8e2f2ff0c891976763d148d83d9f6790bb1356a9ceaad534f2ac14f39d04d98b1f9279a1ce5acd67ba668e828ab17ff0060c4dd47d523404e5d317
data/CHANGELOG.md CHANGED
@@ -1,5 +1,45 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.3.0 - 2026-08-26
4
+
5
+ ### The order description rides the prepare and create responses
6
+
7
+ What the payer is BUYING, in the host's own words. When the resolver answers
8
+ with a `description` beside the amount, the handler echoes it on
9
+ `POST /checkouts/prepare` and on `POST /checkouts` — as a SIBLING of `checkout`,
10
+ not a field inside it, because the `Checkout` object is shared with the swap
11
+ responses. It is never read from a request body: the payer does not write the
12
+ copy next to the amount. Blank and non-string values are treated as absent.
13
+
14
+ Golden vectors 16 and 17 pin both responses, so the Ruby and JavaScript engines
15
+ cannot drift on the shape.
16
+
17
+ The full release narrative lives in the repository-root
18
+ [CHANGELOG](https://github.com/openreceive/openreceive/blob/master/CHANGELOG.md).
19
+
20
+ ## 0.2.4 - 2026-08-26
21
+
22
+ No Ruby changes in this release. 0.2.4 is browser-side only —
23
+ `@openreceive/browser`, `@openreceive/elements`, `@openreceive/react` and
24
+ `@openreceive/provider-data`. This gem is byte-identical to 0.2.3 and ships to
25
+ keep the one-version-for-everything rule, so the engine, the HTTP contract and
26
+ the settlement path are unchanged. The full release narrative lives in the
27
+ repository-root
28
+ [CHANGELOG](https://github.com/openreceive/openreceive/blob/master/CHANGELOG.md).
29
+
30
+ ## 0.2.3 - 2026-08-25
31
+
32
+ The Ruby gems release in lockstep with the npm workspace version. The full
33
+ release narrative lives in the repository-root
34
+ [CHANGELOG](https://github.com/openreceive/openreceive/blob/master/CHANGELOG.md);
35
+ entries here are scoped to this gem.
36
+
37
+ - **`POST /checkouts` now echoes `payment_methods`** (HTTP contract 0.4.1),
38
+ amount-aware against the minted attempt's own invoice amount and served on
39
+ the re-fetch path too. `prepare` and `payments/check` already did; the mint
40
+ alone did not, so any client without a library-side merge lost its pay-in
41
+ catalog the moment it minted Lightning.
42
+
3
43
  ## 0.2.2 - 2026-08-25
4
44
 
5
45
  The Ruby gems release in lockstep with the npm workspace version. The full
@@ -50,7 +50,10 @@ module OpenReceive
50
50
  guard("checkout.prepare", request, { reference: reference })
51
51
  resolved = resolve_host("checkout.prepare", request, reference, body)
52
52
  prepared = @service.prepare_checkout("amount" => required_amount(resolved))
53
- success(200, prepared.merge("reference" => reference), request_id)
53
+ body = prepared.merge("reference" => reference)
54
+ description = resolved_description(resolved)
55
+ body["description"] = description if description
56
+ success(200, body, request_id)
54
57
  end
55
58
  end
56
59
 
@@ -73,7 +76,17 @@ module OpenReceive
73
76
  )
74
77
  end
75
78
  commit(checkout, nil, request) unless resolved["payment_hash"]
76
- success(201, { "checkout" => checkout }, request_id)
79
+ # The catalog rides along with the mint for the same reason it rides
80
+ # along with prepare and payments/check (mirrors the JS handler): a
81
+ # client that just minted Lightning must not lose the pay-in options
82
+ # it renders its picker from. Amount-aware, against this attempt's
83
+ # committed invoice amount — and served on the re-fetch path too, so
84
+ # a repeated create answers with the same shape it first did.
85
+ payment_methods = @service.list_swap_options(amount_msats: checkout["amount_msats"])
86
+ body = { "checkout" => checkout, "payment_methods" => payment_methods }
87
+ description = resolved_description(resolved)
88
+ body["description"] = description if description
89
+ success(201, body, request_id)
77
90
  end
78
91
  end
79
92
 
@@ -515,6 +528,18 @@ module OpenReceive
515
528
  memo
516
529
  end
517
530
 
531
+ # What the payer is buying, in the host's own words: one optional display
532
+ # string the host returns beside the price. Response only — it is never
533
+ # read from a request body, because the payer does not get to write the
534
+ # copy next to the amount. Blank is the same as absent.
535
+ def resolved_description(resolved)
536
+ value = resolved["description"]
537
+ return nil unless value.is_a?(String)
538
+
539
+ trimmed = value.strip
540
+ trimmed.empty? ? nil : trimmed
541
+ end
542
+
518
543
  def required_amount(resolved)
519
544
  amount = resolved["amount"]
520
545
  if amount.nil?
@@ -2,6 +2,6 @@
2
2
 
3
3
  module OpenReceive
4
4
  module Server
5
- VERSION = "0.2.2"
5
+ VERSION = "0.3.0"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: openreceive-server
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - OpenReceive
@@ -15,14 +15,14 @@ dependencies:
15
15
  requirements:
16
16
  - - '='
17
17
  - !ruby/object:Gem::Version
18
- version: 0.2.2
18
+ version: 0.3.0
19
19
  type: :runtime
20
20
  prerelease: false
21
21
  version_requirements: !ruby/object:Gem::Requirement
22
22
  requirements:
23
23
  - - '='
24
24
  - !ruby/object:Gem::Version
25
- version: 0.2.2
25
+ version: 0.3.0
26
26
  description: 'Server building blocks for OpenReceive: a storage-free Service that
27
27
  mirrors the Node engine and a framework-agnostic Rack app implementing the shipped
28
28
  HTTP routes while the host owns order and payment persistence. Receive-only: it