Jump to content
  • Checkout
  • Login
  • Get in touch


The e-commerce.

Surepay Module Notes


Recommended Posts

For all those running a search on the Surepay module, I wanted to post my experience for future reference.


First of all, the module's developer was very helpful and kind when I finally got in touch with him. I was at my wit's end, and he helped point me in the right direction. Thank you Stan... cheers!


So first off, make absolutely sure that your server has the Curl library compiled properly. If your site is SSL, then it needs to be complied under SSL. Also, the Surepay rep said that OpenSSl v9g was the earliest bug free version.


There is a test script online which works out-of-the-box when placed on a properly configured server. It can be found here, and you just copy/paste the code into a php file and place it your root directory. It can be called up via either http or https




You will probably have to get your hosting server to configure everything unless you are running your own server and know how to do this. If you need a host that will go above and beyond to help, I recommend Loai Said over at http://www.spidersaid.com. Thanks Loai!


Once the Curl library works, the next step is to test the Surepay module in OsCommerce. Contrary to the Readme file, a total of $11 will randomly give you both an Auth and Decline message; there will be no "Reference" or "Call" message in OsC for $21, though you might see them in your Surepay Manager software; and the $44 Decline should be changed to $41 according to the Surepay representative.


Also, in both the Kreisler test and in the module test you should leave the account # as "1001" and the password set to "password"; that might seem obvious but it wasn't to us.


Once you get several Auth and Decline messages (which you can also see in the 'Surepay Transactions' table of the database using a tool like PhpMyAdmin), then it is time to go live. Simply switch the Admin>Modules>Payment>Surepay option for this - you shouldn't need to hack the php files directly at all. Then input your actual account number, and your Gateway Password - this is very important, because Surepay sends you a set of 3 passwords, and you must have the 'Gateway' password input here for the module to work.


Now send a transaction and see if you get an Auth, and if is shows up in your Surepay Manager. If you get an error, then you can add this line of code to the surepay.php file immediately after line 441...


$surepay_debug_mode = true;


This will enable a debug mode that returns the actual XML you're getting from Surepay. Be sure to comment this line out when your are finished debugging.


Also, you can disable the CVV2 code on line 148 of the sausurepay.php file if you don't want or need the CVV2 option. Then comment out lines 117-118 and 178-179 of the surepay.php file to get rid of the CVV2 field. If the CVV2 is enabled, then a customer must input a number into the field or the transaction won't complete - the Surepay representative said that no fields can be sent with a "null" value to their XML auth site or the transaction will break.


Okay... so I hope some of this helps. The module actually does work if absolutely everything else down the line is configured properly. Hang in there...



Link to comment
Share on other sites

  • 4 months later...

Thanks for this summary. It's very helpful. I just wanted to alert people to an additional problem. If you're running a recent, or very securely configured version of PHP, you might get the following error at authorization time:


Warning: Call-time pass-by-reference has been deprecated - argument passed by value; If you would like to pass it by reference, modify the declaration of xml_set_object(). If you would like to enable call-time pass-by-reference, you can set allow_call_time_pass_reference to true in your INI file. However, future versions may not support this any longer. in /home/httpd/htdocs/secure/catalog/includes/classes/sausurepay.php on line 694


The solution is to go to line 694, and change this line:

xml_set_object($this->parse_parser,&$this); //Reference to the object from this object


to this:

xml_set_object($this->parse_parser,$this); //Call time pass by reference deprecated. Passing by value instead.


That seems to do the trick (although it's a performance hit). Hopefully the developer of the sausurepay.php classes will fix this in an upcoming version. I've filed a bug report at the sourceforge.net sausurepay site.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...