Forum: Ruby on Rails Active Merchant Example

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
6f3a904bebab756df4880aeb199da396?d=identicon&s=25 sshefer (Guest)
on 2008-11-06 05:33
(Received via mailing list)
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!
4c438a80fc30661ad619ea177cf9cbd0?d=identicon&s=25 Freddy Andersen (Guest)
on 2008-11-06 08:39
(Received via mailing list)
You can look at this code

http://code.google.com/p/substruct/
6f3a904bebab756df4880aeb199da396?d=identicon&s=25 sshefer (Guest)
on 2008-11-06 09:08
(Received via mailing list)
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. :)
903de3fe51f14392609e28e82e1b1c6c?d=identicon&s=25 Rick Fiorentino (rickf)
on 2008-11-06 14:02
Not sure if this is what you are after:
https://peepcode.com/products/activemerchant-pdf

hth,
Rick
6f3a904bebab756df4880aeb199da396?d=identicon&s=25 sshefer (Guest)
on 2008-11-06 18:37
(Received via mailing list)
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?
4c438a80fc30661ad619ea177cf9cbd0?d=identicon&s=25 Freddy Andersen (Guest)
on 2008-11-06 22:14
(Received via mailing list)
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...
This topic is locked and can not be replied to.