bs2_api 1.4.3 → 1.6.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1a7018dd3325d7ac310c8869cf63552485888cc1b5fb3328ce1334980bcbe8d8
4
- data.tar.gz: ae5ba28ee4e2608ac117556475c64f348dabeae82313eb8e05b157f69ddb87d9
3
+ metadata.gz: f216fd8e2feeeeb8f8223e820839c1b7be43ab4f360946fb9fbeb6c3282237e0
4
+ data.tar.gz: 7c30ce3c1b8e31f0c97aa744d46f6462d36eadaee7f2acb84086fe5af4aae26b
5
5
  SHA512:
6
- metadata.gz: 9468bc0b29d50b61a8610ea4e5f1cc6b12cff84d30b8ff729af6df4c611be7adee1c059828de7e963c3890c4ddc1f9dc5c0476c5c7ca593114602910b17e42ed
7
- data.tar.gz: 45d57722d47244643b1a38752ab8f84a1d83aa783b03b40486592ba60decab97a0e27111f1af7dc75d1799d207e9e85511195a60c2abbae891c383c926913018
6
+ metadata.gz: 285edcdb49d779a6de9a8c36b1f16588d46e44c993db5c00e733f8946a000e3ffed6429a81bfeefa1d74152d6baa84dad8400e00b209943df3231f96846f2ec0
7
+ data.tar.gz: e6b1affdd5cc0c84005f68d9d723b83faba9cced4f606fdebc10164f2ba309442a37103dada2b7da8409e40f916f7978ed9d716d9065190b7cd507f717579a1d
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- bs2_api (1.4.3)
4
+ bs2_api (1.5.1)
5
5
  activesupport
6
6
  builder
7
7
  bundler
@@ -46,10 +46,12 @@ module Bs2Api
46
46
 
47
47
  def initialize(
48
48
  client_id: Bs2Api.configuration.client_id,
49
- client_secret: Bs2Api.configuration.client_secret
49
+ client_secret: Bs2Api.configuration.client_secret,
50
+ proxy: nil
50
51
  )
51
52
  @client_id = client_id
52
53
  @client_secret = client_secret
54
+ @proxy = proxy
53
55
  @requests = []
54
56
  end
55
57
 
@@ -18,7 +18,15 @@ module Bs2Api
18
18
  private
19
19
 
20
20
  def post_request
21
- HTTParty.post(url, headers: headers, body: payload.to_json)
21
+ HTTParty.post(
22
+ url,
23
+ http_proxyaddr: @proxy&.host,
24
+ http_proxyport: @proxy&.port,
25
+ http_proxyuser: @proxy&.user,
26
+ http_proxypass: @proxy&.password,
27
+ headers: headers,
28
+ body: payload.to_json
29
+ )
22
30
  end
23
31
 
24
32
  def headers
@@ -3,12 +3,22 @@ module Bs2Api
3
3
  class Confirmation < Base
4
4
  attr_reader :success
5
5
 
6
- def initialize payment, value: nil
6
+ def initialize(
7
+ payment,
8
+ value: nil,
9
+ client_id: Bs2Api.configuration.client_id,
10
+ client_secret: Bs2Api.configuration.client_secret,
11
+ proxy: nil
12
+ )
13
+
7
14
  raise Bs2Api::Errors::ConfirmationError, 'invalid payment' unless payment.present? && payment.is_a?(Bs2Api::Entities::Payment)
8
15
  raise Bs2Api::Errors::ConfirmationError, 'invalid value' unless value.to_f.positive?
9
- @payment = payment
10
16
 
17
+ @payment = payment
11
18
  @value = value.to_f
19
+ @client_id = client_id
20
+ @client_secret = client_secret
21
+ @proxy = proxy
12
22
  end
13
23
 
14
24
  def call
@@ -6,11 +6,13 @@ module Bs2Api
6
6
  def initialize(
7
7
  payment_id,
8
8
  client_id: Bs2Api.configuration.client_id,
9
- client_secret: Bs2Api.configuration.client_secret
9
+ client_secret: Bs2Api.configuration.client_secret,
10
+ proxy: nil
10
11
  )
12
+ @payment_id = payment_id
11
13
  @client_id = client_id
12
14
  @client_secret = client_secret
13
- @payment_id = payment_id
15
+ @proxy = proxy
14
16
  end
15
17
 
16
18
  def call
@@ -3,8 +3,16 @@
3
3
  module Bs2Api
4
4
  module Payment
5
5
  class Key < Base
6
- def initialize key
6
+ def initialize(
7
+ key,
8
+ client_id: Bs2Api.configuration.client_id,
9
+ client_secret: Bs2Api.configuration.client_secret,
10
+ proxy: nil
11
+ )
7
12
  @key = key
13
+ @client_id = client_id
14
+ @client_secret = client_secret
15
+ @proxy = proxy
8
16
  end
9
17
 
10
18
  private
@@ -3,9 +3,18 @@
3
3
  module Bs2Api
4
4
  module Payment
5
5
  class Manual < Base
6
- def initialize bank
6
+ def initialize(
7
+ bank,
8
+ client_id: Bs2Api.configuration.client_id,
9
+ client_secret: Bs2Api.configuration.client_secret,
10
+ proxy: nil
11
+ )
12
+
7
13
  raise Bs2Api::Errors::InvalidBank, 'Invalid Bank' unless bank.is_a?(Bs2Api::Entities::Bank)
8
14
  @bank = bank
15
+ @client_id = client_id
16
+ @client_secret = client_secret
17
+ @proxy = proxy
9
18
  end
10
19
 
11
20
  private
@@ -20,4 +29,4 @@ module Bs2Api
20
29
  end
21
30
  end
22
31
  end
23
- end
32
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Bs2Api
4
- VERSION = '1.4.3'
4
+ VERSION = '1.6.0'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bs2_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.3
4
+ version: 1.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kim Pastro
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-06-30 00:00:00.000000000 Z
11
+ date: 2022-07-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: builder