Jump to content

Automatically process digital products with sagepay?!


Recommended Posts

Guys, Success!! (I think!) Will post shortly...




I've sussed it. I did a search for "XOR" and found this little fella:

private $_encryption = 'AES'; // can be XOR

Despite the setting on the gateway being XOR it said AES here. So I changed AES to XOR and it worked straight away!

Link to comment
Share on other sites

According to the code in the SagePay module gateway file, everything about the order is suppose to arrive as a string in a querystring (or post) variable called 'crypt'. If the very first character of this string value is '@', then we know it is the AES encryption protocol.


This is assuming we have the current/correct SagePay API protocol.


I had you add a test for the presence of 'crypt' being sent along with the callback:

if(!isset($_REQUEST['crypt']) || empty($_REQUEST['crypt'])) $values['StatusDetail'] .= " Nothing to decrypt.";

According to the result of this test, there is no 'crypt' being sent with the callback.


Regardless how you have the encryption set in the SagePay module, if you find the order details at MySagePay, then CubeCart is working with respect to sending, and receiving the callback.


What is not working is

* knowing the name of the variable with the results of the transaction

* knowing how to determine by what method of encryption is being used


That would be in the SagePay API documentation.

Link to comment
Share on other sites

From the statement you posted above, eight lines down is another statement that determines the module's setting and uses that.


"Do you mean check and see what encryption it's using?"


It will tell us the name of the variable the returning data is in. If it's not 'crypt', but something else, we will see its name.

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.

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...