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 +4 -4
- data/lib/juno.rb +1 -1
- data/lib/juno/transaction/charges.rb +18 -16
- data/lib/juno/version.rb +1 -1
- data/lib/juno/webhooks.rb +6 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 16d804e90a8b503b281fdcacb0a84cecc056d95dc613dc8772ebfe5a2a6a5c8b
|
4
|
+
data.tar.gz: 0ca796a44f4ca8b043134906401b0aaa1b75288ffa2da6f749789bcc1ab659e3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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 :
|
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
|
-
|
5
|
-
class
|
6
|
-
|
7
|
-
|
8
|
-
|
4
|
+
module Transaction
|
5
|
+
class Charges < Juno::Resource
|
6
|
+
class << self
|
7
|
+
def create(body)
|
8
|
+
post('/charges', body)
|
9
|
+
end
|
9
10
|
|
10
|
-
|
11
|
-
|
12
|
-
|
11
|
+
def list
|
12
|
+
get('/charges')
|
13
|
+
end
|
13
14
|
|
14
|
-
|
15
|
-
|
16
|
-
|
15
|
+
def show(id)
|
16
|
+
get("/charges/#{id}")
|
17
|
+
end
|
17
18
|
|
18
|
-
|
19
|
-
|
20
|
-
|
19
|
+
def cancel(id)
|
20
|
+
put("/charges/#{id}/cancelation")
|
21
|
+
end
|
21
22
|
|
22
|
-
|
23
|
-
|
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
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.
|
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-
|
11
|
+
date: 2021-07-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|