Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Abstraction

  • Loading branch information...
commit 3385e125e276b07a529b8c1efa66e46cfdf04ece 1 parent cacb537
Gabe Berke-Williams gabebw authored
Showing with 7 additions and 3 deletions.
  1. +7 −3 lib/fake_braintree/customer.rb
10 lib/fake_braintree/customer.rb
View
@@ -16,14 +16,14 @@ def create
hash = customer_hash
create_customer_with(hash)
create_credit_card_with(hash)
- creation_response_for(hash)
+ response_for_created_customer(hash)
end
end
def update
if existing_customer_hash
hash = update_existing_customer!
- gzipped_response(200, hash.to_xml(:root => 'customer'))
+ response_for_updated_customer(hash)
else
failure_response(404)
end
@@ -123,7 +123,7 @@ def existing_customer_id
@customer_hash['id']
end
- def creation_response_for(hash)
+ def response_for_created_customer(hash)
gzipped_response(201, hash.to_xml(:root => 'customer'))
end
@@ -167,5 +167,9 @@ def deletion_response
def delete_customer_with_id(id)
FakeBraintree.registry.customers[id] = nil
end
+
+ def response_for_updated_customer(hash)
+ gzipped_response(200, hash.to_xml(:root => 'customer'))
+ end
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.