atol 0.4.1 → 0.4.2

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
- SHA256:
3
- metadata.gz: 9e009c1d0d842a48e5775c9944271c78a10bf63484eb9ef09e15df4ebbde32b2
4
- data.tar.gz: 11896f87fc35898404c80e09b3f52a74c067d2127fc313398fdf5ab5f75c9a28
2
+ SHA1:
3
+ metadata.gz: e641c3da1fd82f9b25d4d6f7945758211f2a304c
4
+ data.tar.gz: ffa5be8712a96c1fa5767289e5fb26735ecfd573
5
5
  SHA512:
6
- metadata.gz: 82ec658605b79be5c565443b50442795ea5577863da30c8802303febd34b56b7664d99be46a47525a732f8506497d24cce7dc346fbbcdbb23d25d2aaef49f42b
7
- data.tar.gz: 11eacd2d1d7cd711f70a2d47201d36b60e99de94afa40f7c00307eace0eff1cfc570ebf9f83acfbea6b7b67258ae76164fc92a762ddfa4a3fc6376ca61dd732c
6
+ metadata.gz: 8af070acadff92c07ea6bb74e21ea48b6ac78b94baea32edab622a60b44b3e53ca745a1033611c847cdf508bef08adc708626b37d1d80f6548471ccd580faa1b
7
+ data.tar.gz: 8d6c72068f8ba205e7260ce7f1f22beb6e365406a16171e11c0157f88cc536a3b74747947b9c906c6e77142d32456cb6d935c38be52a442a5739f34b2558811f
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- atol (0.4.1)
4
+ atol (0.4.2)
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.4.1)
12
+ anyway_config (1.1.3)
13
13
  ast (2.3.0)
14
14
  coveralls (0.8.21)
15
15
  json (>= 1.8, < 3)
data/lib/atol.rb CHANGED
@@ -16,3 +16,4 @@ module Atol
16
16
  end
17
17
  end
18
18
  end
19
+
data/lib/atol/config.rb CHANGED
@@ -11,6 +11,7 @@ module Atol
11
11
  :default_sno,
12
12
  :default_tax,
13
13
  :callback_url,
14
+ :company_email,
14
15
  req_tries_number: 3,
15
16
  default_payment_type: 1,
16
17
  http_client: Net::HTTP
@@ -29,8 +29,8 @@ module Atol
29
29
  def body
30
30
  @body ||= body_template.tap do |result|
31
31
  result[:external_id] = @external_id
32
- result[:receipt][:attributes][:email] = @email unless @email.empty?
33
- result[:receipt][:attributes][:phone] = @phone unless @phone.empty?
32
+ result[:receipt][:client][:email] = @email unless @email.empty?
33
+ result[:receipt][:client][:phone] = @phone unless @phone.empty?
34
34
  result[:service][:callback_url] = @config.callback_url if @config.callback_url
35
35
 
36
36
  total = @items.inject(0) { |sum, item| sum += item[:sum] }
@@ -44,8 +44,12 @@ module Atol
44
44
  def body_template
45
45
  {
46
46
  receipt: {
47
- attributes: {
48
- sno: @config.default_sno
47
+ client: {},
48
+ company: {
49
+ inn: @config.inn.to_s,
50
+ sno: @config.default_sno,
51
+ payment_address: @config.payment_address,
52
+ email: @config.company_email
49
53
  },
50
54
  items: [],
51
55
  payments: [
@@ -55,10 +59,7 @@ module Atol
55
59
  }
56
60
  ]
57
61
  },
58
- service: {
59
- inn: @config.inn.to_s,
60
- payment_address: @config.payment_address
61
- },
62
+ service: {},
62
63
  timestamp: Time.now.strftime(Atol::TIMESTAMP_FORMAT)
63
64
  }
64
65
  end
data/lib/atol/version.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  module Atol
2
2
  module Version
3
3
  API = 'v4'.freeze
4
- LIB = '0.4.1'.freeze
4
+ LIB = '0.4.2'.freeze
5
5
  end
6
6
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: atol
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - GeorgeGorbanev
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-12-14 00:00:00.000000000 Z
11
+ date: 2018-12-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: anyway_config
@@ -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.7.3
147
+ rubygems_version: 2.6.14
148
148
  signing_key:
149
149
  specification_version: 4
150
150
  summary: ATOL KaaS client for Ruby