atol 0.4 → 0.4.1

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
- SHA1:
3
- metadata.gz: 43777b45ecaae54c9ad99454f9281423d8793cbc
4
- data.tar.gz: 867efae667bc6acc6e601e651711eaf8c1ba56e9
2
+ SHA256:
3
+ metadata.gz: 9e009c1d0d842a48e5775c9944271c78a10bf63484eb9ef09e15df4ebbde32b2
4
+ data.tar.gz: 11896f87fc35898404c80e09b3f52a74c067d2127fc313398fdf5ab5f75c9a28
5
5
  SHA512:
6
- metadata.gz: 608913a36f029a07911c48003a7191bfa34de6c37942559605155b3e503add8a6a4113995af0208a9ec7a05943cd1c1a0d0105dd067698aec9fdc2f380357d4d
7
- data.tar.gz: 849b133128f46db62b5b1707a5986bd90fe2346d6f017cb5716e1fd478b4df1df34523723a366e7b24613b29ec375943a358618ba611402b322371821ca02ab2
6
+ metadata.gz: 82ec658605b79be5c565443b50442795ea5577863da30c8802303febd34b56b7664d99be46a47525a732f8506497d24cce7dc346fbbcdbb23d25d2aaef49f42b
7
+ data.tar.gz: 11eacd2d1d7cd711f70a2d47201d36b60e99de94afa40f7c00307eace0eff1cfc570ebf9f83acfbea6b7b67258ae76164fc92a762ddfa4a3fc6376ca61dd732c
@@ -1,7 +1,7 @@
1
1
  sudo: false
2
2
  language: ruby
3
3
  rvm:
4
- - 2.2.3
4
+ - 2.5.0
5
5
  before_install: bundle install
6
6
  cache: bundler
7
7
  script:
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- atol (0.4)
4
+ atol (0.4.1)
5
5
  anyway_config (~> 1.0)
6
6
 
7
7
  GEM
@@ -9,7 +9,7 @@ GEM
9
9
  specs:
10
10
  addressable (2.5.2)
11
11
  public_suffix (>= 2.0.2, < 4.0)
12
- anyway_config (1.1.3)
12
+ anyway_config (1.4.1)
13
13
  ast (2.3.0)
14
14
  coveralls (0.8.21)
15
15
  json (>= 1.8, < 3)
data/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  ![ruby-logo](https://www.ruby-lang.org/images/header-ruby-logo.png)
2
2
  ![atol-logo](http://www.atol.ru/site_styles/img/logo-red.png)
3
3
 
4
- [![Gem Version](https://badge.fury.io/rb/atol.svg)](https://badge.fury.io/rb/atol) [![BuildStatus](https://travis-ci.org/GeorgeGorbanev/atol-rb.png)](https://travis-ci.org/GeorgeGorbanev/atol-rb) [![Maintainability](https://api.codeclimate.com/v1/badges/8c702db502a7a6abdcba/maintainability)](https://codeclimate.com/github/GeorgeGorbanev/atol-rb/maintainability) [![Coverage Status](https://coveralls.io/repos/github/GeorgeGorbanev/atol-rb/badge.svg?branch=master)](https://coveralls.io/github/GeorgeGorbanev/atol-rb?branch=master)
4
+ [![Gem Version](https://badge.fury.io/rb/atol.svg)](https://badge.fury.io/rb/atol) [![BuildStatus](https://travis-ci.org/sputnik8/atol-rb.png)](https://api.travis-ci.org/sputnik8/atol-rb.png) [![Maintainability](https://api.codeclimate.com/v1/badges/fb0179622d762c8157ba/maintainability)](https://codeclimate.com/github/sputnik8/atol-rb/maintainability) [![Coverage Status](https://coveralls.io/repos/github/sputnik8/atol-rb/badge.svg?branch=master)](https://coveralls.io/github/sputnik8/atol-rb?branch=master)
5
5
 
6
6
  # atol-rb
7
7
 
@@ -9,7 +9,7 @@
9
9
 
10
10
  ##### Совместимость
11
11
 
12
- Для корректной работы необходим интерпретатор Руби версии 2.2 и выше. Пакет работает с версией протокола v4.
12
+ Для корректной работы необходим интерпретатор Руби версии 2.5. Пакет работает с версией протокола v4.
13
13
 
14
14
 
15
15
  ## Использование
@@ -26,7 +26,7 @@ module Atol
26
26
  def call
27
27
  http_client = @config.http_client
28
28
  uri = URI("#{Atol::URL}/#{@config.group_code}/#{@operation}")
29
- req_headers = HEADERS.merge(Token: @token)
29
+ req_headers = HEADERS.merge('Token' => @token)
30
30
  req = http_client::Post.new(uri, req_headers)
31
31
  req.body = @body
32
32
 
@@ -33,7 +33,7 @@ module Atol
33
33
  result[:receipt][:attributes][:phone] = @phone unless @phone.empty?
34
34
  result[:service][:callback_url] = @config.callback_url if @config.callback_url
35
35
 
36
- total = @items.sum(0) { |item| item[:sum] }
36
+ total = @items.inject(0) { |sum, item| sum += item[:sum] }
37
37
 
38
38
  result[:receipt][:total] = total
39
39
  result[:receipt][:payments][0][:sum] = total
@@ -13,7 +13,6 @@ module Atol
13
13
  @config.req_tries_number.times do |i|
14
14
  request = Atol::Request::GetToken.new(config: @config)
15
15
  response = request.call
16
- byebug
17
16
  encoded_body = response.body.encode(Atol::ENCODING)
18
17
  json = JSON.parse(encoded_body)
19
18
 
@@ -1,6 +1,6 @@
1
1
  module Atol
2
2
  module Version
3
3
  API = 'v4'.freeze
4
- LIB = '0.4'.freeze
4
+ LIB = '0.4.1'.freeze
5
5
  end
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: atol
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.4'
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - GeorgeGorbanev
@@ -144,7 +144,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
144
144
  version: '0'
145
145
  requirements: []
146
146
  rubyforge_project:
147
- rubygems_version: 2.6.14
147
+ rubygems_version: 2.7.3
148
148
  signing_key:
149
149
  specification_version: 4
150
150
  summary: ATOL KaaS client for Ruby