Jump to content
Rosyweb

Sage pay form - takes payment, returns to site with error

Recommended Posts

Hello, I'm trying to upgrade to the latest Sage Pay form v. 2 and although the payment money has been taken successfully through Sage Pay, it then returns the customer to the site with the failure message and no orders are written to the admin side (as it views the payment as a failure).

 

Anyone else experienced this?  

 

Any ideas why the form isn't working?  

 

I haven't modified it at all, it is as the download.  My old sage pay form v. 1.2 worked fine - no problems there and if I swap it back it works fine again. 

 

I'd be grateful for any help with this ...

 

 

Share this post


Link to post
Share on other sites

After you overwrite the old module with the new one, you have to go to admin/modules, select Sage Pay Form, click edit, then click save at the bottom.

 

This creates some additional settings that are needed for the new version.

 

Did you do that?


Contact me for work on updating existing stores - whether to Phoenix or the new osC when it's released.

Looking for a payment or shipping module? Maybe I've already done it.

Working on generalising bespoke solutions for Quickbooks integration, Easify integration and pay4later (DEKO) integration at 2.3.x

Share this post


Link to post
Share on other sites

Hi,
 

It could be configuration issue. Could you install these modules?

https://github.com/Gergely/oscommerce2/commit/92278f00fb8e2845fd843d8411c7f2e1c5df1889

What are they say?


:blink:
osCommerce based shop owner with minimal design and focused on background works. When the less is more.
Email managment with tracking pixel, package managment for shipping, stock management, warehouse managment with bar code reader, parcel shops management on 3000 pickup points without local store.

Share this post


Link to post
Share on other sites

Thanks for answering.   John - Yes I did install the new module properly - i.e uninstalled the old one and then re-installed the new uploaded module  (sage pay form 2). 

 

Gergely - I installed those modules and uploaded - how do I run them? 

Share this post


Link to post
Share on other sites

@@Rosyweb

 

its running if you have v2.3.4

 

move into admin/Tools/Security checks


:blink:
osCommerce based shop owner with minimal design and focused on background works. When the less is more.
Email managment with tracking pixel, package managment for shipping, stock management, warehouse managment with bar code reader, parcel shops management on 3000 pickup points without local store.

Share this post


Link to post
Share on other sites

Hi Gergely

 

I was on an older site on v. 2.3.1 so that's why Security Checks was not there. 

 

But have now installed a blank copy of oscommerce with the new sage pay v.2. form already integrated.    Payment form still doesn't work properly on the new installation - takes money, returns an error to customer and does not write the order to the web shop.

 

 

So now I have re-installed the sage page and suhosin security checks:

the errors that are appearing are:

 

suhosin:  Warning: allowed length of POST variable is less then oscommerce configuration table requirements 255 (64).

sagepay:  Warning: suhosin.get.max_value_length less than 1000 (512).

 

ok so somewhere a post variable max length is defined that doesn't allow a field length of 255????

 

So looking at the configuration table through php my admin:

configuration_title,   configuration_key and  configuration_description are all varchar max length 255 fields.    and this is normal and a new installation. 

 

But are we barking up the wrong tree.  Surely a blank installation of OSCommerce v.2.3.4 with the new Sage pay form v.2. already integrated into that version should work.  My form module setting are as were suggested with my unique username and password to link to Sage Pay (which works fine on the other form). 

 

Could it be a server issue??  What do I need to ask my server hosting company? 

 

many thaks

Share this post


Link to post
Share on other sites

You need to get in touch with your host and ask them to increase suhosin.get.max_value_length from 512 to 2048.

 

The next version of the Sagepay Module will have a routine to;

 

1, detect if Suhosin is installed

2, detect if suhosin.get.max_value_length is unsuitable

3, tell you what to do to correct it (contact host)

 

@@Rosyweb

Share this post


Link to post
Share on other sites

Thanks Burt, and where would the POST variable length of 64 be defined?  Any ideas?

Share this post


Link to post
Share on other sites

suhosin modify the lenght of POST variables.

 

in suhosin.post.max_name_length

 

Its displaying in admin/server_info page


:blink:
osCommerce based shop owner with minimal design and focused on background works. When the less is more.
Email managment with tracking pixel, package managment for shipping, stock management, warehouse managment with bar code reader, parcel shops management on 3000 pickup points without local store.

Share this post


Link to post
Share on other sites

Thanks Burt and Gergely for your help with this

 

my hosting company have now set the suhosin.get.max_value_length=2048

(The suhosin.post.max_vars was already set to 2000 and suhosin.post.max_value_length was already set to 1000000. )

 

So the Sage Pay form 2.0 is now working - yipee!  

 

I am surprised that I couldn't find anyone else reporting this problem - but now we have the solution, so thats great! 

Share this post


Link to post
Share on other sites

I am having the same problem with a site running OSCommerce 2.2MS2. I cannot upgrade this at present as it is incompatable with the theme the site uses. We are building a new site for the client at present that will allow an upgrade.

2.2MS does not have security checks and I am at a loss to see why it is not working properly. My client is receiving two payments per order and is having to waste a lot of time doing refunds.

Share this post


Link to post
Share on other sites

I am having the same problem with a site running OSCommerce 2.2MS2. I cannot upgrade this at present as it is incompatable with the theme the site uses. We are building a new site for the client at present that will allow an upgrade.

2.2MS does not have security checks and I am at a loss to see why it is not working properly. My client is receiving two payments per order and is having to waste a lot of time doing refunds.

 

Which Sagepay module are you using? If the interface is taking two payments it's not the same problem at all! The above was with Sagepay Form which transfers you to sp to do the payment.


Contact me for work on updating existing stores - whether to Phoenix or the new osC when it's released.

Looking for a payment or shipping module? Maybe I've already done it.

Working on generalising bespoke solutions for Quickbooks integration, Easify integration and pay4later (DEKO) integration at 2.3.x

Share this post


Link to post
Share on other sites

I am using Sage Pay Form. It is going over to the Sagepay website and payments are being taken. But when payment is confirmed it is taking the person back to the error Page where it says

"An error occured taking payment. Please try again and if problems persist, please try another payment method."

However, the payment and order has been taken correctly and confirmation email is being received from sagepay. But the databse is not being updated and no confirmation of order is being sent.

Share this post


Link to post
Share on other sites

The exact error wording is in two parts.

Par 1) Reads:

There has been an error processing your order transaction

Par 2) Reads
Please try again and if problems persist, please try another payment method.

 

I have tried to trace this wording in files but with no joy. Presumably the wording is coming from sagepay. However, I would have expected then to be on the errors.php page in the ext directory.

Share this post


Link to post
Share on other sites

The wording comes from osc:

  define('MODULE_PAYMENT_SAGE_PAY_FORM_ERROR_TITLE', 'There has been an error processing your order transaction');
  define('MODULE_PAYMENT_SAGE_PAY_FORM_ERROR_GENERAL', 'Please try again and if problems persist, please try another payment method.');

It's set in the error handling in the module. It looks like you're coming back to checkout_payment.php with no error code set. Is there nothing at the sagepay end?

 

If you're getting the same thing against the Sagepay test environment and you're not getting any debug emails, try setting the failure url to checkout_process.php instead... it should still catch an error response and you might get told the code that way.

 

Clearly this is a temporary change for debugging - don't forget to put it back later!


Contact me for work on updating existing stores - whether to Phoenix or the new osC when it's released.

Looking for a payment or shipping module? Maybe I've already done it.

Working on generalising bespoke solutions for Quickbooks integration, Easify integration and pay4later (DEKO) integration at 2.3.x

Share this post


Link to post
Share on other sites

Hi,

 

Thanks for your help.

 

No there is nothing at the Sagepay end. I have tried both methods to get an error code but I am not receiving one.

 

Temporarily, I have changed the wording of the error messages to try and stop duplications. Today one guy has put the same order through five times!

 

On checking through, the only possible error I have found is that MCrypt was set to 'false' whereas I would have expected it to be set to 'true". However, changing it has made no difference.

 

Any further thoughts?

Share this post


Link to post
Share on other sites

I am facing the same issue, after upgrading the server PHP version. Please can you help me out.

Getting the following error

There has been an error processing your order transaction
Please try again and if problems persist, please try another payment method.

Share this post


Link to post
Share on other sites
5 minutes ago, gurleen.ghrix said:

I am facing the same issue, after upgrading the server PHP version. Please can you help me out.

Getting the following error

There has been an error processing your order transaction
Please try again and if problems persist, please try another payment method.

All your version information, please:

  • oscommerce version
  • sagepay module version
  • new php version
  • and for completeness, old php version!

Contact me for work on updating existing stores - whether to Phoenix or the new osC when it's released.

Looking for a payment or shipping module? Maybe I've already done it.

Working on generalising bespoke solutions for Quickbooks integration, Easify integration and pay4later (DEKO) integration at 2.3.x

Share this post


Link to post
Share on other sites
5 minutes ago, BrockleyJohn said:

All your version information, please:

  • oscommerce version
  • sagepay module version
  • new php version
  • and for completeness, old php version!

Oscommerce version : 2.3.4

Sagepay module version : api version 3.0

New PHP Version : 5.6.31

Old PHP Version : 5.3

Share this post


Link to post
Share on other sites

Is the transaction getting recorded in sagepay?

Lets add an error log. Edit your sagepay module: find

    function get_error() {
      global $HTTP_GET_VARS;

      $message = MODULE_PAYMENT_SAGE_PAY_FORM_ERROR_GENERAL;

and add afterwards:

  $log_record = date('d-m-Y H:i:s') . '
  return      : ' . print_r($_GET,true) . PHP_EOL . PHP_EOL;
  file_put_contents('sp-api.log',$log_record, FILE_APPEND);

this should write a log file called sp-api.log to your catalog directory containing all the data being returned from sagepay in the error condition


Contact me for work on updating existing stores - whether to Phoenix or the new osC when it's released.

Looking for a payment or shipping module? Maybe I've already done it.

Working on generalising bespoke solutions for Quickbooks integration, Easify integration and pay4later (DEKO) integration at 2.3.x

Share this post


Link to post
Share on other sites
13 minutes ago, BrockleyJohn said:

Is the transaction getting recorded in sagepay?

Lets add an error log. Edit your sagepay module: find


    function get_error() {
      global $HTTP_GET_VARS;

      $message = MODULE_PAYMENT_SAGE_PAY_FORM_ERROR_GENERAL;

and add afterwards:


  $log_record = date('d-m-Y H:i:s') . '
  return      : ' . print_r($_GET,true) . PHP_EOL . PHP_EOL;
  file_put_contents('sp-api.log',$log_record, FILE_APPEND);

this should write a log file called sp-api.log to your catalog directory containing all the data being returned from sagepay in the error condition

I am getting the following error in this log file

31-10-2017 09:21:49return      : Array
(
    [payment_error] => sage_pay_form
    [crypt] =>
)

Edited by gurleen.ghrix

Share this post


Link to post
Share on other sites
50 minutes ago, gurleen.ghrix said:

I am getting the following error in this log file

31-10-2017 09:21:49return      : Array
(
    [payment_error] => sage_pay_form
    [crypt] =>
)

If the crypt is being returned empty, that's why you're getting a generic error message instead of a specific one. Is there anything recorded in Sagepay?


Contact me for work on updating existing stores - whether to Phoenix or the new osC when it's released.

Looking for a payment or shipping module? Maybe I've already done it.

Working on generalising bespoke solutions for Quickbooks integration, Easify integration and pay4later (DEKO) integration at 2.3.x

Share this post


Link to post
Share on other sites

@gurleen.ghrix did you check if there's a value for  suhosin.get variables in admin / server info?


Contact me for work on updating existing stores - whether to Phoenix or the new osC when it's released.

Looking for a payment or shipping module? Maybe I've already done it.

Working on generalising bespoke solutions for Quickbooks integration, Easify integration and pay4later (DEKO) integration at 2.3.x

Share this post


Link to post
Share on other sites

cool. Don't forget to take the logging code out


Contact me for work on updating existing stores - whether to Phoenix or the new osC when it's released.

Looking for a payment or shipping module? Maybe I've already done it.

Working on generalising bespoke solutions for Quickbooks integration, Easify integration and pay4later (DEKO) integration at 2.3.x

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×