Braintree and ActiveResource

Been playing around with accessing Braintree transactions from ActiveResource, using the Query API in particular. Thanks to the folks over at QuarkRuby, getting started was quite easy, so I figured I might as well post what I have for the uninitiated.

pastie

To get started using the API, use commands like the following:


t = Braintree.find(:all, :params => {:username => 'btdemo', :password => 'btdemo123', :last_name => 'Lin'})


t.each do |transaction|
transaction.gimme_my_money
end

Pretty straightforward stuff if you want to incorporate this into your Rails app, either for integration test verification or some admin pages.

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

Leave a Reply

ray ban wayfarer sizes ray ban repair parts
aldo coupon
Buy shoes online india
replica handbags