Skip to content

Commit

Permalink
De-dupe logic.
Browse files Browse the repository at this point in the history
  • Loading branch information
Gabe Berke-Williams committed Jan 12, 2012
1 parent 3ac94b2 commit b20e318
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/fake_braintree/credit_card.rb
Expand Up @@ -31,12 +31,10 @@ def response_for_updated_card(credit_card)
end end


def credit_card_exists_in_registry? def credit_card_exists_in_registry?
token = credit_card['token']
FakeBraintree.registry.credit_cards.key?(token) FakeBraintree.registry.credit_cards.key?(token)
end end


def credit_card_from_registry def credit_card_from_registry
token = credit_card['token']
FakeBraintree.registry.credit_cards[token] FakeBraintree.registry.credit_cards[token]
end end


Expand Down Expand Up @@ -71,5 +69,9 @@ def set_expiration_month_and_year
@credit_card["expiration_year"] = expiration_year @credit_card["expiration_year"] = expiration_year
end end
end end

def token
credit_card['token']
end
end end
end end

0 comments on commit b20e318

Please sign in to comment.