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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e69060f27a2870839a5271eb8718bbb0f7898efee00f70a06231ccc4042643f4
4
- data.tar.gz: 739ddc687f25d13c683b7e651ec5f8b6a569d8dcddee74913bd21afbee055bbf
3
+ metadata.gz: a42e702ac2b0fc1237d6e5aff589bd3cf454aa7bcbddd5ba3843983d0e8e1324
4
+ data.tar.gz: 91a4fdfff9be9e03499605f1899d6cc1f3bdb047303d4500a155cbe528443a2a
5
5
  SHA512:
6
- metadata.gz: 33edcef309bce743fc835bf3c812d73db904bac4a6407e85072357279d661292ce2b2e9001bfd672cd14c25e42d3fd0c8956ea57f947fed0133ae99150e48f20
7
- data.tar.gz: 5f0ad3bef86e42f14ce864605e25505e07dab21ef23e1be1f243474f249f327a0145c742a340345cdde1e3c699ae53e8c05bbabcb4657434f906fdae1906d955
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 = ENV['SMARTPAY_API_PREFIX'] || DEFAULT_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
- @api_url || ENV['SMARTPAY_API_PREFIX'] || DEFAULT_API_URL
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Smartpay
4
- VERSION = "0.2.15"
4
+ VERSION = "0.2.16"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: smartpay
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.15
4
+ version: 0.2.16
5
5
  platform: ruby
6
6
  authors:
7
7
  - Smartpay