comgate_ruby 0.8.2 → 0.8.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/Gemfile.lock +1 -1
- data/lib/comgate/api_caller.rb +3 -2
- data/lib/comgate/gateway.rb +8 -4
- data/lib/comgate/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f70dc5da596b91029a905c8cdb1987b96e805d9d222f54c3a8896947119ca0c8
|
4
|
+
data.tar.gz: 6ffc03ac6e2e119c35bce6aa561bab416c20f63dd8b8748c186969952e3f82ce
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 994a8c9c9450d07e709da2dfe4e7787cffc72e3176b18ec0a1ac8b10718c6b6f9b848fb83e83a28017c5fc06d36ebf87d51b02b8a7720fe7600a2e40cc3fab9d
|
7
|
+
data.tar.gz: 5f512b4a460484552f42304cd539a45dbb233e8c2344f037b8ab5712537e5139f5607293f735e069fb064ca36084b273d199ed10abf9f5e0d1cf4fd9688756e4
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,6 @@
|
|
1
|
+
## [0.8.3] - 2023-06-27
|
2
|
+
- If response from Comgate API is error, but containt "transId" we do not raise exception but pass info up to stack
|
3
|
+
|
1
4
|
## [0.8.2] - 2023-06-20
|
2
5
|
- If ENV["COMGATE_MIN_LOG_LEVEL"] is set, calls and responses to Comgate are logged at that level. Otherwise `:debug` is used.
|
3
6
|
|
data/Gemfile.lock
CHANGED
data/lib/comgate/api_caller.rb
CHANGED
@@ -122,9 +122,10 @@ module Comgate
|
|
122
122
|
def record_api_error
|
123
123
|
return unless api_error?
|
124
124
|
|
125
|
-
|
125
|
+
msg = [result[:response_body]["message"], result[:response_body]["extraMessage"]].compact.join(" ")
|
126
|
+
errors[:api] = ["[Error ##{result[:response_body]["error"]}] #{msg}"]
|
126
127
|
@result[:errors] = { api: { code: result[:response_body]["error"].to_i,
|
127
|
-
message:
|
128
|
+
message: msg } }
|
128
129
|
end
|
129
130
|
|
130
131
|
def api_error?
|
data/lib/comgate/gateway.rb
CHANGED
@@ -42,6 +42,7 @@ module Comgate
|
|
42
42
|
transferId: %i[transfer_id],
|
43
43
|
code: %i[code],
|
44
44
|
message: %i[message],
|
45
|
+
extraMessage: %i[extra_message],
|
45
46
|
payerId: %i[payer id],
|
46
47
|
payerName: %i[payer account_name],
|
47
48
|
payer_name: %i[payer account_name],
|
@@ -148,7 +149,7 @@ module Comgate
|
|
148
149
|
def process_callback(comgate_params)
|
149
150
|
Comgate::Response.new({ response_body: comgate_params }, DATA_CONVERSION_HASH)
|
150
151
|
end
|
151
|
-
alias process_payment_callback process_callback
|
152
|
+
alias process_payment_callback process_callback # backward compatibility
|
152
153
|
|
153
154
|
def allowed_payment_methods(payment_data)
|
154
155
|
ph = gateway_params.merge(convert_data_to_comgate_params(%i[curr lang country], payment_data, required: false))
|
@@ -181,7 +182,7 @@ module Comgate
|
|
181
182
|
if srv.success?
|
182
183
|
Comgate::Response.new(srv.result, conversion_hash)
|
183
184
|
else
|
184
|
-
handle_failure_from(srv
|
185
|
+
handle_failure_from(srv)
|
185
186
|
end
|
186
187
|
end
|
187
188
|
|
@@ -189,8 +190,11 @@ module Comgate
|
|
189
190
|
test_from_data.nil? ? test_calls_used? : (test_from_data == true)
|
190
191
|
end
|
191
192
|
|
192
|
-
def handle_failure_from(
|
193
|
-
raise errors.to_s
|
193
|
+
def handle_failure_from(srv)
|
194
|
+
raise srv.errors.to_s unless srv.result.dig(:response_body, "transId").present?
|
195
|
+
|
196
|
+
# pretends to be a successfull response, and keep payment check to decide what to do next
|
197
|
+
Comgate::Response.new(srv.result, conversion_hash)
|
194
198
|
end
|
195
199
|
|
196
200
|
def single_payment_payload(payment_data)
|
data/lib/comgate/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: comgate_ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Petr Mlčoch
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-06-
|
11
|
+
date: 2023-06-27 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Write a longer description or delete this line.
|
14
14
|
email:
|