Mysterious Trousers

Quality software and amazing support since 2010

We’re a small team dedicated to making you happy. We achieve this through synergizing analytics and best-of-breed social blah blah blah hard work and honest-to-goodness customer service.

Setting up Braintree in Rails

add the gem

add the initializer

set up an “after_create” on whatever you’re tying the credit cards to and add them to braintree as a customer when its created

create a credit card model (only store masked cc #)

recap: create a customer, create a credit card attached to that customer, charge the card.

when you create a customer or card, you have to pass it in a id/token that you generate yourself

when you create the credit card, you pass in the token you generated for the customer

when you charge the credit card, you pass the token you created for the card

heres the credit card table migration

© 2013 Mysterious Trousers, LLC. All Rights Reserved. Background photo by hsld