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 +4 -4
- data/Gemfile.lock +1 -1
- data/lib/bs2_api/payment/async.rb +3 -1
- data/lib/bs2_api/payment/base.rb +9 -1
- data/lib/bs2_api/payment/confirmation.rb +7 -5
- data/lib/bs2_api/payment/detail.rb +4 -2
- data/lib/bs2_api/payment/key.rb +4 -2
- data/lib/bs2_api/payment/manual.rb +5 -3
- data/lib/bs2_api/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f216fd8e2feeeeb8f8223e820839c1b7be43ab4f360946fb9fbeb6c3282237e0
|
4
|
+
data.tar.gz: 7c30ce3c1b8e31f0c97aa744d46f6462d36eadaee7f2acb84086fe5af4aae26b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 285edcdb49d779a6de9a8c36b1f16588d46e44c993db5c00e733f8946a000e3ffed6429a81bfeefa1d74152d6baa84dad8400e00b209943df3231f96846f2ec0
|
7
|
+
data.tar.gz: e6b1affdd5cc0c84005f68d9d723b83faba9cced4f606fdebc10164f2ba309442a37103dada2b7da8409e40f916f7978ed9d716d9065190b7cd507f717579a1d
|
data/Gemfile.lock
CHANGED
@@ -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
|
|
data/lib/bs2_api/payment/base.rb
CHANGED
@@ -18,7 +18,15 @@ module Bs2Api
|
|
18
18
|
private
|
19
19
|
|
20
20
|
def post_request
|
21
|
-
HTTParty.post(
|
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
|
-
|
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
|
-
@
|
15
|
+
@proxy = proxy
|
14
16
|
end
|
15
17
|
|
16
18
|
def call
|
data/lib/bs2_api/payment/key.rb
CHANGED
@@ -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
|
-
@
|
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
|
data/lib/bs2_api/version.rb
CHANGED