credit_gateway 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +12 -4
- data/lib/credit_gateway/client.rb +6 -1
- data/lib/credit_gateway/configuration.rb +2 -2
- data/lib/credit_gateway/errors.rb +2 -0
- data/lib/credit_gateway/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: 7dcf55c224cd6f61d8d4564ef05ab738341518dea922f618a1dc6ee669c1fb99
|
4
|
+
data.tar.gz: 32f0197981622fe82d4593acbabe70d9b6cbb2d2717f42d8dfcd277378b1200d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 66c31c9ab399bd9e229844770cf6ecbd12f1d73a6b2b5e93cecb03d511247c2992d5ec64e0553140872f98b81f36af3bb7ff4dbd9e96416c9339128e6cc29a25
|
7
|
+
data.tar.gz: 051e11dd9e18f719c8e75e58936dd2df954036200e645780022ded24a5f22ef8cd3f09472fc224c493fb3acaf6859275501cfd80c5a27f43f93cbe7adf44705c
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
credit_gateway (0.1.
|
4
|
+
credit_gateway (0.1.1)
|
5
5
|
faraday
|
6
6
|
faraday_middleware
|
7
7
|
faraday_middleware-multi_json
|
@@ -17,10 +17,17 @@ GEM
|
|
17
17
|
rexml
|
18
18
|
diff-lcs (1.4.4)
|
19
19
|
dotenv (2.7.6)
|
20
|
-
faraday (
|
20
|
+
faraday (1.4.1)
|
21
|
+
faraday-excon (~> 1.1)
|
22
|
+
faraday-net_http (~> 1.0)
|
23
|
+
faraday-net_http_persistent (~> 1.1)
|
21
24
|
multipart-post (>= 1.2, < 3)
|
22
|
-
|
23
|
-
|
25
|
+
ruby2_keywords (>= 0.0.4)
|
26
|
+
faraday-excon (1.1.0)
|
27
|
+
faraday-net_http (1.0.1)
|
28
|
+
faraday-net_http_persistent (1.1.0)
|
29
|
+
faraday_middleware (1.0.0)
|
30
|
+
faraday (~> 1.0)
|
24
31
|
faraday_middleware-multi_json (0.0.6)
|
25
32
|
faraday_middleware
|
26
33
|
multi_json
|
@@ -47,6 +54,7 @@ GEM
|
|
47
54
|
diff-lcs (>= 1.2.0, < 2.0)
|
48
55
|
rspec-support (~> 3.10.0)
|
49
56
|
rspec-support (3.10.2)
|
57
|
+
ruby2_keywords (0.0.4)
|
50
58
|
vcr (6.0.0)
|
51
59
|
webmock (3.12.1)
|
52
60
|
addressable (>= 2.3.6)
|
@@ -4,6 +4,7 @@ require 'faraday'
|
|
4
4
|
require 'faraday_middleware/multi_json'
|
5
5
|
require 'credit_gateway/configuration'
|
6
6
|
require 'credit_gateway/faraday_auth'
|
7
|
+
require 'credit_gateway/errors'
|
7
8
|
|
8
9
|
module CreditGateway
|
9
10
|
class Client
|
@@ -47,7 +48,11 @@ module CreditGateway
|
|
47
48
|
|
48
49
|
case response.status
|
49
50
|
when 400
|
50
|
-
|
51
|
+
if response.body.dig(:Errors, 0, :ErrorCode) == 'Company.NotFound'
|
52
|
+
raise CompanyNotFoundError, response.body.dig(:Errors, 0, :ErrorMessage)
|
53
|
+
else
|
54
|
+
raise InvalidRequestError, response.body
|
55
|
+
end
|
51
56
|
when 401
|
52
57
|
raise UnauthorizedError, response.body
|
53
58
|
when 404
|
@@ -3,11 +3,11 @@
|
|
3
3
|
module CreditGateway
|
4
4
|
class Configuration
|
5
5
|
BASE_URLS = {
|
6
|
-
production: '',
|
6
|
+
production: 'https://api.connector.crifrealtime.com',
|
7
7
|
sandbox: 'https://apiuat.connector.crifrealtime.com'
|
8
8
|
}.freeze
|
9
9
|
AUTH_URLS = {
|
10
|
-
production: '',
|
10
|
+
production: 'https://auth.connector.crifrealtime.com',
|
11
11
|
sandbox: 'https://uatauth.connector.crifrealtime.com'
|
12
12
|
}.freeze
|
13
13
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: credit_gateway
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Finpoint
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-05-
|
11
|
+
date: 2021-05-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|