esignatur 1.2.2 → 1.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/esignatur/order.rb +5 -0
- data/lib/esignatur/source_document.rb +35 -0
- data/lib/esignatur/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d5497bbf3753aeee76333422aa348fd1aa2deb20bf2c465c137343cad2d49e4f
|
4
|
+
data.tar.gz: e53684532371b8343322af602cb32ed9e906f36024870b1ad6600b35ab103f74
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a3a2ee4c7675b8d825d092ea7466ed85b4a5ac8cd2106a2bfa6d3cbe4009339e79e25fcb9fe336f436fd5176ef9c3fbfd4ca3f6bc2084d305e3c6c34416df71b
|
7
|
+
data.tar.gz: 99905e58881f89e8d5aad3070cb03655cb4753a9ef2f922efbf672654e823c1fa40ccab0f0ecd5781f571c13dece480c94553c5317ac0e870773e60471018358
|
data/lib/esignatur/order.rb
CHANGED
@@ -2,6 +2,7 @@
|
|
2
2
|
|
3
3
|
require 'esignatur/api_resource'
|
4
4
|
require 'esignatur/pades'
|
5
|
+
require 'esignatur/source_document'
|
5
6
|
require 'esignatur/status'
|
6
7
|
require 'active_support/core_ext/string/inflections'
|
7
8
|
|
@@ -49,6 +50,10 @@ module Esignatur
|
|
49
50
|
@pades ||= Esignatur::Pades.new(order: self, api: api)
|
50
51
|
end
|
51
52
|
|
53
|
+
def source_document
|
54
|
+
@source_document ||= Esignatur::SourceDocument.new(order: self, api: api)
|
55
|
+
end
|
56
|
+
|
52
57
|
private
|
53
58
|
|
54
59
|
attr_reader :api
|
@@ -0,0 +1,35 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'esignatur/api_resource'
|
4
|
+
|
5
|
+
module Esignatur
|
6
|
+
# esignature SourceDocument document representation.
|
7
|
+
# More info: https://api.esignatur.dk/Documentation/SourceDocument
|
8
|
+
class SourceDocument
|
9
|
+
include ApiResource
|
10
|
+
|
11
|
+
attr_reader :attributes, :order
|
12
|
+
|
13
|
+
def initialize(order:, api:)
|
14
|
+
@attributes = {}
|
15
|
+
@order = order
|
16
|
+
@api = api
|
17
|
+
end
|
18
|
+
|
19
|
+
def document_data
|
20
|
+
fetch if attributes.empty?
|
21
|
+
Base64.decode64(attributes.fetch('DocumentData'))
|
22
|
+
end
|
23
|
+
|
24
|
+
def fetch
|
25
|
+
response = api_post('SourceDocument/Download',
|
26
|
+
'Id' => order.id, 'DocumentIndex' => 0)
|
27
|
+
@attributes = response.json_body if errors.empty?
|
28
|
+
self
|
29
|
+
end
|
30
|
+
|
31
|
+
private
|
32
|
+
|
33
|
+
attr_reader :api
|
34
|
+
end
|
35
|
+
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.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Povilas Jurcys
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-01-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -196,6 +196,7 @@ files:
|
|
196
196
|
- lib/esignatur/order.rb
|
197
197
|
- lib/esignatur/orders.rb
|
198
198
|
- lib/esignatur/pades.rb
|
199
|
+
- lib/esignatur/source_document.rb
|
199
200
|
- lib/esignatur/status.rb
|
200
201
|
- lib/esignatur/version.rb
|
201
202
|
homepage: https://github.com/samesystem/esignatur
|