comgate_ruby 0.6.0 → 0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/README.md +1 -1
- data/lib/comgate/api_caller.rb +7 -1
- data/lib/comgate/gateway.rb +1 -1
- data/lib/comgate/response.rb +2 -1
- 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: 72f2698e92aee79da30f44ca5e7bff94f91fd2e5040e592376ed5da708917357
|
4
|
+
data.tar.gz: 3da9f58a4a35c420d2b1297352caacbcef7def37e00765fa3029362ef597a631
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bebb119abe984f6f30f03d4ed37481fbff9ca749f74978cc54456c2e16c132de0ddddc1d3587555659b392a7952ca554bb61e5a401c7025610764771fcb2c933
|
7
|
+
data.tar.gz: e65fc6812ceaa251f0d3a730cf71ad243485118941462dfcc30f11122be90f16dd081f0df3a22a65115bcccd165a2e294d58b60638d12d95980fa45999da5efa
|
data/CHANGELOG.md
CHANGED
@@ -3,3 +3,8 @@
|
|
3
3
|
- Initial release
|
4
4
|
|
5
5
|
|
6
|
+
## [0.7.0] - 2023-04-27
|
7
|
+
|
8
|
+
- better handling errors not in "error" param from Comgate
|
9
|
+
- renamed `check_state` to `check_transaction` (and keep backward compatibility)
|
10
|
+
- renamed `process_payment_callback` to `process_callback` (and keep backward compatibility)
|
data/README.md
CHANGED
@@ -83,7 +83,7 @@ If bundler is not being used to manage dependencies, install the gem by executin
|
|
83
83
|
|
84
84
|
### Check payment state (ad-hoc)
|
85
85
|
0) The endpoint must be always implemented, this is just additional way to check payment state
|
86
|
-
1) Call `gateway.
|
86
|
+
1) Call `gateway.check_transaction(transaction_id: ":transID")`. It will return `{state: :paid, transaction_id: ":transID"}` and some more infos.
|
87
87
|
2) Handle status change like bullet 5) in single payment
|
88
88
|
|
89
89
|
### Get payment methods allowed to merchant
|
data/lib/comgate/api_caller.rb
CHANGED
@@ -115,8 +115,14 @@ module Comgate
|
|
115
115
|
|
116
116
|
def api_error?
|
117
117
|
return false unless decoded_response_body.is_a?(Hash)
|
118
|
+
return true if decoded_response_body["error"].to_i.positive?
|
118
119
|
|
119
|
-
decoded_response_body["
|
120
|
+
if decoded_response_body["code"].to_i.positive?
|
121
|
+
decoded_response_body["error"] = decoded_response_body["code"]
|
122
|
+
return true
|
123
|
+
end
|
124
|
+
|
125
|
+
false
|
120
126
|
end
|
121
127
|
|
122
128
|
def handle_connection_error(error)
|
data/lib/comgate/gateway.rb
CHANGED
data/lib/comgate/response.rb
CHANGED
@@ -31,7 +31,7 @@ module Comgate
|
|
31
31
|
1500 => "unexpected error"
|
32
32
|
}.freeze
|
33
33
|
|
34
|
-
attr_accessor :http_code, :redirect_to, :hash, :array, :errors
|
34
|
+
attr_accessor :http_code, :transaction_id, :redirect_to, :hash, :array, :errors
|
35
35
|
attr_reader :params_conversion_hash
|
36
36
|
|
37
37
|
def initialize(caller_result, params_conversion_hash = {})
|
@@ -46,6 +46,7 @@ module Comgate
|
|
46
46
|
case converted_body
|
47
47
|
when Hash
|
48
48
|
@hash = converted_body
|
49
|
+
@transaction_id = converted_body[:transaction_id]
|
49
50
|
@array = nil
|
50
51
|
when Array
|
51
52
|
@array = converted_body
|
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.
|
4
|
+
version: '0.7'
|
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-04-
|
11
|
+
date: 2023-04-27 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Write a longer description or delete this line.
|
14
14
|
email:
|