Sha256: bea1b771b43a9b4c07c9d2500f7f62f8d9a51ffe3f9e033177c77896dd5f925f

Contents?: true

Size: 363 Bytes

Versions: 110

Compression:

Stored size: 363 Bytes

Contents

module Braintree
  class SignatureService
    attr_reader :key

    def initialize(key, digest=Braintree::Digest)
      @key = key
      @digest = digest
    end

    def sign(data)
      query_string = Util.hash_to_query_string(data)
      "#{hash(query_string)}|#{query_string}"
    end

    def hash(data)
      @digest.hexdigest(@key, data)
    end
  end
end

Version data entries

110 entries across 110 versions & 1 rubygems

Version Path
braintree-2.59.0 lib/braintree/signature_service.rb
braintree-2.58.0 lib/braintree/signature_service.rb
braintree-2.57.0 lib/braintree/signature_service.rb
braintree-2.56.0 lib/braintree/signature_service.rb
braintree-2.55.0 lib/braintree/signature_service.rb
braintree-2.54.0 lib/braintree/signature_service.rb
braintree-2.50.0 lib/braintree/signature_service.rb
braintree-2.49.0 lib/braintree/signature_service.rb
braintree-2.48.1 lib/braintree/signature_service.rb
braintree-2.48.0 lib/braintree/signature_service.rb
braintree-2.47.0 lib/braintree/signature_service.rb
braintree-2.46.0 lib/braintree/signature_service.rb
braintree-2.45.0 lib/braintree/signature_service.rb
braintree-2.44.0 lib/braintree/signature_service.rb
braintree-2.43.0 lib/braintree/signature_service.rb
braintree-2.42.0 lib/braintree/signature_service.rb
braintree-2.41.0 lib/braintree/signature_service.rb
braintree-2.40.0 lib/braintree/signature_service.rb
braintree-2.39.0 lib/braintree/signature_service.rb
braintree-2.38.0 lib/braintree/signature_service.rb