bckbn 2.1.0 → 2.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a0ca96c3fc5d996a2aaebd4cc4aac9f60ca402d9c2ec29433dae8d5b0122046a
4
- data.tar.gz: 0f9fcd4614259605cdfbabe9f10c9055d7eaa6abfc7f9961de259e068faf05f1
3
+ metadata.gz: 17f59a2d0a76520c2ce364ef1bcfd8ca46e9a20f51026cb2613f9d66482ae278
4
+ data.tar.gz: 51458c020327baffec1803bb3dc0fe6b8e890c771a9dd4cd7d604940b26f0aed
5
5
  SHA512:
6
- metadata.gz: a3b0877e7df14c379566ae33ce5217466eb0d5de7736b287a7a77234ed68c7c2b2ca99e0c59195a1e50909b756ce0f46431d5203440737af1ee92e36eaf8a058
7
- data.tar.gz: c50a35535995759cbe68c1ab5c356254820bcb8f82c14f5106d5c9bf70713a7f85a7a36459bb942f9f0844c57bfa59a3d3e64782aca9eb85e2289517eb29cf09
6
+ metadata.gz: 63c67a32658b11f8b6f05cae841cf3feca56863a9528c158b29ec74e852f259f7fa0832112dbc0bdf611132d2207a7b9dcc8762ac972ab247194b1b4c5ac9dcd
7
+ data.tar.gz: f5fe4a59cd73013bef9277a4c3f5255a6a89e934fa25fe643d4f5747d8e310a06f1865ffcb80d71c97a8d7affdb4ec2fcb7b942197a22da581def1465063429d
data/Gemfile.lock CHANGED
@@ -1,41 +1,40 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- bckbn (2.1.0)
4
+ bckbn (2.1.1)
5
5
  addressable (~> 2.8.5)
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
9
9
  specs:
10
- addressable (2.8.5)
10
+ addressable (2.8.6)
11
11
  public_suffix (>= 2.0.2, < 6.0)
12
12
  ast (2.4.2)
13
- base64 (0.1.1)
14
13
  coderay (1.1.3)
15
14
  concurrent-ruby (1.2.2)
16
15
  crack (0.4.5)
17
16
  rexml
18
17
  diff-lcs (1.5.0)
19
- faker (3.2.1)
18
+ faker (3.2.2)
20
19
  i18n (>= 1.8.11, < 2)
21
- hashdiff (1.0.1)
20
+ hashdiff (1.1.0)
22
21
  i18n (1.14.1)
23
22
  concurrent-ruby (~> 1.0)
24
- json (2.6.3)
23
+ json (2.7.1)
25
24
  language_server-protocol (3.17.0.3)
26
25
  method_source (1.0.0)
27
- parallel (1.23.0)
28
- parser (3.2.2.4)
26
+ parallel (1.24.0)
27
+ parser (3.3.0.2)
29
28
  ast (~> 2.4.1)
30
29
  racc
31
30
  pry (0.14.2)
32
31
  coderay (~> 1.1)
33
32
  method_source (~> 1.0)
34
- public_suffix (5.0.3)
35
- racc (1.7.1)
33
+ public_suffix (5.0.4)
34
+ racc (1.7.3)
36
35
  rainbow (3.1.1)
37
- rake (13.0.6)
38
- regexp_parser (2.8.1)
36
+ rake (13.1.0)
37
+ regexp_parser (2.9.0)
39
38
  rexml (3.2.6)
40
39
  rspec (3.12.0)
41
40
  rspec-core (~> 3.12.0)
@@ -50,19 +49,18 @@ GEM
50
49
  diff-lcs (>= 1.2.0, < 2.0)
51
50
  rspec-support (~> 3.12.0)
52
51
  rspec-support (3.12.1)
53
- rubocop (1.56.4)
54
- base64 (~> 0.1.1)
52
+ rubocop (1.59.0)
55
53
  json (~> 2.3)
56
54
  language_server-protocol (>= 3.17.0)
57
55
  parallel (~> 1.10)
58
- parser (>= 3.2.2.3)
56
+ parser (>= 3.2.2.4)
59
57
  rainbow (>= 2.2.2, < 4.0)
60
58
  regexp_parser (>= 1.8, < 3.0)
61
59
  rexml (>= 3.2.5, < 4.0)
62
- rubocop-ast (>= 1.28.1, < 2.0)
60
+ rubocop-ast (>= 1.30.0, < 2.0)
63
61
  ruby-progressbar (~> 1.7)
64
62
  unicode-display_width (>= 2.4.0, < 3.0)
65
- rubocop-ast (1.29.0)
63
+ rubocop-ast (1.30.0)
66
64
  parser (>= 3.2.1.0)
67
65
  ruby-progressbar (1.13.0)
68
66
  unicode-display_width (2.5.0)
@@ -14,52 +14,46 @@ module Bckbn
14
14
  }.freeze
15
15
  private_constant :ENDPOINTS
16
16
 
17
- def self.authorization(body, config = {})
18
- body = AuthorizationRequest.new(body)
19
- @conn = Bckbn::Connection.new(config)
20
- @conn.post_to_api(ENDPOINTS.fetch(__method__), body.to_h, AuthorizationResponse)
21
- end
22
-
23
- def self.capture(body, config = {})
24
- body = CaptureRequest.new(body)
25
- @conn = Bckbn::Connection.new(config)
26
- @conn.post_to_api(ENDPOINTS.fetch(__method__), body.to_h, CaptureResponse)
27
- end
28
-
29
- def self.credit(body, config = {})
30
- body = CreditRequest.new(body)
31
- @conn = Bckbn::Connection.new(config)
32
- @conn.post_to_api(ENDPOINTS.fetch(__method__), body.to_h, CreditResponse)
33
- end
34
-
35
- def self.sale(body, config = {})
36
- body = SaleRequest.new(body)
37
- @conn = Bckbn::Connection.new(config)
38
- @conn.post_to_api(ENDPOINTS.fetch(__method__), body.to_h, SaleResponse)
39
- end
40
-
41
- def self.void(body, config = {})
42
- body = VoidRequest.new(body)
43
- @conn = Bckbn::Connection.new(config)
44
- @conn.post_to_api(ENDPOINTS.fetch(__method__), body.to_h, VoidResponse)
45
- end
46
-
47
- def self.echeck_credit(body, config = {})
48
- body = EcheckCreditRequest.new(body)
49
- @conn = Bckbn::Connection.new(config)
50
- @conn.post_to_api(ENDPOINTS.fetch(__method__), body.to_h, EcheckCreditResponse)
51
- end
52
-
53
- def self.echeck_sale(body, config = {})
54
- body = EcheckSaleRequest.new(body)
55
- @conn = Bckbn::Connection.new(config)
56
- @conn.post_to_api(ENDPOINTS.fetch(__method__), body.to_h, EcheckSaleResponse)
57
- end
58
-
59
- def self.echeck_void(body, config = {})
60
- body = EcheckVoidRequest.new(body)
61
- @conn = Bckbn::Connection.new(config)
62
- @conn.post_to_api(ENDPOINTS.fetch(__method__), body.to_h, EcheckVoidResponse)
17
+ class << self
18
+ def authorization(body, config = {})
19
+ process_transaction(__method__, body, config, AuthorizationRequest, AuthorizationResponse)
20
+ end
21
+
22
+ def capture(body, config = {})
23
+ process_transaction(__method__, body, config, CaptureRequest, CaptureResponse)
24
+ end
25
+
26
+ def credit(body, config = {})
27
+ process_transaction(__method__, body, config, CreditRequest, CreditResponse)
28
+ end
29
+
30
+ def sale(body, config = {})
31
+ process_transaction(__method__, body, config, SaleRequest, SaleResponse)
32
+ end
33
+
34
+ def void(body, config = {})
35
+ process_transaction(__method__, body, config, VoidRequest, VoidResponse)
36
+ end
37
+
38
+ def echeck_credit(body, config = {})
39
+ process_transaction(__method__, body, config, EcheckCreditRequest, EcheckCreditResponse)
40
+ end
41
+
42
+ def echeck_sale(body, config = {})
43
+ process_transaction(__method__, body, config, EcheckSaleRequest, EcheckSaleResponse)
44
+ end
45
+
46
+ def echeck_void(body, config = {})
47
+ process_transaction(__method__, body, config, EcheckVoidRequest, EcheckVoidResponse)
48
+ end
49
+
50
+ private
51
+
52
+ def process_transaction(method, body, config, request_klass, response_klass)
53
+ request = request_klass.new(body)
54
+ conn = Bckbn::Connection.new(config)
55
+ conn.post_to_api(ENDPOINTS.fetch(method), request.to_h, response_klass)
56
+ end
63
57
  end
64
58
  end
65
59
  end
data/lib/bckbn/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Bckbn
4
- VERSION = "2.1.0"
4
+ VERSION = "2.1.1"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bckbn
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.0
4
+ version: 2.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - nikkypx
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-11-07 00:00:00.000000000 Z
11
+ date: 2024-01-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable