cobrato-client 0.2.9 → 0.2.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +3 -3
- data/Gemfile.lock +1 -1
- data/lib/cobrato.rb +5 -0
- data/lib/cobrato/entities/webhook.rb +2 -1
- data/lib/cobrato/signature.rb +14 -0
- data/lib/cobrato/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 60bd1d0603336c202bdd09716f01067fdf7bd706
|
4
|
+
data.tar.gz: 926a5e992a191427aa4959b3602c4d6643561666
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 162f90efc92c60d7132221b1adbf5ccfa0be5f267b27dedeafd473893380a087d7a060c07d02667e66be5c82b3e95bb8a9894d337c2b5239d16572b64efaaa0c
|
7
|
+
data.tar.gz: ab07b21905f923dc22cd41c53f88fe72607151d5b3a6d0c61aff22be39b8000d70a6f39f84218b3892db907fe3173d3e4b81e4502d78fbc1820814d286995615
|
data/.travis.yml
CHANGED
data/Gemfile.lock
CHANGED
data/lib/cobrato.rb
CHANGED
@@ -6,6 +6,7 @@ require "cobrato/version"
|
|
6
6
|
require "cobrato/configuration"
|
7
7
|
require "cobrato/client"
|
8
8
|
require "cobrato/http"
|
9
|
+
require "cobrato/signature"
|
9
10
|
|
10
11
|
require "cobrato/entities/base"
|
11
12
|
require "cobrato/entities/payee"
|
@@ -43,4 +44,8 @@ module Cobrato
|
|
43
44
|
def self.subscribe(event, callback)
|
44
45
|
Wisper.subscribe(callback, on: event, with: :call)
|
45
46
|
end
|
47
|
+
|
48
|
+
def self.signature(secret)
|
49
|
+
Signature.new(secret)
|
50
|
+
end
|
46
51
|
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
module Cobrato
|
2
|
+
class Signature
|
3
|
+
attr_accessor :secret
|
4
|
+
|
5
|
+
def initialize(secret)
|
6
|
+
@secret = secret
|
7
|
+
end
|
8
|
+
|
9
|
+
def check?(cobrato_request_id, signature_to_check, body)
|
10
|
+
cobrato_signature = OpenSSL::HMAC.hexdigest(OpenSSL::Digest.new('sha1'), secret, "#{cobrato_request_id}#{body}")
|
11
|
+
signature_to_check == cobrato_signature
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
data/lib/cobrato/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cobrato-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Marcio Ricardo Santos
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: exe
|
12
12
|
cert_chain: []
|
13
|
-
date: 2016-
|
13
|
+
date: 2016-03-23 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: typhoeus
|
@@ -214,6 +214,7 @@ files:
|
|
214
214
|
- lib/cobrato/resources/remittance_cnab.rb
|
215
215
|
- lib/cobrato/resources/webhook.rb
|
216
216
|
- lib/cobrato/response.rb
|
217
|
+
- lib/cobrato/signature.rb
|
217
218
|
- lib/cobrato/version.rb
|
218
219
|
homepage: https://github.com/myfreecomm/cobrato-client-ruby/
|
219
220
|
licenses: []
|
@@ -235,7 +236,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
235
236
|
version: '0'
|
236
237
|
requirements: []
|
237
238
|
rubyforge_project:
|
238
|
-
rubygems_version: 2.
|
239
|
+
rubygems_version: 2.6.1
|
239
240
|
signing_key:
|
240
241
|
specification_version: 4
|
241
242
|
summary: This is the official Ruby client for the Cobrato API.
|