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 http://cl.ly/3M0j3X3R1A2X2Q1i2T2I

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 http://cl.ly/062C3K1V0r2j1R1s3p0f

create a credit card model (only store masked cc #) http://cl.ly/1A3r260e2c3B2m21071d

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 http://cl.ly/0930292B432f0j320a3A

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