Prug2.0-activemerchant is a project mainly written in RUBY and JAVASCRIPT, it's free.
Activemerchant rails app example. Presentation: http://www.slideshare.net/polak20/active-merchant-krzysztof-jaboski-prug-20