esignatur 1.1.1 → 1.2.1

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
2
  SHA256:
3
- metadata.gz: 3df94f222684c0d0958e2bd821eaa47407c40027da78ec96787456c16074af3b
4
- data.tar.gz: 3098700001492334f205e87ff4e87c203f9be7c2bb595659079932911267f239
3
+ metadata.gz: 0ec5608fc8c46c4b6204d2318483a34685b3bd42e266ba7f650f809ae2a8ecae
4
+ data.tar.gz: df22ce9c51117cb6ed043067b72c7eb9afaae6daaa33b972aff18a5fe97d130b
5
5
  SHA512:
6
- metadata.gz: 94b31a2004fd39adf2aec412039a5e5e4e81741e179c468b47b8e95b2cfa95c6a7e6ba90da2e9fed4d1a816c1287677e4af1a8c64a483351a5e02a45c6fdf0e4
7
- data.tar.gz: '036769e4f30f82474f5309c2d8c2c0e2e8194c584bf262ac448b2d71af055d21eac957bedc103995d0a2de6a1fb0a486f63030f89308be874654c16e78b5d508'
6
+ metadata.gz: 32812bb4fc28a496f70a888989e2e6c63bd4a44b24f55e02a8cbdc5f50b3c345a6962d88d4dddb2579f366440a8ca22d885d91236c2643aa9ae79a8a2ac3eef5
7
+ data.tar.gz: fef6921c00bbbae2f4c528fe4f4aa1c03e16baab87c397389160b684a1dc59a1a547453b8e3c6de62045b084c852b137d42862ea2274f5065a1fe017feef3005
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- esignatur (1.1.1)
4
+ esignatur (1.2.1)
5
5
  activesupport (>= 3.0)
6
6
  faraday (>= 0.10)
7
7
 
data/README.md CHANGED
@@ -35,7 +35,7 @@ order = esignatur.orders.find(esignatur_order_id)
35
35
  order = esignatur.orders.build
36
36
  order.create(some_order_params) # creates order on esignatur side
37
37
  order.status # returns Status object
38
- order.cancel # => true/false
38
+ order.cancel(creator_id: '123') # => true/false
39
39
 
40
40
  pades = order.pades
41
41
  pades.document_data # decoded body of the document
@@ -13,8 +13,8 @@ module Esignatur
13
13
 
14
14
  protected
15
15
 
16
- def api_post(relative_url, data)
17
- make_api_request(:post, relative_url, data: data)
16
+ def api_post(relative_url, data, **options)
17
+ make_api_request(:post, relative_url, data: data, **options)
18
18
  end
19
19
 
20
20
  def api_get(relative_url, **options)
@@ -35,8 +35,14 @@ module Esignatur
35
35
  @status ||= Esignatur::Status.new(order: self, api: api).tap(&:fetch)
36
36
  end
37
37
 
38
- def cancel
39
- api_get("Order/Cancel/#{id}").success?
38
+ def cancel(attributes)
39
+ camelized_attributes = attributes.transform_keys(&:to_s).transform_keys(&:camelize)
40
+ creator_id = camelized_attributes.delete('CreatorId')
41
+
42
+ data = { 'OrderId' => id }.merge(camelized_attributes.compact)
43
+ headers = { 'X-eSignatur-CreatorId': creator_id }
44
+
45
+ api_post('Cancel/CancelOrder', data, headers: headers).success?
40
46
  end
41
47
 
42
48
  def pades
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Esignatur
4
- VERSION = '1.1.1'
4
+ VERSION = '1.2.1'
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.1.1
4
+ version: 1.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Povilas Jurcys
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-10-15 00:00:00.000000000 Z
11
+ date: 2018-11-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday