eps-rapid 1.1.3 → 1.2.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: 5976f85c0637aa878ffb789e799969ed55ecbad0f8980ecc97d8384c1d6e1995
4
- data.tar.gz: ab27a49281db85e7ad70b54a393ed725635a0164dbab37955d518c6a92062320
3
+ metadata.gz: 0635d7fc795915ac4229d1968713e1f78ab615ec52bd59cb9a3fce51b421ce20
4
+ data.tar.gz: fb3aab1e962108feea5d465907fd680d5c312589b1a73b143d1e61be752d4129
5
5
  SHA512:
6
- metadata.gz: dd64d892ec1f1402d2bdf5e0cada0afff49eab3ba76787a648af111a2fffe51be6a9c36c5897a6f55339f76a1d404aa376716e2aa2338df047225718593c4b10
7
- data.tar.gz: c479486687957c8e5b1e28ab6f9d9efe0c9c198032965d2952b42cc221695062c6aad3d80831b3589526a59357a402496d63f2a4ced7a997452ccf6e05635b54
6
+ metadata.gz: 2f7056cc0acbedbe619bdd81c4c0120d2866c6f9940b098417eeb40238a01505d0d9e34978d6e920db583dbbb5ee7cac6075e1b49ccb886f1eeefe7442542191
7
+ data.tar.gz: 9daa91af2bd45fdf330aa182a12da06c981114f5420b8ab3dcd603a16d6c3d42d1aac63b931389c39b2d1d71a17887f70e901cf0bdf3e35742e4f4cfe7294110
data/CHANGELOG.MD CHANGED
@@ -31,3 +31,6 @@
31
31
  ### Version 1.1.3
32
32
  # Patched
33
33
  - support 202 response
34
+ ### Version 1.2.0
35
+ # Changed
36
+ - configuration: language -> language_resolver
data/README.md CHANGED
@@ -19,7 +19,7 @@ EpsRapid.configure do |c|
19
19
  c.api_key = 'YOUR_API_KEY'
20
20
  c.secret_key = 'YOUR_SECRET_KEY'
21
21
  c.base_path = 'BASE_PATH'
22
- c.language = 'en-US'
22
+ c.language_resolver = proc { 'en-US' }
23
23
  c.logger = Logger.new(nil)
24
24
  end
25
25
  ```
@@ -46,7 +46,7 @@ module EpsRapid
46
46
 
47
47
  def generate_uri(path, params)
48
48
  uri = URI("#{EpsRapid.base_path}/#{path}")
49
- params.merge!({ language: EpsRapid.language })
49
+ params.merge!({ language: language })
50
50
  transformed_params = transform_params(params)
51
51
  transformed_params.reject { |k,_| k == :customer_ip }
52
52
  uri.query = URI.encode_www_form(transformed_params) unless path.include?('token')
@@ -54,6 +54,10 @@ module EpsRapid
54
54
  uri
55
55
  end
56
56
 
57
+ def language
58
+ EpsRapid.language_resolver.call
59
+ end
60
+
57
61
  def transform_params(params)
58
62
  params.each do |k, v|
59
63
  params[k] =
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module EpsRapid
4
- VERSION = '1.1.3'
4
+ VERSION = '1.2.0'
5
5
  end
data/lib/eps-rapid.rb CHANGED
@@ -16,7 +16,7 @@ require 'logger'
16
16
 
17
17
  module EpsRapid
18
18
  class << self
19
- attr_accessor :api_key, :secret_key, :base_path, :language, :logger
19
+ attr_accessor :api_key, :secret_key, :base_path, :language_resolver, :logger
20
20
 
21
21
  def configure
22
22
  yield(self)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: eps-rapid
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.3
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Igor Leonenko
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-12-15 00:00:00.000000000 Z
11
+ date: 2022-01-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec