comgate_ruby 0.8.0 → 0.8.1
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 +3 -0
- data/Gemfile.lock +1 -1
- data/README.md +5 -0
- data/lib/comgate/api_caller.rb +16 -2
- data/lib/comgate/gateway.rb +5 -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: c7882560b8946462a01c78940b5c3f9c1e771418b90123e5de3b4f4e3c8dea2e
|
4
|
+
data.tar.gz: 47271d5e947abd8f189c42f79e248fd0992d56e3a92eb24b624e3f8559ec09fb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 72e412a79248be368f95a76c7a8e3214e7156edb8a2336af3150ac1b652e7d95c2e8614ad1c1e4d1f2a3b7d201a7aa915101a6f05fa6fb7f58497f32dd17fd36
|
7
|
+
data.tar.gz: 8ce0f483ea79eebd5c25cfac010cc0761b5de48cfd1bb5b36155aabf2621bfc9a834e42428f75dcf4bff89554adec82a6289f34a4af8966ce8e86e2afa841239
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,6 @@
|
|
1
|
+
## [0.8.1] - 2023-06-13
|
2
|
+
- Allowed `proxy_uri` param for Comgate::Gateway
|
3
|
+
|
1
4
|
## [0.8] - 2023-06-06
|
2
5
|
- Update to conform universal payment interface params (see Readme)
|
3
6
|
- BREAKING: change in repeating params `{transaction_id: "xxx", ....}` is now at `{payment: {reccurrence: { init_transaction_id: "xxx" } } }`
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -21,6 +21,11 @@ If bundler is not being used to manage dependencies, install the gem by executin
|
|
21
21
|
gateway = Comgate::Gateway.new(merchant_gateway_id: ":comgate_id",
|
22
22
|
test_calls: false,
|
23
23
|
client_secret: ":comgate_secret")
|
24
|
+
# or with proxy
|
25
|
+
gateway = Comgate::Gateway.new(merchant_gateway_id: ":comgate_id",
|
26
|
+
test_calls: false,
|
27
|
+
client_secret: ":comgate_secret",
|
28
|
+
proxy_uri: "http://pxuser:pxpassword@proxy.me:123") # or just "http://proxy.me:123"
|
24
29
|
```
|
25
30
|
|
26
31
|
### 2) prepare endpoint
|
data/lib/comgate/api_caller.rb
CHANGED
@@ -20,11 +20,12 @@ module Comgate
|
|
20
20
|
|
21
21
|
attr_reader :payload, :url
|
22
22
|
|
23
|
-
def initialize(url:, payload:, test_call: false)
|
23
|
+
def initialize(url:, payload:, test_call: false, proxy_uri: nil)
|
24
24
|
super()
|
25
25
|
@url = url
|
26
26
|
@payload = payload
|
27
27
|
@payload.merge!(test: "true") if test_call
|
28
|
+
@proxy_uri = proxy_uri
|
28
29
|
end
|
29
30
|
|
30
31
|
def build_result
|
@@ -57,7 +58,20 @@ module Comgate
|
|
57
58
|
end
|
58
59
|
|
59
60
|
def https_conn
|
60
|
-
@https_conn ||=
|
61
|
+
@https_conn ||= if @proxy_uri
|
62
|
+
proxy = URI.parse(@proxy_uri)
|
63
|
+
Net::HTTP.start(service_uri.host,
|
64
|
+
service_uri.port,
|
65
|
+
proxy.host,
|
66
|
+
proxy.port,
|
67
|
+
proxy.user,
|
68
|
+
proxy.password,
|
69
|
+
connection_options)
|
70
|
+
else
|
71
|
+
Net::HTTP.start(service_uri.host,
|
72
|
+
service_uri.port,
|
73
|
+
connection_options)
|
74
|
+
end
|
61
75
|
end
|
62
76
|
|
63
77
|
def request
|
data/lib/comgate/gateway.rb
CHANGED
@@ -74,6 +74,10 @@ module Comgate
|
|
74
74
|
options[:test_calls] == true
|
75
75
|
end
|
76
76
|
|
77
|
+
def proxy_uri
|
78
|
+
options[:proxy_uri]
|
79
|
+
end
|
80
|
+
|
77
81
|
def start_transaction(payment_data)
|
78
82
|
make_call(url: "#{BASE_URL}/create",
|
79
83
|
payload: single_payment_payload(payment_data),
|
@@ -173,7 +177,7 @@ module Comgate
|
|
173
177
|
def make_call(url:, payload:, test_call:, conversion_hash: DATA_CONVERSION_HASH)
|
174
178
|
raise "There are errors in pre-api-call phase: #{payload[:errors]}" unless payload[:errors].nil?
|
175
179
|
|
176
|
-
srv = Comgate::ApiCaller.call(url: url, payload: payload, test_call: test_call)
|
180
|
+
srv = Comgate::ApiCaller.call(url: url, payload: payload, test_call: test_call, proxy_uri: proxy_uri)
|
177
181
|
if srv.success?
|
178
182
|
Comgate::Response.new(srv.result, conversion_hash)
|
179
183
|
else
|
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.1
|
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-13 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Write a longer description or delete this line.
|
14
14
|
email:
|