openreceive-server 0.2.3 → 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 +4 -4
- data/CHANGELOG.md +27 -0
- data/lib/openreceive/server/request_handler.rb +20 -2
- data/lib/openreceive/server/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 709f10b4ec4f14ebd43b63977d10ea992365c3329e81b5eb1ebe02b004dce2db
|
|
4
|
+
data.tar.gz: 8ed1bc203385cbd35f7f6d1a4b45a1ed5846723ebb70a2cad7651c56c8111ed7
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d791c3f1c8b0d0f53f7cb44e7cf810fd5c6854efc1b43aa852a27057cd1744845c4ca6ecd99b9ab6025b3e68c5dc75003aecad87db155521794524d16443d727
|
|
7
|
+
data.tar.gz: 3066169a2f8e2f2ff0c891976763d148d83d9f6790bb1356a9ceaad534f2ac14f39d04d98b1f9279a1ce5acd67ba668e828ab17ff0060c4dd47d523404e5d317
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,32 @@
|
|
|
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
|
+
|
|
3
30
|
## 0.2.3 - 2026-08-25
|
|
4
31
|
|
|
5
32
|
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
|
-
|
|
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
|
-
|
|
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?
|
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.
|
|
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.
|
|
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.
|
|
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
|