mpp-rb 0.1.9 → 0.1.10
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/lib/mpp/server/middleware.rb +10 -3
- data/lib/mpp/version.rb +1 -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: 4a9ab53da9713524d119320b1843e58948b433e213e17250cd641e90f4286083
|
|
4
|
+
data.tar.gz: 9ed02c682b99438d702cf231e97e96f0b275e84954785ef9eb2f0750b4a1a7c5
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 12603bd4ec974e488a632ce3ec6d91304e4996bf218cc47638a652c2a096b73aa2124c12242effde8d711f9106e2c4138ee68ca8542c13d9341bcadb2d42b24a
|
|
7
|
+
data.tar.gz: 74a80bdc6320841a891e305ae39838156292a6656ce6d73f48b92283dfd5e639f91e415e631d2cdf4cd4ffb91c6c7871c905e30685380f4a6981f074ee11977b
|
|
@@ -33,8 +33,13 @@ module Mpp
|
|
|
33
33
|
|
|
34
34
|
sig { params(env: T.untyped).returns(T::Array[T.untyped]) }
|
|
35
35
|
def call(env)
|
|
36
|
+
original_input = env["rack.input"]
|
|
37
|
+
body_capture = capture_request_body(env)
|
|
36
38
|
charge_opts = @pricing.call(env)
|
|
37
|
-
|
|
39
|
+
unless charge_opts
|
|
40
|
+
env["rack.input"] = original_input if body_capture && env["rack.input"].equal?(body_capture)
|
|
41
|
+
return @app.call(env)
|
|
42
|
+
end
|
|
38
43
|
|
|
39
44
|
authorization = env["HTTP_AUTHORIZATION"]
|
|
40
45
|
payment_authorization = env["HTTP_PAYMENT_AUTHORIZATION"]
|
|
@@ -42,7 +47,6 @@ module Mpp
|
|
|
42
47
|
accept_payment = env["HTTP_ACCEPT_PAYMENT"]
|
|
43
48
|
http_method = env["REQUEST_METHOD"]
|
|
44
49
|
url = request_url(env)
|
|
45
|
-
body_capture = capture_request_body(env)
|
|
46
50
|
|
|
47
51
|
request_body = body_capture&.materialize
|
|
48
52
|
env["rack.input"] = StringIO.new(request_body || "") if body_capture
|
|
@@ -278,8 +282,11 @@ module Mpp
|
|
|
278
282
|
|
|
279
283
|
sig { returns(T.untyped) }
|
|
280
284
|
def rewind
|
|
281
|
-
|
|
285
|
+
return unless @input.respond_to?(:rewind)
|
|
286
|
+
|
|
287
|
+
result = @input.rewind
|
|
282
288
|
@buffer = +"".b
|
|
289
|
+
result
|
|
283
290
|
end
|
|
284
291
|
|
|
285
292
|
sig { returns(T.untyped) }
|
data/lib/mpp/version.rb
CHANGED