bunq_rb 0.0.12 → 0.0.13

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
  SHA1:
3
- metadata.gz: 693529d1884015bbf50b53fa79d556ba98f3ae37
4
- data.tar.gz: 1ff6ecbab313484d575ea35555eab08ea254c027
3
+ metadata.gz: 72b04e1496a080336859483c426214a19c5744d1
4
+ data.tar.gz: 80bbc1382e16645a932f947e355160d6563cee65
5
5
  SHA512:
6
- metadata.gz: c90cb43ec99dbd38383dd5b8b598607f12827b73e3154c5f1fce74705b70e65aecf8849eab207e18962bf2d05a921fc0c18d647d78691f158bbf46d74dc1462a
7
- data.tar.gz: 897b34166a969ae864121921a7271b2e2e48f88811ffb9fbecb601f492a006e0c8e4bc4428c5a8033b5620ecf4589b9236de1e5b3fd84d5847be3c7dc5a0f6ac
6
+ metadata.gz: 82f61f067739ffd939cfa1d5cdcaf1b4bcd0ff342432adb5a186207669d1169cfc2d328628e01fc179c2476ec3d6b7f94ddc91c9d912ef99071d19c786db1da2
7
+ data.tar.gz: 217344c642a888358c7fd61c132149ab00a71bf634754b737d8d0d8cbe2f29e2558db8b904ce18eb2f43effa33f24e20d16d2755e918a9d2d830f754768e2d40
data/README.md CHANGED
@@ -141,6 +141,8 @@ end
141
141
  - Schedule user
142
142
  - MONETARY ACCOUNTS
143
143
  - Monetary account
144
+ - ~~LIST~~
145
+ - GET
144
146
  - Monetary account bank
145
147
  - PAYMENTS
146
148
  - Payment
@@ -195,8 +197,12 @@ end
195
197
  - CALLBACKS
196
198
  - Certificate pinned
197
199
  - ATTACHMENTS
198
- - Avatar
199
- - Attachment public
200
+ - ~~Avatar~~
201
+ - POST
202
+ - GET
203
+ - ~~Attachment public~~
204
+ - POST
205
+ - GET
200
206
  - Attachment public content
201
207
  - ~~Attachment monetary account~~
202
208
  - Attachment tab
data/bunq_rb.gemspec CHANGED
@@ -30,8 +30,5 @@ Gem::Specification.new do |spec|
30
30
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
31
31
  spec.require_paths = ["lib"]
32
32
 
33
- spec.add_dependency "faraday"
34
- spec.add_dependency "addressable"
35
- spec.add_dependency "faraday_middleware"
36
- spec.add_dependency "activesupport"
33
+ spec.add_dependency "spyke"
37
34
  end
@@ -51,6 +51,12 @@ require_relative "objects/permitted_ip"
51
51
  require_relative "objects/monetary_account"
52
52
  require_relative "objects/attachment_monetary_account"
53
53
  require_relative "objects/request_inquiry"
54
+ require_relative "objects/avatar"
55
+ require_relative "objects/permitted_ip"
56
+ require_relative "objects/attachment_public"
57
+ require_relative "objects/avatar"
58
+ require_relative "objects/cash_register"
59
+ require_relative "objects/tab_usage_single"
54
60
 
55
61
  module BunqRb
56
62
  # Client
@@ -38,7 +38,6 @@ class SignRequest < Faraday::Middleware
38
38
  str = request_string
39
39
  str << sorted_headers.join("\n") << "\n\n"
40
40
  str << body
41
- str
42
41
  end
43
42
 
44
43
  def body
@@ -50,7 +49,8 @@ class SignRequest < Faraday::Middleware
50
49
  end
51
50
 
52
51
  def image?
53
- @env[:url].to_s.match(%r{v1\/user\/.*\/monetary-account\/.*\/attachment})
52
+ @env[:url].to_s.match(%r{v1\/user\/.*\/monetary-account\/.*\/attachment}) ||
53
+ @env[:url].to_s.match(%r{v1\/attachment-public})
54
54
  end
55
55
 
56
56
  def request_string
@@ -0,0 +1,23 @@
1
+ module BunqRb
2
+ # AttachmentPublic
3
+ class AttachmentPublic
4
+ URI = "/v1/attachment-public".freeze
5
+
6
+ attr_reader :uuid
7
+
8
+ def initialize(hsh = {})
9
+ @uuid = hsh["uuid"]
10
+ end
11
+
12
+ def self.create(hash = {})
13
+ response = Client.send_method(:post, URI, hash)
14
+ new(response[0]["Uuid"])
15
+ end
16
+
17
+ def self.find(id)
18
+ uri = [URI, id].join("/")
19
+ response = Client.send_method(:get, uri)
20
+ new(response[0]["AttachmentPublic"])
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,23 @@
1
+ module BunqRb
2
+ # Avatar
3
+ class Avatar
4
+ URI = "/v1/avatar".freeze
5
+
6
+ attr_reader :uuid
7
+
8
+ def initialize(hsh = {})
9
+ @uuid = hsh["uuid"]
10
+ end
11
+
12
+ def self.create(hash = {})
13
+ response = Client.send_method(:post, URI, hash)
14
+ new(response[0]["Uuid"])
15
+ end
16
+
17
+ def self.find(id)
18
+ uri = [URI, id].join("/")
19
+ response = Client.send_method(:get, uri)
20
+ new(response[0]["Avatar"])
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,26 @@
1
+ module BunqRb
2
+ # CashRegister
3
+ class CashRegister
4
+ include BunqRb::Shared
5
+
6
+ implements :post, :puts, :get, :list
7
+
8
+ attr_reader :id, :name, :status
9
+
10
+ def initialize(hsh = {})
11
+ @id = hsh["id"]
12
+ @name = hsh["name"]
13
+ @status = hsh["status"]
14
+ end
15
+
16
+ def self.create(hsh = {}, user_id, monetary_account_id)
17
+ url = uri(user_id, monetary_account_id)
18
+ response = Client.send_method(:post, url, hsh)
19
+ response[0]["Id"]
20
+ end
21
+
22
+ def self.uri(user_id, monetary_account_id)
23
+ "/v1/user/#{user_id}/monetary-account/#{monetary_account_id}/cash-register"
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,26 @@
1
+ module BunqRb
2
+ # TabUsageSingle
3
+ class TabUsageSingle
4
+ attr_reader :uuid
5
+
6
+ def initialize(hsh = {})
7
+ @uuid = hsh["uuid"]
8
+ end
9
+
10
+ def self.uri(user_id, monetary_account_id, cash_register_id)
11
+ "/v1/user/#{user_id}/monetary-account/#{monetary_account_id}/cash-register/#{cash_register_id}/tab-usage-single"
12
+ end
13
+
14
+ def self.create(hash = {}, user_id, monetary_account_id, cash_register_id)
15
+ response = Client.send_method(:post, uri(user_id, monetary_account_id, cash_register_id), hash)
16
+ new(response[0]["Uuid"])
17
+ end
18
+
19
+ def update(hsh = {}, user_id, monetary_account_id, cash_register_id)
20
+ url = self.class.uri(user_id, monetary_account_id, cash_register_id)
21
+ full_path = [url, uuid].join("/")
22
+ response = Client.send_method(:put, full_path, hsh)
23
+ response[0]["Uuid"]
24
+ end
25
+ end
26
+ end
@@ -1,3 +1,3 @@
1
1
  module BunqRb
2
- VERSION = "0.0.12".freeze
2
+ VERSION = "0.0.13".freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bunq_rb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.12
4
+ version: 0.0.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dunya Kirkali
@@ -9,52 +9,10 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2018-03-12 00:00:00.000000000 Z
12
+ date: 2018-03-13 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
- name: faraday
16
- requirement: !ruby/object:Gem::Requirement
17
- requirements:
18
- - - ">="
19
- - !ruby/object:Gem::Version
20
- version: '0'
21
- type: :runtime
22
- prerelease: false
23
- version_requirements: !ruby/object:Gem::Requirement
24
- requirements:
25
- - - ">="
26
- - !ruby/object:Gem::Version
27
- version: '0'
28
- - !ruby/object:Gem::Dependency
29
- name: addressable
30
- requirement: !ruby/object:Gem::Requirement
31
- requirements:
32
- - - ">="
33
- - !ruby/object:Gem::Version
34
- version: '0'
35
- type: :runtime
36
- prerelease: false
37
- version_requirements: !ruby/object:Gem::Requirement
38
- requirements:
39
- - - ">="
40
- - !ruby/object:Gem::Version
41
- version: '0'
42
- - !ruby/object:Gem::Dependency
43
- name: faraday_middleware
44
- requirement: !ruby/object:Gem::Requirement
45
- requirements:
46
- - - ">="
47
- - !ruby/object:Gem::Version
48
- version: '0'
49
- type: :runtime
50
- prerelease: false
51
- version_requirements: !ruby/object:Gem::Requirement
52
- requirements:
53
- - - ">="
54
- - !ruby/object:Gem::Version
55
- version: '0'
56
- - !ruby/object:Gem::Dependency
57
- name: activesupport
15
+ name: spyke
58
16
  requirement: !ruby/object:Gem::Requirement
59
17
  requirements:
60
18
  - - ">="
@@ -93,6 +51,9 @@ files:
93
51
  - lib/bunq_rb/client/sign_request.rb
94
52
  - lib/bunq_rb/configuration.rb
95
53
  - lib/bunq_rb/objects/attachment_monetary_account.rb
54
+ - lib/bunq_rb/objects/attachment_public.rb
55
+ - lib/bunq_rb/objects/avatar.rb
56
+ - lib/bunq_rb/objects/cash_register.rb
96
57
  - lib/bunq_rb/objects/device.rb
97
58
  - lib/bunq_rb/objects/device_server.rb
98
59
  - lib/bunq_rb/objects/installation.rb
@@ -101,6 +62,7 @@ files:
101
62
  - lib/bunq_rb/objects/permitted_ip.rb
102
63
  - lib/bunq_rb/objects/request_inquiry.rb
103
64
  - lib/bunq_rb/objects/session_server.rb
65
+ - lib/bunq_rb/objects/tab_usage_single.rb
104
66
  - lib/bunq_rb/objects/user.rb
105
67
  - lib/bunq_rb/version.rb
106
68
  homepage: https://github.com/ahtung/bunq_rb