Home » Item #953
I am using Protx to process my payments. Customers have started reporting problems; it seems as though every order is being rejected. When I activate the 'senderroremails' config setting, I get mails through with each failure that start as follows:
An error has occurred whilst performing payment. The details below outline the error. Please check your gateway config settings.
Description: Order already submitted (ID: 123, Order sent: 'y') CactuShop Version: 6
Gateway: protx
Why is this and what can I do to fix it?
This error is created by Protx, and can also occur with CactuShop v5, although the notification to the user in CactuShop will be different.
The problem occurs because unlike virtually all other payment gateways, Protx requires that each transaction ID submitted to it be unique on its system (and not just to your account).
So for example, if you try to submit an order with a transaction ID of 123 (because your database gave it that number), Protx will not accept it because '123' has already been used as a transaction ID before (by another Protx customer).
Since we cannot pass order IDs to Protx by simply using the numerical database ID (because they will almost certainly have been used before), we prefix this with the CactuShop license number of the store. This creates a string such as XXXYYYYY-9999-001123 which is highly unlikely to clash with the IDs that have been submitted by anyone else.
However, problems can still occur if you do anything that resets the orders table or otherwise results in previously-used IDs being sent to Protx. This can happen for example if you configure your store ready to run with a clean Access database, do a few test orders, and then overwrite the live database with your 'clean' backup once the tests are complete. The next order will fail, since you've effectively wound your database back to the position it was prior to your live tests, and you cannot resubmit the same order IDs to Protx again.
It can also happen if you close a site that ran with Protx and then recycle the license number on a new site that also used Protx. You will probably clear down the database and compact it, which resets the IDs in the order table to start from the beginning again.
There are a number of ways to approach this problem. The most obvious is to change the license number if you are under support coverage and can open a support ticket. You must arrange this with us to ensure that the new number is issued by us and set up on our system, otherwise the newsfeed will return 'bad license', and some features like the currency rates lookup would fail. Running a license number that is not issued by Cactusoft is a license breach.
The next solution is to bump up the order ID numbers being issued to above the level previously reached. More info here:
[#920] How do I increase the order number that CactuShop starts numbering from?
The final option is to modify the scripts so that you add an extra character to the value passed to Protx. In this case, you must also ensure you remove this extra value on the callback step. CactuShop needs to know the order ID in order to recover the order from the database and process the callback. This is normally done by removing the license number from the transaction ID and looking for an order with that ID, but unless you remove your extra character, this would fail.