Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Customers can be created with an empty credit card hash.

  • Loading branch information...
commit bab770a94fa0816263162a4d896842837992ab9d 1 parent 6c284b5
Gabe Berke-Williams gabebw authored
1  lib/fake_braintree/customer.rb
View
@@ -74,6 +74,7 @@ def verify_credit_card?(customer_hash)
return true if FakeBraintree.verify_all_cards
@customer_hash.key?("credit_card") &&
+ @customer_hash["credit_card"].is_a?(Hash) &&
@customer_hash["credit_card"].key?("options") &&
@customer_hash["credit_card"]["options"].is_a?(Hash) &&
@customer_hash["credit_card"]["options"]["verify_card"] == true
5 spec/fake_braintree/customer_spec.rb
View
@@ -9,6 +9,11 @@
result.should be_success
end
+ it "can handle an empty credit card hash" do
+ result = Braintree::Customer.create(:credit_card => {})
+ result.should be_success
+ end
+
it "creates a customer using an expiration month and year" do
result = Braintree::Customer.create(:credit_card => { :number => TEST_CC_NUMBER,
:expiration_month => expiration_month,
Please sign in to comment.
Something went wrong with that request. Please try again.