juno-sdk 0.2.0 → 0.2.1

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: 2e1be87c593b5a1575e84f69f01365ec09788af1c5eba92c44dbf9f510b8818f
4
- data.tar.gz: 9c0e7d15f76dcaf966b7d2fa1c680f86e4ecce4cbc1147b68696beab24fe5244
3
+ metadata.gz: 16d804e90a8b503b281fdcacb0a84cecc056d95dc613dc8772ebfe5a2a6a5c8b
4
+ data.tar.gz: 0ca796a44f4ca8b043134906401b0aaa1b75288ffa2da6f749789bcc1ab659e3
5
5
  SHA512:
6
- metadata.gz: da974dc5798b77ff1162edd3e29c3ba7ebd0317308d70d8dfc4444dbac64a3c117ffc600fd028fe0e50797dc04dee38f00241819f730fbfef7e27d08243c03e0
7
- data.tar.gz: 52b11ec80c91b2ec03fe8d6126ee7abefe852a2e89131fda435c04801d69dbe8441cc9479059c9e7080ab18ec943cd86b3b405e23cd8ac83e347056a4517371e
6
+ metadata.gz: 6bd9aae782a99c9c7467ad0cbcdc87bec9655acfc1a09642eb3d31ceeada44e8a42ead73357be04f1b14384cb34948bb481fc3b5d1707406a1ec4bc444a321e9
7
+ data.tar.gz: e9445615b4151954a00768522e8acb17f927983b6ce8467ad74d349e28cc5ee354ced1bb3ad2d6fa15bc9818cc9cf5fc6e40c84058e47341a928c17ee70a082b
data/lib/juno.rb CHANGED
@@ -3,7 +3,7 @@
3
3
  module Juno
4
4
  autoload :Authorization, 'juno/authorization.rb'
5
5
  autoload :Configuration, 'juno/configuration.rb'
6
- autoload :Transaction, 'juno/charges.rb'
6
+ autoload :Charges, 'juno/transaction/charges.rb'
7
7
  autoload :Webhooks, 'juno/webhooks.rb'
8
8
  autoload :Resource, 'juno/resource.rb'
9
9
 
@@ -1,26 +1,28 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Juno
4
- class Charges < Juno::Resource
5
- class << self
6
- def create(body)
7
- post('/charges', body)
8
- end
4
+ module Transaction
5
+ class Charges < Juno::Resource
6
+ class << self
7
+ def create(body)
8
+ post('/charges', body)
9
+ end
9
10
 
10
- def list
11
- get('/charges')
12
- end
11
+ def list
12
+ get('/charges')
13
+ end
13
14
 
14
- def show(id)
15
- get("/charges/#{id}")
16
- end
15
+ def show(id)
16
+ get("/charges/#{id}")
17
+ end
17
18
 
18
- def cancel(id)
19
- put("/charges/#{id}/cancelation")
20
- end
19
+ def cancel(id)
20
+ put("/charges/#{id}/cancelation")
21
+ end
21
22
 
22
- def update_split(id)
23
- put("/charges/#{id}/split")
23
+ def update_split(id)
24
+ put("/charges/#{id}/split")
25
+ end
24
26
  end
25
27
  end
26
28
  end
data/lib/juno/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Juno
4
- VERSION = '0.2.0'
4
+ VERSION = '0.2.1'
5
5
  end
data/lib/juno/webhooks.rb CHANGED
@@ -24,6 +24,12 @@ module Juno
24
24
  def event_types
25
25
  get('/notifications/event-types')
26
26
  end
27
+
28
+ def valid_signature?(signature, secret, payload)
29
+ our_signature = OpenSSL::HMAC.hexdigest('SHA256', secret, payload)
30
+
31
+ our_signature.eql?(signature)
32
+ end
27
33
  end
28
34
  end
29
35
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: juno-sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nullbug
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-07-21 00:00:00.000000000 Z
11
+ date: 2021-07-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday