[checkout] How do I change the order transaction id number & have it run in consecutive order?

battledingo
battledingo's picture

Joined: 2006-08-25
Posts: 39
Posted: Fri, 2008-06-06 09:42


Gallery version (not just "2"): 2.2
Module: checkout 0.3.3, Checkout by Paypal 0.3.1, Checkout by Email 0.3.1
PHP version (e.g. 5.1.6): 5.2.5
PHPInfo Link (see FAQ): (can't find the phpinfo.php file)
Webserver (e.g. Apache 1.3.33):Apache version 2.0.63
Database (e.g. MySql 5.0.32):MySQL version 4.1.22-standard
Activated toolkits (e.g. NetPbm, GD): NetPBM, imagemagick
Operating system (e.g. Linux):Linux
Browser (e.g. Firefox 2.0):firefox 2

Hi

When a checkout order is created, it's transaction id number jumps by even numbers. I would like to change the order number & have it run in consecutive numbers.

I need to change the order transaction id number as paypal will reject the orders. I have been using Gallery 1 and orders will be duplicated if I don't change the transaction number.

Thanks in advance, this is doing my head in. I am guessing it might be a problem with my mysql data base.

kind regards

Peter

 
alecmyers

Joined: 2006-08-01
Posts: 4342
Posted: Fri, 2008-06-06 12:44

No, it's not actually a problem with your database. And the numbers don't jump by even numbers. What happens is this: every time you confirm an order a set of database items is recorded, one for the transaction in toto and one each for each product in the order. The numbers are all taken from Gallery's sequencing of id numbers which is shared by all Gallery items including albums, photos and other stuff. So try two items in the order, and it will probably jump by +3.

So there's no way to either predict or control the transactionId number which is what is passed to paypal. It will jump by seemingly random amounts between orders depending on how many transactions have been recorded (and that includes one every time that you go to the 'confirm' page, even if you then go back and change the order) and how many items have been added to your gallery etc.

Basically, the transaction Id isn't intended to be sequential, and you can't make it so. They are however monotonically increasing, and unique (per gallery installation) although I've not heard of paypal rejecting orders with duplicate transaction numbers (paypal assigns its own tranaction numbers for its use, of course.)

One thing you could do is advance your g2 sequence number *past* the last order number from your G1 (didn't know that interfaced to paypal, but never mind) then there won't be any overlap. You can do that by advancing the single entry in the single column ('id') in the sequenceId table.

 
battledingo
battledingo's picture

Joined: 2006-08-25
Posts: 39
Posted: Fri, 2008-06-06 15:04

Hi Alecmyers

thanks for the quick reply. that explains it!! I couldn't find an explanation anywhere. Thanks for your help. I have renumbered the orders & there will be no paypal order rejections now.

thanks

peter

 
dmjendor

Joined: 2006-06-26
Posts: 1
Posted: Tue, 2010-02-09 20:12

Its been a while since this was posted and I can see that no change has been made to the code to allow you to specify an order number sequence. Is there possibly some way to add a new order number field that is incremented from a set value when an order is created and use that value instead of the default order numbers? My client has an existing order number structure and would like to keep using their structure if possible.

 
alecmyers

Joined: 2006-08-01
Posts: 4342
Posted: Tue, 2010-02-09 20:27
Quote:
Is there possibly some way to add a new order number field that is incremented from a set value when an order is created and use that value instead of the default order numbers? My client has an existing order number structure and would like to keep using their structure if possible.

It's possible, but it's a lot of work to add a feature that in the last four years only two people have suggested they need. At present, I'm unwilling to add more complexity to the code and to the user interface for something that I just don't see many people need or want, sorry.

EDIT: Actually three people - I just remembered a thread from the third. But that's still not many.

 
battledingo
battledingo's picture

Joined: 2006-08-25
Posts: 39
Posted: Tue, 2010-02-09 22:56

Thanks for your reply. I love gallery cart & think you have done a fantastic job. I don't think it is necessary to change the order numbers, especially if it is not in demand.

have a great day.

:)

 
alecmyers

Joined: 2006-08-01
Posts: 4342
Posted: Tue, 2010-02-09 23:10

Also I quite *like* having seemingly random leaps in the order number, I don't want my customers knowing how many orders I have!

 
battledingo
battledingo's picture

Joined: 2006-08-25
Posts: 39
Posted: Tue, 2010-02-09 23:19

yes, i like it as well. the order numbers jump & it looks like I am very busy.