4

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?)

giorgian
  • 3,795
  • 1
  • 30
  • 48

2 Answers2

4

I created an example Active Merchant integration with 2Checkout tutorial if you are still interested.

Craig-2Checkout
  • 741
  • 5
  • 7
1

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
  • 6,848
  • 3
  • 29
  • 33
  • 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 May 20 '10 at 09:38
  • 1
    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 May 20 '10 at 10:00
  • The linked PDF is very unhelpful (you have to buy it, and I can't judge if it contains "integration" usage) – lulalala Apr 16 '14 at 02:26