Moneris Checkout (MCO) integration

  • Posts: 11
  • Thank you received: 1
1 year 10 months ago #342353

-- HikaShop version -- : HikaShop Business 2.6.0
-- Joomla version -- : 3.4
-- PHP version -- : 5.6

Hi Team, As you are aware Moneris is ending the Hosted pay page (HPP), so we need to link the hikashop to Moneris Checkout (MCO). I wanted to check if Hikashop(new version) has prebuilt integration with Hosted solution "Moneris Checkout (MCO) ? If yes then please guide me. I am sure many of your customer may have asked this question before.

If no then also kindly guide if any of current plugin of hikashop (2.6.0) can be used (copied) and altered to work with MCO ? I mean to say if there is already existing plugin with similar functionality as MCO then I can use the same instead of writing the code from scratch.

Your inputs are highly appreciated.

Please Log in or Create an account to join the conversation.

  • Posts: 81504
  • Thank you received: 13062
  • MODERATOR
1 year 10 months ago #342368

Hi,

There is no ready-made solution avaialble for Moneris Checkout.
If you want to develop a plugin for it, looking at their developer documentation, I would recommend basing yourself on the plugins/hikashoppayment/epay/ plugin.
I'm not sure if it was already available in the 2.6.0 version but I suppose it is the case.
It has a similar workflow where the javascript from the payment gateway is loaded in the epay_end.php view file with javascript code to interact with the payment gateway.
There are of course differences. With MCO, you need to first do a preload request in onAfterOrderConfirm to initiate the transaction and store a ticket id in the order in the database.
Then, you can use that ticket id with a "receipt request" in the onPaymentNotification callback to make sure the payment is valid before changing the status of the order.

Please Log in or Create an account to join the conversation.

  • Posts: 11
  • Thank you received: 1
1 year 10 months ago #342400

Thanks Nicolas. I will check the epay plugin. If it is not there then I will follow the steps shared by you to implement the same. I also wanted to know if Moneris Checkout is part of latest version of Hikashop Business ?

MCO documentation says that I need to provide the callback handler in the javascript. I thought the preload request will be fired from js but from your comment it seems I need to initiate the same via PHP under onAfterOrderConfirm trigger. Get the ticket id and save the same in orders table. When the Moneris payment is done, then javascript will get the notification via handler "order or payment completed" and we need to call our server function onPaymentNotification (which will then fire the "receipt request" to moneris with ticket id stored for the order ). If success then mark the order as complete or else mark the order status to something else based on the error detail. Is my understanding correct ?

Please Log in or Create an account to join the conversation.

  • Posts: 81504
  • Thank you received: 13062
  • MODERATOR
1 year 10 months ago #342406

Hi,

Unfortunately, Moneris Checkout has not been developed on our end, even in the latest version of HikaShop Business.

Your understanding is not far off the mark.
Here is how you need to do it from what I understand of the Moneris Checkout documentation:
- in onAfterOrderConfirm you first need to do a preload request (in PHP with cURL)
- this will give you back a ticket id
- you need to save that ticket id in the order
- you also need to pass that ticket id in $this->vars so that in the Javascript code you'll add in the end file, you'll use that ticket id to display the Moneris Checkout. At that time, you'll also be able to set callbacks in javascript.
- using the payment complete callback, you can redirect the user to the payment notification URL of your plugin which will call onPaymentNotification.
- in onPaymentNotification you need to do a receipt request (in PHP with cURL) to check that the payment has really been completed and then you can change the status of the order to confirmed and redirect again the user to the thank you page.

Please Log in or Create an account to join the conversation.

  • Posts: 11
  • Thank you received: 1
1 year 9 months ago #343276

Thanks Nicolas as with your inputs I am able to test the Moneris Checkout by creating a plugin MCO. I can save ticket, and then validate the same on payment notification. I have one more query. We have 2 moneris store(one for USD and another for CAD). I have created 2 versions of plugin (MCO) but I want to understand how hikashop will pick the USD version of plugin when order currency is USD and similarly CAD version of plugin when order currency is CAD ? Is this automatically done and if yes, then what conditions/fields the plugin must have to establish the auto selection of right payment store ?

I was reading an article here but could not figure out much.
www.hikashop.com/forum/payment-methods/8...orking.html?start=20

Thanks,

Please Log in or Create an account to join the conversation.

  • Posts: 81504
  • Thank you received: 13062
  • MODERATOR
1 year 9 months ago #343279

Hi,

At the beginning of the main class of your Hikashop payment plugin, you can add that attribute:
var $accepted_currencies = array( "EUR", "USD" );

HikaShop will automatically filter out the payment methods for which the $accepted_currencies array is not empty and doesn't contain the current currency.

Please Log in or Create an account to join the conversation.

Time to create page: 0.063 seconds
Powered by Kunena Forum