bs2_api 1.5.1 → 1.6.0

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: 92386deadc6c231d882caac48d3092acab5c69ab50a176757768ab074635a5e4
4
- data.tar.gz: 90896ecd3a4dd6d60dcd3c69bcd6b56697ba5e33ab6a0e909c4dd7cf63ddae44
3
+ metadata.gz: f216fd8e2feeeeb8f8223e820839c1b7be43ab4f360946fb9fbeb6c3282237e0
4
+ data.tar.gz: 7c30ce3c1b8e31f0c97aa744d46f6462d36eadaee7f2acb84086fe5af4aae26b
5
5
  SHA512:
6
- metadata.gz: b2be2b78bbcedb9af38193898d62f7fa0cd0bf5e6217fefd39ed2e84db47bf7d2a604b3e2e88af338706936067f5baf290de268e32e7114d803809656df85325
7
- data.tar.gz: c5e8632080a64039a8d99e6a9ca112b5dad3cf766dd08387c5341427da3a055144417feeb44f7bbc7f409092f46d966076aedf1aa29a7520c01371e428cde853
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.5.0)
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
@@ -7,16 +7,18 @@ module Bs2Api
7
7
  payment,
8
8
  value: nil,
9
9
  client_id: Bs2Api.configuration.client_id,
10
- client_secret: Bs2Api.configuration.client_secret
10
+ client_secret: Bs2Api.configuration.client_secret,
11
+ proxy: nil
11
12
  )
12
- @client_id = client_id
13
- @client_secret = client_secret
14
-
13
+
15
14
  raise Bs2Api::Errors::ConfirmationError, 'invalid payment' unless payment.present? && payment.is_a?(Bs2Api::Entities::Payment)
16
15
  raise Bs2Api::Errors::ConfirmationError, 'invalid value' unless value.to_f.positive?
17
- @payment = payment
18
16
 
17
+ @payment = payment
19
18
  @value = value.to_f
19
+ @client_id = client_id
20
+ @client_secret = client_secret
21
+ @proxy = proxy
20
22
  end
21
23
 
22
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
@@ -6,11 +6,13 @@ module Bs2Api
6
6
  def initialize(
7
7
  key,
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
+ @key = key
11
13
  @client_id = client_id
12
14
  @client_secret = client_secret
13
- @key = key
15
+ @proxy = proxy
14
16
  end
15
17
 
16
18
  private
@@ -6,13 +6,15 @@ module Bs2Api
6
6
  def initialize(
7
7
  bank,
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
  )
11
12
 
12
- @client_id = client_id
13
- @client_secret = client_secret
14
13
  raise Bs2Api::Errors::InvalidBank, 'Invalid Bank' unless bank.is_a?(Bs2Api::Entities::Bank)
15
14
  @bank = bank
15
+ @client_id = client_id
16
+ @client_secret = client_secret
17
+ @proxy = proxy
16
18
  end
17
19
 
18
20
  private
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Bs2Api
4
- VERSION = '1.5.1'
4
+ VERSION = '1.6.0'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bs2_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.1
4
+ version: 1.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kim Pastro