I have a business site where I use OpenCart and decide it was time to upgrade the payment system. I talked to BluePay before I purchased their service and they said they have a module for OpenCart. Turns out they don't really have a module, and instead have a service where they emulate transactions through the Authorize.net module. I hooked it up as per the instructions of BluePay and it isn't quite working. It charges customers cards, but all orders get dropped into the "Missing" orders in OpenCart. Does anyone know what is going wrong?
Edit:
I finally figured out what the issue was. To save other people time I wanted to post the solution here.
BluePay calculates the transaction MD5 hash differently than Authorize.net. Because of this, without a code change, all orders get rejected because the MD5 doesn't match.
In order to use the authorizenet_aim.php
module for BluePay with OpenCart you need to edit it as follows (authorizenet_aim.php
is version 3.1 as of the writing of this post):
- Make a backup of
catalog/controllers/payment/authorizenet_aim.php
- Edit
catalog/controllers/payment/authorizenet_aim.php
and change the urls:
Replace line 48 with:
$url = 'https://secure.bluepay.com/interfaces/a.net';
Replace line 50 with:
$url = 'https' . '://secure.bluepay.com/interfaces/a.net.test';
- Change the way the hash is generated:
Replace line 138 with:
if (strtoupper($response_info[38]) == strtoupper(md5($this->config->get('authorizenet_aim_key') . $this->config->get('authorizenet_aim_login') .
$response_info[7] . $this->currency->format($order_info['total'], $order_info['currency_code'], 1.00000, false)))) {
BluePay uses authorizenet_aim_key
instead of authorizenet_aim_hash
I have the complete edited file for download here for anyone who would like to just download it (for as long as my personal server stays active):