Braintree via Redline: riding the rails
Automatically makes creation/deletion/update scripts for your model, translating and syncing them with a Braintree customer profile.
Planning on adding extremely light-weight subscription support.
class User < ActiveRecord::Base acts_as_braintree_customer :business_name => :company, :firstname => :first_name, :lastname => :last_name attr_accessible :firstname, :lastname, :website, :email, :business_name, :password, :password_confirmation end
acts_as_braintree_customer takes an optional series of attributes that represent an attribute mapper
james = User.find(1) #=> <User id: 1, firstname: "James", lastname: "Daniels", business_name: "MarginLeft, LLC", email: 'firstname.lastname@example.org', website: 'http://www.marginleft.com', crypted_password: "45fres8...", persistence_token: "4jsdf88...", ...> james.customer #=> <Braintree::Customer id: "9999999", first_name: "James", last_name: "Daniels", company: "MarginLeft, LLC", email: "email@example.com", website: "http://www.marginleft.com", ..., addresses: , credit_cards: >
More to come.
Note on Patches/Pull Requests
Fork the project.
Make your feature addition or bug fix.
Add tests for it. This is important so I don't break it in a future version unintentionally.
Commit, do not mess with rakefile, version, or history. (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
Send me a pull request. Bonus points for topic branches.
Copyright © 2010 James Daniels. See LICENSE for details.