views:

226

answers:

1

Where can I find a complete example of ActiveMerchant Integrations usage? I can see tons of examples of Gateways' usage, but couldn't see how an Integration should be used (e.g. what do you do in the return_url and cancel_return_url controller actions?)

+1  A: 

I don't know if there are any concrete example of ActiveMerchant Integrations usage (maybe this will help: http://peepcode.com/products/activemerchant-pdf), but I can tell you that it depends on the payment gateway.

I would suggest to make a test transaction and see what params are returned to you by the gateway and then make a code that uses those params.

For example, in case of 2checkout you would want to check md5 hash that 2checkout returns to verify the transaction and make a record of the payment (maybe save the raw params received from 2checkout). Of course, it also depends what type of notification method your payment gateway provides.

Slobodan Kovacevic
I know how to perform the communication with the payment provider; what I don't know is how an Integration (my Integration) should be used in a standard way...
giorgian
It all depends on payment gateway. If you look at the docs (http://activemerchant.rubyforge.org/) you'll see that each integration has ActiveMerchant::Billing::Integrations::Return (http://activemerchant.rubyforge.org/classes/ActiveMerchant/Billing/Integrations/Return.html) implemented, more or less, and it includes methods such as success?() and message().
Slobodan Kovacevic