Skip to content

Commit

Permalink
Cleanup.
Browse files Browse the repository at this point in the history
  • Loading branch information
Gabe Berke-Williams committed Jan 13, 2012
1 parent f7a6cf5 commit a352f33
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions lib/fake_braintree.rb
Expand Up @@ -18,12 +18,11 @@ module FakeBraintree
mattr_accessor :registry, :verify_all_cards, :decline_all_cards

def self.activate!
self.registry = Registry.new
initialize_registry
self.verify_all_cards = false

set_configuration
clear!
Server.new.boot
boot_server
end

def self.log_file_path
Expand Down Expand Up @@ -60,12 +59,14 @@ def self.failure_response(card_number = nil)
end

def self.create_failure
{ "message" => "Do Not Honor",
{
"message" => "Do Not Honor",
"verification" => { "status" => "processor_declined",
"processor_response_text" => "Do Not Honor",
"processor_response_code" => '2000' },
"errors" => { 'errors' => [] },
"params" => {} }
"params" => {}
}
end

def self.decline_all_cards!
Expand Down Expand Up @@ -99,6 +100,13 @@ def self.set_configuration
Braintree::Configuration.private_key = "xxx"
end

def self.boot_server
Server.new.boot
end

def self.initialize_registry
self.registry = Registry.new
end
end

FakeBraintree.activate!
Expand Down

0 comments on commit a352f33

Please sign in to comment.