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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d5497bbf3753aeee76333422aa348fd1aa2deb20bf2c465c137343cad2d49e4f
4
- data.tar.gz: e53684532371b8343322af602cb32ed9e906f36024870b1ad6600b35ab103f74
3
+ metadata.gz: c426bae69658e6cdeb5bb6b0915fc49f924af767a44fbbf88b59d4f4b5fdfb63
4
+ data.tar.gz: f89779039b9d2f502d90fd75ed381eb7db01b50065921cb87e0d654c6161392d
5
5
  SHA512:
6
- metadata.gz: a3a2ee4c7675b8d825d092ea7466ed85b4a5ac8cd2106a2bfa6d3cbe4009339e79e25fcb9fe336f436fd5176ef9c3fbfd4ca3f6bc2084d305e3c6c34416df71b
7
- data.tar.gz: 99905e58881f89e8d5aad3070cb03655cb4753a9ef2f922efbf672654e823c1fa40ccab0f0ecd5781f571c13dece480c94553c5317ac0e870773e60471018358
6
+ metadata.gz: da704fed703023c1147ecad8977e0707c65c822d38636c65695b4ac2f5a8403684e70c0ebbb079f132fbc63a544a91ceab91ae1f7f3523606bc020764c9e2cf8
7
+ data.tar.gz: bf28a4239d0b4bd836c8e83489b7069796c2decbff56ce132db9f1747c8cc82bfe037ff02eda1ba77d58adb8e05927ef01502c785eb908101816cd00ab20f179
@@ -1,14 +1,14 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- esignatur (1.2.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.0)
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.0.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.2
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
- pades = order.pades
41
- pades.document_data # decoded body of the document
40
+ pade_list = order.pades_list
41
+ pade_list.first.document_data # decoded body of the document
42
42
  ```
43
43
 
44
44
  ## Development
@@ -46,8 +46,10 @@ module Esignatur
46
46
  api_post('Cancel/CancelOrder', data, headers: headers).success?
47
47
  end
48
48
 
49
- def pades
50
- @pades ||= Esignatur::Pades.new(order: self, api: api)
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
@@ -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 if attributes.empty?
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, 'DocumentIndex' => 0)
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Esignatur
4
- VERSION = '1.2.3'
4
+ VERSION = '1.2.4'
5
5
  end
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.3
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-09 00:00:00.000000000 Z
11
+ date: 2019-01-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday