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-4.23.0 lib/braintree/signature_service.rb
braintree-4.22.0 lib/braintree/signature_service.rb
braintree-4.21.0 lib/braintree/signature_service.rb
braintree-4.20.0 lib/braintree/signature_service.rb
braintree-4.19.0 lib/braintree/signature_service.rb
braintree-4.18.0 lib/braintree/signature_service.rb
braintree-4.17.0 lib/braintree/signature_service.rb
braintree-4.16.0 lib/braintree/signature_service.rb
braintree-4.15.0 lib/braintree/signature_service.rb
braintree-4.14.0 lib/braintree/signature_service.rb
braintree-4.13.0 lib/braintree/signature_service.rb
braintree-4.12.0 lib/braintree/signature_service.rb
braintree-4.11.0 lib/braintree/signature_service.rb
braintree-4.10.0 lib/braintree/signature_service.rb
braintree-4.9.0 lib/braintree/signature_service.rb
braintree-4.8.0 lib/braintree/signature_service.rb
braintree-4.7.0 lib/braintree/signature_service.rb
braintree-4.6.0 lib/braintree/signature_service.rb
braintree-4.5.0 lib/braintree/signature_service.rb
braintree-4.4.0 lib/braintree/signature_service.rb