Can you help me in implementing a simple payment gateway?

Conceptually is very simple but I could not find any documentation that allows me to understand the process and carry it to practice. I have spent 2 days trying to figure it out, but with no avail.

I need to use a payment provider that only left me available a CGI program in my Magento server. That CGI makes a call to the payment provider server which shows a form and allows customer to pay by credit or debit card. From my point of view, that process is transparent. I only need to call that CGI with some parameters, like amount, quote ID, success URL, error URL and other internal variables, all of them passed as POST variables to the CGI. And after payment, a success or error controller will act.

That is all, but I was not able to carry that a simple process to Magento implementation.

First, how to pack the FORM data so that when user presses "Place Order" , the CGI get called passing those parameters? Second (I think this is the easiest process), to create controllers for both success and error behaviour.

Can you give me a brief guide, please?

Thanks a lot in advance Jaime

  • can you help me to get this , if you developed
    – Mujahidh
    Commented Oct 23, 2018 at 7:03

2 Answers 2


We have a module like you request for chilean payment provider working in M1 4 years. Now are migrating for M2.

  • Sorry, but I have finally created one by myself and it is working perfectly and validated by Transbank. and in fact, I am selling it already :-)
    – jstuardo
    Commented Jul 20, 2016 at 22:40

For the others who are curious about how to do this, the best resource you can get right now, would be the current of Paypal Express Checkout. Based on your description, the workflow for this type of Paypal seems to be the closet you can base your code on at the moment.

Any articles that talk about Payment Gateway dated back in 2015 are now obsolete from what I have tried so far.

Unfortunately, Paypal put all their payments into one module, so you will have hand pick the code quite a bit. Just focus on "Express Checkout" and go from there.



Best wishes!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.