esignatur 1.2.3 → 1.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +4 -4
- data/README.md +2 -2
- data/lib/esignatur/order.rb +4 -2
- data/lib/esignatur/pades.rb +8 -4
- data/lib/esignatur/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: c426bae69658e6cdeb5bb6b0915fc49f924af767a44fbbf88b59d4f4b5fdfb63
|
|
4
|
+
data.tar.gz: f89779039b9d2f502d90fd75ed381eb7db01b50065921cb87e0d654c6161392d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: da704fed703023c1147ecad8977e0707c65c822d38636c65695b4ac2f5a8403684e70c0ebbb079f132fbc63a544a91ceab91ae1f7f3523606bc020764c9e2cf8
|
|
7
|
+
data.tar.gz: bf28a4239d0b4bd836c8e83489b7069796c2decbff56ce132db9f1747c8cc82bfe037ff02eda1ba77d58adb8e05927ef01502c785eb908101816cd00ab20f179
|
data/Gemfile.lock
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
esignatur (1.2.
|
|
4
|
+
esignatur (1.2.4)
|
|
5
5
|
activesupport (>= 3.0)
|
|
6
6
|
faraday (>= 0.10)
|
|
7
7
|
|
|
8
8
|
GEM
|
|
9
9
|
remote: https://rubygems.org/
|
|
10
10
|
specs:
|
|
11
|
-
activesupport (5.2.
|
|
11
|
+
activesupport (5.2.1)
|
|
12
12
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
|
13
13
|
i18n (>= 0.7, < 2)
|
|
14
14
|
minitest (~> 5.1)
|
|
@@ -30,7 +30,7 @@ GEM
|
|
|
30
30
|
faraday (0.15.2)
|
|
31
31
|
multipart-post (>= 1.2, < 3)
|
|
32
32
|
hashdiff (0.3.7)
|
|
33
|
-
i18n (1.
|
|
33
|
+
i18n (1.1.1)
|
|
34
34
|
concurrent-ruby (~> 1.0)
|
|
35
35
|
jaro_winkler (1.5.1)
|
|
36
36
|
json (2.1.0)
|
|
@@ -106,4 +106,4 @@ DEPENDENCIES
|
|
|
106
106
|
webmock (>= 3.4)
|
|
107
107
|
|
|
108
108
|
BUNDLED WITH
|
|
109
|
-
1.16.
|
|
109
|
+
1.16.6
|
data/README.md
CHANGED
|
@@ -37,8 +37,8 @@ order.create(some_order_params) # creates order on esignatur side
|
|
|
37
37
|
order.status # returns Status object
|
|
38
38
|
order.cancel(creator_id: '123') # => true/false
|
|
39
39
|
|
|
40
|
-
|
|
41
|
-
|
|
40
|
+
pade_list = order.pades_list
|
|
41
|
+
pade_list.first.document_data # decoded body of the document
|
|
42
42
|
```
|
|
43
43
|
|
|
44
44
|
## Development
|
data/lib/esignatur/order.rb
CHANGED
|
@@ -46,8 +46,10 @@ module Esignatur
|
|
|
46
46
|
api_post('Cancel/CancelOrder', data, headers: headers).success?
|
|
47
47
|
end
|
|
48
48
|
|
|
49
|
-
def
|
|
50
|
-
@
|
|
49
|
+
def pades_list
|
|
50
|
+
@pades_list ||= status.attributes['Documents'].map do |document|
|
|
51
|
+
Esignatur::Pades.new(order: self, attributes: document, api: api)
|
|
52
|
+
end
|
|
51
53
|
end
|
|
52
54
|
|
|
53
55
|
def source_document
|
data/lib/esignatur/pades.rb
CHANGED
|
@@ -10,19 +10,23 @@ module Esignatur
|
|
|
10
10
|
|
|
11
11
|
attr_reader :attributes, :order
|
|
12
12
|
|
|
13
|
-
def initialize(order:, api:)
|
|
14
|
-
@attributes =
|
|
13
|
+
def initialize(order:, attributes: {}, api:)
|
|
14
|
+
@attributes = attributes
|
|
15
15
|
@order = order
|
|
16
16
|
@api = api
|
|
17
17
|
end
|
|
18
18
|
|
|
19
19
|
def document_data
|
|
20
|
-
fetch
|
|
20
|
+
fetch unless attributes.key?('DocumentData')
|
|
21
21
|
Base64.decode64(attributes.fetch('DocumentData'))
|
|
22
22
|
end
|
|
23
23
|
|
|
24
|
+
def document_id
|
|
25
|
+
attributes['DocumentId']
|
|
26
|
+
end
|
|
27
|
+
|
|
24
28
|
def fetch
|
|
25
|
-
response = api_post('Pades/Download', 'Id' => order.id, '
|
|
29
|
+
response = api_post('Pades/Download', 'Id' => order.id, 'AgreementId' => attributes['AgreementId'])
|
|
26
30
|
@attributes = response.json_body if errors.empty?
|
|
27
31
|
self
|
|
28
32
|
end
|
data/lib/esignatur/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: esignatur
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.2.
|
|
4
|
+
version: 1.2.4
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Povilas Jurcys
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2019-01-
|
|
11
|
+
date: 2019-01-15 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: faraday
|