openreceive-server 0.3.1 → 0.3.2
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 +12 -0
- data/lib/openreceive/server/swap/fixedfloat.rb +11 -6
- 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: 69c84c3c9d2c89bf54eb2a69b10560be5f5b51bdadc38fed124d47a43c737bf5
|
|
4
|
+
data.tar.gz: 7bba81aa2ae40c14a41fd8ec713b3aae342f1f87e46be107668c01271dd82997
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 7e57669e81f47d6df8941ba953cdc6791f125bbad010f2e9a3f7cd6968ddb626afeb1d6fd608bdb893573fe0981f0a7d19fe75e0739eef1594cf00cfe319a3af
|
|
7
|
+
data.tar.gz: 62b051babf8198b51de547e7c7535803f0fa658df930efea0e69205c3a3bbef733116681944758780c822a8046c185f5f9782cc80c7abf9dcbf182d5227c915e
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.3.2 - 2026-08-29
|
|
4
|
+
|
|
5
|
+
### An overpaid swap deposit is a refund, not a support ticket
|
|
6
|
+
|
|
7
|
+
`normalize_status` mapped a FixedFloat-compatible `EMERGENCY` carrying `MORE`
|
|
8
|
+
to `attention`, which is terminal and has no refund form. The provider itself
|
|
9
|
+
opens `refund_required` for an overpay and accepts a full `choice=REFUND`, so
|
|
10
|
+
the gem now does the same: `MORE` / `OVER` / `OVERPAID` fall through to
|
|
11
|
+
`refund_required`, and `refund_reason` gains `overpaid` and
|
|
12
|
+
`overpaid_and_late`. The refund returns the whole deposit — the payout is a
|
|
13
|
+
fixed-amount bolt11, so a surplus has nothing to convert into.
|
|
14
|
+
|
|
3
15
|
## 0.3.1 - 2026-08-28
|
|
4
16
|
|
|
5
17
|
No changes to this gem in 0.3.1. It is byte-identical to 0.3.0 and ships to keep
|
|
@@ -642,12 +642,11 @@ module OpenReceive
|
|
|
642
642
|
"attention_reason" => "provider_reported_emergency"
|
|
643
643
|
}
|
|
644
644
|
end
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
end
|
|
645
|
+
# An overpay (MORE) takes the same self-serve full-refund path as
|
|
646
|
+
# LESS and EXPIRED — it is what the provider itself does with it.
|
|
647
|
+
# There is no partial refund of the surplus: the payout invoice is
|
|
648
|
+
# a fixed amount, so an emergency deposit is returned whole or not
|
|
649
|
+
# at all.
|
|
651
650
|
result = { "state" => "refund_required" }
|
|
652
651
|
result["refund_reason"] = refund_reason unless refund_reason.nil?
|
|
653
652
|
return result
|
|
@@ -662,11 +661,17 @@ module OpenReceive
|
|
|
662
661
|
}
|
|
663
662
|
end
|
|
664
663
|
|
|
664
|
+
# LIMIT rides along with LESS/MORE when the deposit fell outside the
|
|
665
|
+
# pair's limits. It says nothing the payer can act on beyond the
|
|
666
|
+
# amount itself, so it names no reason of its own.
|
|
665
667
|
def refund_reason_from_emergency_statuses(statuses)
|
|
666
668
|
less = statuses.include?("LESS")
|
|
669
|
+
more = (statuses & %w[MORE OVER OVERPAID]).any?
|
|
667
670
|
expired = statuses.include?("EXPIRED")
|
|
668
671
|
return "underpaid_and_late" if less && expired
|
|
672
|
+
return "overpaid_and_late" if more && expired
|
|
669
673
|
return "underpaid" if less
|
|
674
|
+
return "overpaid" if more
|
|
670
675
|
return "late_deposit" if expired
|
|
671
676
|
|
|
672
677
|
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.3.
|
|
4
|
+
version: 0.3.2
|
|
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.3.
|
|
18
|
+
version: 0.3.2
|
|
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.3.
|
|
25
|
+
version: 0.3.2
|
|
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
|