I had a wordpress subcontract the other day for a site thats mostly built up. My job was to make sure payments were going through the Moneris payment host. I’d never done anything like that before. Fun stuff.
The first problem I ran into was that Moneris didn’t have publicly accessible documentation for their API. Apparently they want people to go through a registration-wall. I don’t know how that makes sense. I guess I’m way too used to companies that have a publicly accessible API.
Hosted payments
Moneris provides a few different options for processing payments. The easiest to use is a ‘hosted’ option where the end-user is sent to a moneris server to enter their payment information. The other 2 options involve collecting end-user payment information and then passing it on to Moneris. I didn’t bother with those. They involve all sorts of scary accounting-practices and e-commerce jargon.
In the hosted payment system, the client makes a post request to Moneris. They initiate the transaction. Then they (At our option) get sent back to our website and the page they get sent to is sent information on whether the payment was successful or not. Easy-peasy, once I got access to their API documentation. Its a pleasure to work with well-documented systems.
I need to learn functional PHP
I found it difficult to familiarise myself with the code that was currently written since everything was written inline. There were no functions used at all. It was difficult. I tried to convert the code to a functional manner a few times, but kept failing and we didn’t have the time frame for me to learn to do it properly. I need to learn how to do this, for the benefit of the next wordpress project I work on. Inline code is a pain to work with.
Leave a Reply