I need to integrate PayU payment gateway (via Omnipay) into one of my ExpressionEngine2 (2.8.1) websites thus I need to write this gateway for the shopping cart (Expresso-Store) I am using in my project.
To achieve this, I am looking at the other payment gateways that is already included in the store addon and trying to make sense of what is going on there and trying to follow those examples. Unfortunately there is almost no comments in the existing gateways and I would really like to know what happens in each class rather than 'just following examples'. I see that most of these have pretty much the same structure, although in some gateways there is a class or function missing, or the one gateway handles things different to another gateway.
I also know that I need to write an extension to install this new gateway as the copy/paste method is a no no when you need to update your gateway.
My main concern is what happens in the getData()
and sendData()
functions of the PurchaseRequest
class and how do I know which classes/functions to include?
Any help will do. Thanks in advance
This question is probably better suited to the ExpressionEngine stack exchange site, but anyways...
The Omnipay readme has some basic instructions to create a new gateway. A complete example is probably a little beyond a SO answer, but basically the getData()
method formats the request to send to the gateway, and the sendData()
sends it.
As for integrating with Store/EE, you can look at this Beanstream gateway to see how to create a new extension containing the extra gateway.