Jump to content

SagePay Vendor TX code


jaymer

Recommended Posts

Hi,

I need to change the VendorTXCode that is sent with orders to SagePay,

this is urgent as all we are getting at the moment are errors due to the codes being used on a previous website,

 

Any help please...

Link to comment
Share on other sites

  • 2 weeks later...

All sorted now, don't worry.

 

If anyone is interested, I had to amend 2 files from the sagepay module:-

sagepay.php - 2/3rds of the way down the page, the line that says

     $strToCrypt = 'VendorTxCode='.$strVendorTxCode;

I altered to
     $strToCrypt = 'VendorTxCode=1-'.$strVendorTxCode;
 
then validation.php, the line
     $cart_id1 = (isset($values[0]) ? $values[0] : null);
after this I put this line in, to remove the "1-" from the beginning of the VendorTXCode
     $cart_id = substr($cart_id1, 2);
I don't know why this was needed, but it wouldn't work without doing this.
 
This appeared to then screw up the $values array, causing all sorts of validation errors, so I had to change the following line
$amount = (isset($values[16]) ? $values[16] : null);
the 16 to 15, maybe someone more clever than me could explain why!
Edited by jaymer (see edit history)
Link to comment
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
×
×
  • Create New...