Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP


Add 'default_credit_card' method to Customer #32

wants to merge 1 commit into from

3 participants


This pull request let's you write:

customer = Braintree::Customer.find("a_customer_id")

Having the customer you can get his default_credit_card.


Any news on this?


Hey @esbanarango

Sorry for the delay in getting back to you on this. We like this pull request, and this seems like totally reasonable functionality to provide.

I can't tell you exactly when we'll be able to get to this, but we'd like to pull it in. We'll likely add this functionality to our other client libraries and release them all together at some point.

Thanks for your contribution!

Brian Cosgrove
Braintree Developer


I'm going to go ahead and close this issue since the relevant functionality was added in version 2.23.0.


Luke Steensen
Braintree Developer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Nov 15, 2012
  1. @esbanarango
This page is out of date. Refresh to see the latest.
Showing with 5 additions and 0 deletions.
  1. +5 −0 lib/braintree/customer.rb
5 lib/braintree/customer.rb
@@ -157,6 +157,11 @@ def transactions(options = {})
@gateway.customer.transactions(id, options)
+ # Returns the default +CreditCard+ for the customer.
+ def default_credit_card
+ @credit_cards.find {|credit_card| credit_card.default? }
+ end
# Deprecated. Use Braintree::Customer.update
# See
Something went wrong with that request. Please try again.