gateway-sdk 0.2.4 → 1.0.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
  SHA1:
3
- metadata.gz: 79b40375ba8ef4bb9c0eaddd85b873314e513bb9
4
- data.tar.gz: ba73c18aa25215d42ea20a59060c82d9f0612c76
3
+ metadata.gz: b25271297180dec30786b1777c6704c52b0a9324
4
+ data.tar.gz: 3f5e7d14b4bf32804e3f2e58ba8eebe81cb0bec3
5
5
  SHA512:
6
- metadata.gz: b331a81b6f17af2a91c8707a989bb7e1b575fcfd5fdf8d86920ae12a77462e1cf09f0e04a0ab14b5030e3bd16059ba911ca03080c4d13a02ea3902a87d719dc8
7
- data.tar.gz: 7191c4664cb97f588cc2de8a8f683c123090ebdda707e6a6bcf0a7ce9e516feb22b7d6f642c2928cc8015dd3d002764753074a4d47d4572c43754f92f56c2d8d
6
+ metadata.gz: d61df966c5585c8d6abaf197b8be0b6155544ab34b8e6b7c44e9b35e414f5df2cbb65877796f928aaac73fff2e33c6d67f6e1405504830e2cd44e670fbef9c7e
7
+ data.tar.gz: f50d5b71243e75e1f24b2dc464d07fd384d67fcd2a587826fd55b4c85855fa7661521a75e49b999fc7b45886729906194a866108a0a91cfb26cf343e2fa7e9cc
@@ -23,13 +23,15 @@ module Gateway
23
23
  # Initialize
24
24
  #
25
25
  # @param [Gateway::Requests::CommonRequest] request
26
+ # @param [String] token access token
26
27
  # @param [TrueClass|FalseClass] test test or production modes
27
28
  #
28
- def initialize(request, test = false)
29
+ def initialize(request, token, test = false)
29
30
  Gateway.config = JSON.parse(YAML.load_file("#{Gateway.root}/gateway/config.yml").to_json, object_class: OpenStruct)
30
31
  @request = request
32
+ @token = token
31
33
  @test = test
32
- request_name = request.class.name.split('::').last
34
+ request_name = request.class.name.split('::').last
33
35
  @config_data = Gateway.config.api_methods[request_name]
34
36
  raise Gateway::StandardError.new("fill data in config.yml for method: #{request_name}") unless @config_data
35
37
  end
@@ -47,7 +49,7 @@ module Gateway
47
49
  query_params.merge! request.attributes
48
50
  response = RestClient.get(url(query_params))
49
51
  when METHOD_POST
50
- response = RestClient.post(url(query_params), request.attributes)
52
+ response = RestClient.post(url(query_params), request.attributes, Authorization: @token)
51
53
  else
52
54
  raise Gateway::ArgumentError.new("http method #{config_data.http_method} is not supported")
53
55
  end
@@ -1,3 +1,3 @@
1
1
  module Gateway
2
- VERSION = '0.2.4' # gem version
2
+ VERSION = '1.0.0' # gem version
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gateway-sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.4
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - atanych