atol 0.1.2 → 0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/atol.rb +1 -1
- data/lib/atol/request/get_document_state.rb +4 -1
- data/lib/atol/request/get_token.rb +3 -1
- data/lib/atol/request/post_document.rb +1 -1
- data/lib/atol/request/post_document/item/body.rb +3 -7
- data/lib/atol/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 17d4ad372d79d210e557557a3f6cc80f77068e75
|
4
|
+
data.tar.gz: da90b555963964a89478f4d1d49c04a3b8555020
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7ae186d1878efeaef1b3a7a91cac0a63b2b3ba064e41126d36d2ecbcca911975b9b8065f814a51c87935c9fa15c38857ff595ce2c28ac973413bf56f5bb43864
|
7
|
+
data.tar.gz: 85d2b78aa0f1ece50c515231666490368521fd5614fe659670f393403a5b0b705e7fde0d7c6580a58ff1ba1d0703fae0cb5baeaabd77ca825b32c3b906164294
|
data/Gemfile.lock
CHANGED
data/lib/atol.rb
CHANGED
@@ -4,7 +4,7 @@ require 'atol/request'
|
|
4
4
|
require 'atol/transaction'
|
5
5
|
|
6
6
|
module Atol
|
7
|
-
URL = "
|
7
|
+
URL = "https://online.atol.ru/possystem/#{Atol::Version::API}".freeze
|
8
8
|
ENCODING = 'utf-8'.freeze
|
9
9
|
TIMESTAMP_FORMAT = '%d.%m.%Y %H:%M:%S'.freeze
|
10
10
|
|
@@ -28,7 +28,9 @@ module Atol
|
|
28
28
|
uri = URI(Atol::URL + PATH)
|
29
29
|
uri.query = URI.encode_www_form(login: login, pass: password)
|
30
30
|
|
31
|
-
Net::HTTP.
|
31
|
+
http = Net::HTTP.new(uri.host, uri.port)
|
32
|
+
http.use_ssl = true
|
33
|
+
http.get(uri.request_uri)
|
32
34
|
end
|
33
35
|
|
34
36
|
private
|
@@ -14,19 +14,15 @@ module Atol
|
|
14
14
|
@body[:name] = name
|
15
15
|
@body[:price] = price.to_f
|
16
16
|
@body[:quantity] = quantity.to_f
|
17
|
-
@body[:sum] = @body[:price] * @body[:quantity]
|
17
|
+
@body[:sum] = (@body[:price] * @body[:quantity]).to_f.round(2)
|
18
18
|
@body[:tax] = @config.default_tax
|
19
19
|
end
|
20
20
|
|
21
21
|
def to_h
|
22
|
-
body.clone
|
22
|
+
@body.clone
|
23
23
|
end
|
24
|
-
|
25
|
-
private
|
26
|
-
|
27
|
-
attr_reader :body
|
28
24
|
end
|
29
25
|
end
|
30
26
|
end
|
31
27
|
end
|
32
|
-
end
|
28
|
+
end
|
data/lib/atol/version.rb
CHANGED
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
|
+
version: '0.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-
|
11
|
+
date: 2018-03-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: anyway_config
|