Post by silentmedia » Mon Sep 05, 2011 6:56 pm

Morning All!

Could anyone help with this... I am using SagePay Form as a payment method but all my customers are getting the below error when they checkout. The error is shown at Sage's site...

Form Transaction Error

This transaction attempt has failed. Please use the Proceed button go back to the web store from which you were purchasing. The details of the failure are given below.

Status:
MALFORMED

Status Detail:
4001 : The VendorTxCode has been used before. All VendorTxCodes should be unique.

Any help is much appreciated. I have cleared system/cache with no joy.

Thanks,
Jazz

Newbie

Posts

Joined
Sun Aug 14, 2011 6:56 pm

Post by silentmedia » Tue Sep 06, 2011 4:31 pm

Anybody?....

Newbie

Posts

Joined
Sun Aug 14, 2011 6:56 pm

Post by silentmedia » Tue Sep 06, 2011 8:46 pm

oc. 1.5.1.1

Ok I have some more info and know what the problem is...

We use SagePay for Card Processing. OC Passes a 'VendorTXCode' (orderid), e.g 1, 2, 3, 4 etc

But in the past we have already used the codes 1, 2, 3, 4 etc in SagePay with another shop.

So now OC is trying to send same codes and SagePay does not allow duplicates, so basically I need a prefix on the VendorTXCode (orderid), e.g xx-1, xx-2, xx-3, xx-4, etc

Any Ideas?

Newbie

Posts

Joined
Sun Aug 14, 2011 6:56 pm

Post by lkfranklin » Mon Oct 17, 2011 5:14 pm

did you figure this out as im having the same problem..

thanks

New member

Posts

Joined
Sat May 07, 2011 6:36 am

Post by silentmedia » Tue Oct 18, 2011 1:06 am

Hi ikfranklin,

The error occurs because you have used the transaction code sent to sagepay before, maybe in another installation of oc or may be another cart. So, look through your old tx codes on sagepay or call sagepay to see what the last largest number was then run the below SQL to increase the starting number oc uses to send to sagepay in your current shop.

ALTER TABLE `order` AUTO_INCREMENT =10000

Example above starts the tx numbers from 10000.

I found this in a semi related article here... http://forum.opencart.com/viewtopic.php?t=5929 so a thank you to them.

Newbie

Posts

Joined
Sun Aug 14, 2011 6:56 pm

Post by lkfranklin » Tue Oct 18, 2011 4:41 pm

brilliant, thanks very much!:)

New member

Posts

Joined
Sat May 07, 2011 6:36 am

Post by gilbe » Mon Apr 23, 2012 1:56 am

Firstly sorry for starting up an old thread but I couldn't see another solution in the forum.

Reading the article linked by silentmedia I've tried a different approach to this. I think adding a "Store ID" and "Customer ID" prefix will give it the unique store related number that we need for sagepay.

I've started looking at the code but for some reason what I thought would be a simple string amendment isnt working. I'm editing the ../controller/payment/sagepay.php file and where it sets the 'VendorTXCode' I have amended similar to below:

$data['VendorTxCode'] = $this->session->data['store_id'] . '_' . $order_info['customer_id'] . '_' . $this->session->data['order_id'];

But this doesnt seem to be changing anything. I've even tried simpler strings ie:

$data['VendorTxCode'] = "ABC" . $this->session->data['order_id'];

and this doenst seem to do anything either. Am I missing something simple? Could it be something to do with the Cache?

New member

Posts

Joined
Wed Aug 05, 2009 11:00 pm


Post by SomethingFishy » Tue Aug 11, 2015 7:09 am

I'm sorry for reviving an old thread but I really need help understanding why the previous posters solution doesn't work. I want to add a number to the end of the orderId as if the customer backs out of the payment and then retries to make the payment the orderId is the same and so the payment returns the error

I can't get this code to work and don't know why:-

$data['VendorTxCode'] = $this->session->{data['order_id'] . time()};

I'm really using the time() as a unique random number generator, but it doesn't work :-(

Any tips to get this to work?


Posts

Joined
Mon Jul 13, 2015 11:38 pm

Post by SomethingFishy » Fri Aug 14, 2015 4:38 pm

It took me ages to get something to work, but I got there eventually.

I put the result of the time() function into a variable and then put the variable on to the end of the order_id.

This is shown in the code below.

Code: Select all

$t = time() ;
$data['VendorTxCode'] = $this->session->{data['order_id'] . $t };
I'm not sure why the other way didn't work, if anyone can explain I would appreciate it.

Also any comments on this solution would be appreciated


Posts

Joined
Mon Jul 13, 2015 11:38 pm
Who is online

Users browsing this forum: No registered users and 8 guests