lib/pagarme.rb in pagarme-1.0 vs lib/pagarme.rb in pagarme-1.1
- old
+ new
@@ -1,5 +1,6 @@
+require 'digest/sha1'
require 'pagarme/pagarme_object'
require 'pagarme/util'
require 'pagarme/model'
require 'pagarme/transaction_common'
require 'pagarme/customer'
@@ -29,16 +30,12 @@
def self.api_card_encryption_public_key
@@api_card_encryption_public_key
end
def self.full_api_url(relative_path)
- "#{@@api_endpoint}/#{@@api_version}#{relative_path}"
+ "#{@@api_endpoint}/#{@@api_version}#{relative_path}"
end
- def self.live
- @@live
- end
-
- def self.live=(live)
- @@live = live
+ def self.validate_fingerprint(id, fingerprint)
+ Digest::SHA1.hexdigest(id.to_s + "#" + @@api_key) == fingerprint
end
end