smartpay 0.2.15 → 0.2.16
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/smartpay/configuration.rb +18 -2
- data/lib/smartpay/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: a42e702ac2b0fc1237d6e5aff589bd3cf454aa7bcbddd5ba3843983d0e8e1324
|
4
|
+
data.tar.gz: 91a4fdfff9be9e03499605f1899d6cc1f3bdb047303d4500a155cbe528443a2a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 91bcb22eabb064bd0e21ec6c8c08fbd3f339a697e1131ceda8d5c98fb1bce7ccb08470b72399b7bb89964bd63d5cdadc75d40bc114703a5258dab99c76302076
|
7
|
+
data.tar.gz: 7aee3ae59b6af7a79f821b73dea25cd4f7865357a61a4ff5bff06fe1cd10329b0de4aca2ce0c2998488d24a517af859404d183d56bf7d6f0b4836cd0ad7c227d
|
@@ -11,7 +11,11 @@ module Smartpay
|
|
11
11
|
|
12
12
|
def initialize
|
13
13
|
@post_timeout = DEFAULT_TIMEOUT_SETTING
|
14
|
-
@api_url =
|
14
|
+
@api_url = if in_development_mode?
|
15
|
+
ENV['SMARTPAY_API_PREFIX'] || DEFAULT_API_URL
|
16
|
+
else
|
17
|
+
DEFAULT_API_URL
|
18
|
+
end
|
15
19
|
@checkout_url = DEFAULT_CHECKOUT_URL
|
16
20
|
end
|
17
21
|
|
@@ -20,11 +24,23 @@ module Smartpay
|
|
20
24
|
end
|
21
25
|
|
22
26
|
def api_url
|
23
|
-
|
27
|
+
if in_development_mode?
|
28
|
+
@api_url || ENV['SMARTPAY_API_PREFIX'] || DEFAULT_API_URL
|
29
|
+
else
|
30
|
+
@api_url || DEFAULT_API_URL
|
31
|
+
end
|
24
32
|
end
|
25
33
|
|
26
34
|
def checkout_url
|
27
35
|
@checkout_url || DEFAULT_CHECKOUT_URL
|
28
36
|
end
|
37
|
+
|
38
|
+
private
|
39
|
+
|
40
|
+
def in_development_mode?
|
41
|
+
if ENV['SMARTPAY_API_PREFIX'].is_a?(String)
|
42
|
+
ENV['SMARTPAY_API_PREFIX'].include?('api.smartpay')
|
43
|
+
end
|
44
|
+
end
|
29
45
|
end
|
30
46
|
end
|
data/lib/smartpay/version.rb
CHANGED