lyang/braintree-rails — pull request #15 by jmophoto (2013-11-14 05:32:30+00:00)
Title: Add :credit_card attribute to Customer model.

This allows for creation of a credit card with a customer using nested forms.

When using the Braintree gem, a user can create a customer and credit card in one call by using nested attributes. This extends that ability to this gem by adding the credit_card attribute to the Customer model.

Thus:

BraintreeRails::Customer.new(email: "user@example.com", credit_card: { number: "5105105105105100", expiration_date: "11/2013" })

Creates a customer with an associated card.

Also works to update, either adding a card or updating existing card.

No tests written, yet, but can be if this is something you want to merge.

Thanks for the gem!