Sha256: f0d6d082ab3b9340fc0cef72e780d63704ebfb96dadbe82cbb00a1496e3c5d86

Contents?: true

Size: 378 Bytes

Versions: 36

Compression:

Stored size: 378 Bytes

Contents

module Billimatic
  class Signature
    attr_accessor :secret

    def initialize(secret)
      @secret = secret
    end

    def check?(billimatic_request_id, signature_to_check, body)
      billimatic_signature = OpenSSL::HMAC.hexdigest(OpenSSL::Digest.new('sha1'), secret, "#{billimatic_request_id}#{body}")
      signature_to_check == billimatic_signature
    end
  end
end

Version data entries

36 entries across 36 versions & 1 rubygems

Version Path
billimatic-client-1.0.1 lib/billimatic/signature.rb
billimatic-client-1.0.0 lib/billimatic/signature.rb
billimatic-client-0.22.1 lib/billimatic/signature.rb
billimatic-client-0.22.0 lib/billimatic/signature.rb
billimatic-client-0.21.0 lib/billimatic/signature.rb
billimatic-client-0.20.0 lib/billimatic/signature.rb
billimatic-client-0.19.1 lib/billimatic/signature.rb
billimatic-client-0.19.0 lib/billimatic/signature.rb
billimatic-client-0.18.1 lib/billimatic/signature.rb
billimatic-client-0.18.0 lib/billimatic/signature.rb
billimatic-client-0.17.0 lib/billimatic/signature.rb
billimatic-client-0.16.0 lib/billimatic/signature.rb
billimatic-client-0.15.0 lib/billimatic/signature.rb
billimatic-client-0.14.1 lib/billimatic/signature.rb
billimatic-client-0.14.0 lib/billimatic/signature.rb
billimatic-client-0.13.0 lib/billimatic/signature.rb
billimatic-client-0.12.0 lib/billimatic/signature.rb
billimatic-client-0.11.3 lib/billimatic/signature.rb
billimatic-client-0.11.2 lib/billimatic/signature.rb
billimatic-client-0.11.1 lib/billimatic/signature.rb