Active Merchant Example

Hi,

I've searched the web and found some old examples of Active Merchant but was wondering if anyone had, or could point me to, a definitive guide showing a simple checkout where the logic is in the model rather than including the process in the controller.

I'd like to keep everything separate and would just like a super simple example.

Thanks!

You can look at this code

http://code.google.com/p/substruct/

Thanks Freddy.

I found substruct to be the only example I could find but am having a hard time pulling out the excess. I was wondering if there was anything out there that was even more basic. No cart, just a simple buy this and pay now example that is clean and model based.

For now, substruct is the closest and I'll keep looking at it, but if anyone knows of a better example please share. :slight_smile:

Not sure if this is what you are after: https://peepcode.com/products/activemerchant-pdf

hth, Rick

Hi Rick - Thanks for the suggestion. I purchased the peepcode a few months back and found it was lacking some information.

I guess I should rephrase the question by asking, do most of you process the payment (checkout) as a controller action, or does the actual processing piece take place in the model?

It seems like integration in the controller is very straight forward, but I am not sure it is the best method for an application. Any thoughts?

When I did this I used a checkout controller that uses an external order helper module... The order helper does all the checking and validation before my checkout controller does @order.save then if that works I do @order.process which then does all the "payment" stuff in the order model...

So the process class does the cc card and gateway setup then if that works and is valid it charges the card...