openreceive-server 0.2.3 → 0.3.1

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: 6787423e982a56751f291210d207d6ff4c0ccd49eb438f087cc749e35b9eaae6
4
- data.tar.gz: 73d06359d629e52245de41c2e6fca1068765572325bc9250acd61499904c13e1
3
+ metadata.gz: d476e033b4974c2349800f3a8aae6b3a097027b912b208dfeffd7a79e9a19b0f
4
+ data.tar.gz: e6a8d6732c35b93f6414d85c0aec841cc81d400c187c0d7fa50cab817a675614
5
5
  SHA512:
6
- metadata.gz: aa11b53030d9c8c91ab02f39ebd25c57709c540ce351b2a09dc864260d7868bda54f38f99229c374d910e6624eb4d53fb007bdfc91bd364427b15c51513c3dfd
7
- data.tar.gz: c88b8c1e9576e841b8be7013e78592c25821a76ae97a2fc145f7b8adc555571b1e1b63b5f1d8b3c8d8cfad7869d44a75faf2720834c74a3badbcc3406d85db33
6
+ metadata.gz: 1e86a0afe927a1d99b70f1e1b59c92f1b89622353796f5e0b8a59a5e874eb31e55aa8d2517a17e63d6cb00d167b7e0819f4a2364f10b1668660db36342a0cd55
7
+ data.tar.gz: 3f00557f4b1aaf1593d3f0ac39d69a35c81c318f80f9e98657d6661bd2e39bcaf047c2dc7bbf7d2d0fcb608e20524eb0bd6a593bd658adf63043197f10d7ac9c
data/CHANGELOG.md CHANGED
@@ -1,5 +1,39 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.3.1 - 2026-08-28
4
+
5
+ No changes to this gem in 0.3.1. It is byte-identical to 0.3.0 and ships to keep
6
+ the one-version-for-everything rule. The Ruby half of this release is in
7
+ `openreceive-rails`. The full release narrative lives in the repository-root
8
+ [CHANGELOG](https://github.com/openreceive/openreceive/blob/master/CHANGELOG.md).
9
+
10
+ ## 0.3.0 - 2026-08-26
11
+
12
+ ### The order description rides the prepare and create responses
13
+
14
+ What the payer is BUYING, in the host's own words. When the resolver answers
15
+ with a `description` beside the amount, the handler echoes it on
16
+ `POST /checkouts/prepare` and on `POST /checkouts` — as a SIBLING of `checkout`,
17
+ not a field inside it, because the `Checkout` object is shared with the swap
18
+ responses. It is never read from a request body: the payer does not write the
19
+ copy next to the amount. Blank and non-string values are treated as absent.
20
+
21
+ Golden vectors 16 and 17 pin both responses, so the Ruby and JavaScript engines
22
+ cannot drift on the shape.
23
+
24
+ The full release narrative lives in the repository-root
25
+ [CHANGELOG](https://github.com/openreceive/openreceive/blob/master/CHANGELOG.md).
26
+
27
+ ## 0.2.4 - 2026-08-26
28
+
29
+ No Ruby changes in this release. 0.2.4 is browser-side only —
30
+ `@openreceive/browser`, `@openreceive/elements`, `@openreceive/react` and
31
+ `@openreceive/provider-data`. This gem is byte-identical to 0.2.3 and ships to
32
+ keep the one-version-for-everything rule, so the engine, the HTTP contract and
33
+ the settlement path are unchanged. The full release narrative lives in the
34
+ repository-root
35
+ [CHANGELOG](https://github.com/openreceive/openreceive/blob/master/CHANGELOG.md).
36
+
3
37
  ## 0.2.3 - 2026-08-25
4
38
 
5
39
  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
 
@@ -80,7 +83,10 @@ module OpenReceive
80
83
  # committed invoice amount — and served on the re-fetch path too, so
81
84
  # a repeated create answers with the same shape it first did.
82
85
  payment_methods = @service.list_swap_options(amount_msats: checkout["amount_msats"])
83
- success(201, { "checkout" => checkout, "payment_methods" => payment_methods }, request_id)
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)
84
90
  end
85
91
  end
86
92
 
@@ -522,6 +528,18 @@ module OpenReceive
522
528
  memo
523
529
  end
524
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
+
525
543
  def required_amount(resolved)
526
544
  amount = resolved["amount"]
527
545
  if amount.nil?
@@ -2,6 +2,6 @@
2
2
 
3
3
  module OpenReceive
4
4
  module Server
5
- VERSION = "0.2.3"
5
+ VERSION = "0.3.1"
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.3
4
+ version: 0.3.1
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.3
18
+ version: 0.3.1
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.3
25
+ version: 0.3.1
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