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.37.0 lib/braintree/signature_service.rb
braintree-2.36.0 lib/braintree/signature_service.rb
braintree-2.35.0 lib/braintree/signature_service.rb
braintree-2.34.1 lib/braintree/signature_service.rb
braintree-2.34.0 lib/braintree/signature_service.rb
braintree-2.33.1 lib/braintree/signature_service.rb
braintree-2.33.0 lib/braintree/signature_service.rb
braintree-2.32.1 lib/braintree/signature_service.rb
braintree-2.31.0 lib/braintree/signature_service.rb
braintree-2.30.2 lib/braintree/signature_service.rb