Page 1 of 1

SagePay Server Payment Extension Configuration

Posted: Thu Dec 21, 2017 1:21 am
by CSR
Using OC 3.0.2.0
Has anyone had any issues configuring the included SagePay Server payment extension? (Extension > Extension > Payment > SagePay Server)

With the payment extension installed, enabled and configured in test mode any order placed (using the standard checkout procedure) gets transferred to the SagePay test server ok, enter test card details all ok but upon making the test payment results in the order failing with a return the the checkout section of the website with an error: "There was an error processing your request. "

This occurs when using both the default theme and Journal2 theme to checkout, so I think it is safe to not blame the theme in this instance.

Looking at the log file the error log file for SagePay_Server the problem is: 'StatusDetail: Cannot match the MD5 Hash. Order might be tampered with'

SagePay support have also confirmed the error is 'unable to match MD5 hash'. They have confirmed the test account is correctly configured.

Sagepay Support have responded: "This would suggest that your system is not creating the signature correctly as our two systems are not matching. We can see from our logs that the information is definitely coming from Sage Pay, of course, so your system is erroneously perceiving the information has been tampered with due to not having created the signature correctly. In this case, if you are not creating and supporting the integration yourself, I would recommend getting in touch with Opencart to relay the error."

Has anyone had any issues, is anyone using Opencart with SagePay Server, can anyone suggest a solution or have any pointers?

Thanks in advance.

Re: SagePay Server Payment Extension Configuration

Posted: Thu Dec 21, 2017 1:58 am
by straightlight
This was a long time reported issue on Github Opencart. However, I believe to have found a solution: https://ebizmarts.com/forums/topics/view/5219/40 . It appears by increasing the: suhosin.get.max_value_length parameter, this issue could be resolved. See an example here: https://stackoverflow.com/questions/127 ... -max-value .

The issue you are reporting is about the length tolerance of the URL with the MD5 hash.

Re: SagePay Server Payment Extension Configuration

Posted: Thu Dec 21, 2017 2:32 am
by straightlight
I have read on another page of the first posted link forum that the vendor's name must be set to lower case at all times. By not taking any chances, in catalog/controller/extension/payment/sagepay_server.php file,

replace all instances of:

Code: Select all

$this->config->get('payment_sagepay_server_vendor')
with:

Code: Select all

strtolower($this->config->get('payment_sagepay_server_vendor'))

Re: SagePay Server Payment Extension Configuration

Posted: Fri Dec 22, 2017 12:19 am
by CSR
Thank you @straightlight your above referenced post has rectified this issue. Much appreciated.

Re: SagePay Server Payment Extension Configuration

Posted: Fri Dec 22, 2017 12:30 am
by straightlight
No problem. Thanks for the feedback regarding this fix / workaround.