LinkPoint module for Zencart V1.3.7.1 generates mySQL errors when user is trying to confirm purchase. My linkpoint gateway is working fine but I am getting mysql errors when trying to place orders. The mySQL error I am getting is:
"1265 Data truncated for column 'lp_trans_num' at row 1
in:
[update orders set lp_trans_num ='4162D97C-4824C20E-998-AFA3C' where orders_id = '14']".
The "orders" table has a column called "lp_trans_num" of type int(11) and the script is trying to stuff a varchar number like this in it "4162D97C-4824C20E-998-AFA3C" which is generating a mySQL error. This is in Production Mode. That number in the sql statement is the same as "Order Number" when i login to the YourPay site to view my transactions. Again it is what the YourPay site describes as ORDER NUMBER and NOT the transaction number. The Trans ID for an order in my YourPay site was a 12 digit integer which would still not fit into lp_trans_num int(11) either. After looking at another table called `linkpoint_api` in zencart database i noticed that it too has a column called `lp_trans_num` but unlike the orders table it has a type of varchar(64) not int(11). This database does not seem to be configured correctly. I am scared to make the changes less I know what the outcome could be since i did not write this module and dont know exactly how it works. This module has obviously been configured wrong and I need to know how to fix it. It is the built in module so it should not be giving me problems! By the way when trying to place an order in Test Mode i get another error except because it is trying to put an empty string in to `lp_trans_num` which is also illegal.
Also, the LinkPoint gateway is working fine on its side. Logging into their site shows the correct orders and transaction. It is the zencart module that is not getting and storing the correct information into the database and generating sql errors as it tries to.
After changing the lp_trans_num in the orders table from type int(11) to varchar(64) it is now storing the "transaction number". The database was obviously configured wrong in this file /includes/modules/payment/linkpoint_api.php line 591: $sql = "ALTER TABLE " . TABLE_ORDERS . " ADD lp_trans_num int(11) NOT NULL DEFAULT 0"; This shuold be changed from int(11) to varchar(64) by the ZenCart team.....
Bookmarks