Wrap Active Merchant in a lightweight web service which exposes a RESTful API that Java (or any language) can talk to.
Wrap Active Merchant in a lightweight web service which exposes a RESTful API that Java (or any language) can talk to.
Or you can use warbler to bundle your ruby app into a deployable WAR file: http://caldersphere.rubyforge.org/warbler/
If you do manage to get it working, it would be great to have a blog post on it.
Using JRuby or a REST API to a Rails app is the kind of complication to an app you desperately want to avoid.
Active Merchant "raison d'être" was Shopify's requirements for a simple and unified API to access dozens of different payment gateways with very different internal APIs. Abstracting the APIs for dealing with credit cards and payment processors was core to Shopify's business, and they open-sourced what could have easily been kept closed. This abstraction is hard work, not the kind of work I want to do, and I'd rather use their robust library than roll my own or use another poorly-tested one.
We package and deploy Active Merchant in a single, stand-alone .jar file. We don't use Rails (Active Merchant works excellently as a stand-alone library). It's not as complicated as you think.
Btw, I was a java developer for 6 years. I was looking forward to type checking, but the closed community was too much to handle after experiencing the ruby world.