Store generates a new ID for each order (as Anna mentioned, this is based on the
id column in the
exp_store_orders table). Therefore it should not be possible for two orders to be created with the same ID, or payment to be submitted twice via Paypal.
What I assume happened is one of two things.
- At some point in the past you have had different shopping cart software linked to this PayPal account. This means that Store is trying to re-use IDs which have already been used by different software linked to your PayPal account.
- Alternatively, it's possible during testing you made a bunch of test orders, then deleted them and restarted Store's order numbering scheme, causing IDs to be reused. However, you didn't mention this in your question, so I'm going to assume this is not the case.
In any case, the easiest option is simply to disable PayPal's duplicate invoice ID check. Store already has its own checks to ensure orders are not paid twice, so the PayPal check is redundant. You can disable this check by logging into PayPal, under:
My Account > Profile > My Selling Tools > Credit Card Statement Name > "Allow multiple payments per invoice ID"