paypal chained payment

  I want to implement paypal chained payment with adaptive payments API.
I am totally new to paypal. Kindly guide me to start with. I have heard
of gem active merchant. Can I use that for the purpose? Or any other
gems? Also please point me to any examples describing adaptive payment
with chained payment using rails. My rails version is 2.3.8

Thanks in advance