If this is your first visit, check our documentation. To post, register or login.
Forums / Community Contributed Add-Ons / Addon Payment Modules / Bug in TheSecureGateway module

Bug in TheSecureGateway module

Started by jspector106 on 29 May 2013, 3:16 PM · Views: 1,094

Results 1 to 9 of 9
29 May 2013, 3:16 PM
#1
jspector106 avatar

jspector106

New Zenner

Join Date:
May 2013
Location:
Black Forest, CO
Posts:
12
Plugin Contributions:
0

Post #1 by jspector106

I migrated to a new payment gateway, The Secure Gateway and when I implemented it on 1.3.9, I got a zones table error. So I went ahead and upgraded my site to 1.5.0. here is the error I now get at checkout:

PHP Fatal error: 1146:Table 'DB******.zones' doesn't exist :: select zone_code from zones where zone_name like '%Colorado%' in /home/content/34/7174734/html/zencart_new/includes/classes/db/mysql/query_factory.php on line 101.

Not sure how to get past this. The site seems to hang at the Checkout process.

Any help or suggestions would be appreciated. I am late getting the site up for our summer activities.

Thanks,

Jeff

29 May 2013, 5:31 PM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,512
Plugin Contributions:
176

Post #2 by drbyte

You replaced part of the DB info with ******. But that's critical information needed to help you.
Can you reply with the details of the part you replaced with ******* ?

Also, what is the value of DB_DATABASE and DB_PREFIX in your /includes/configure.php file? They are not sensitive information, so are safe to post. (We don't need the DB_USERNAME or DB_PASSWORD, which are sensitive info.)

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

29 May 2013, 8:54 PM
#3
jspector106 avatar

jspector106

New Zenner

Join Date:
May 2013
Location:
Black Forest, CO
Posts:
12
Plugin Contributions:
0

Post #3 by jspector106

Hi Dr. Byte, Sorry for the lack of information.

DB = bfc1211403234954

DB_DATABASE = bfc1211403234954

DB_PREFIX = 'DB_PREFIX', 'zen_'

I suspect i know what the problem might be now. Please confirm what the PREFIX should be? is that the only issue, do you think?

Thanks for the help,

Jeff

29 May 2013, 9:01 PM
#4
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,512
Plugin Contributions:
176

Post #4 by drbyte

All Zen Cart core code uses tablenames like TABLE_ZONES and TABLE_ORDERS_STATUS_HISTORY which are constants defined as a combination of DB_PREFIX and the actual name of the table used without a prefix. This allows stores to have a table-prefix (defined by DB_PREFIX) to help differentiate between multiple ZC stores sharing a single database.
Some modules/plugins are poorly written and just hard-code the actual tablename without regard to prefix, and thus trigger the kind of error message you're reporting when running on stores such as yours which have been installed using a non-blank DB_PREFIX like yours.

So, whatever non-original-core-code you've added to your site is likely the culprit, and needs updating to use the correct tablename constant. They're all listed in /includes/database_tables.php as far as core code tables go.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

29 May 2013, 9:11 PM
#5
jspector106 avatar

jspector106

New Zenner

Join Date:
May 2013
Location:
Black Forest, CO
Posts:
12
Plugin Contributions:
0

Post #5 by jspector106

Thanks for that info. I didn't see anything in includes / database_tables.php that looked out of the ordinary.

The only change that was really made was the switch the new payment gateway, The Secure Gateway. Previously, I was using Authorizenet. is it possible that there is a hard coded "authorizenet" pointer where "the Secure Gateway" should go. I had no problems up until the switch. The folks at Newtek can't seem to identify their gateway as the source fo the problem.

Maybe someone is familiar with that gateway.....

Thanks,

29 May 2013, 9:14 PM
#6
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,512
Plugin Contributions:
176

Post #6 by drbyte

Attach a zip file containing the files for that module, and we can look at it. Or post a URL where it can be downloaded.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

30 May 2013, 4:58 AM
#8
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,512
Plugin Contributions:
176

Post #8 by drbyte

Yes, as I suspected. This part of the code is not written to support tablename prefixes:function get_state_abbr($state_desc) { global $db; $states = $db->Execute("select zone_code [B]from zones where[/B] zone_name like '%" . $state_desc . "%'"); while (!$states->EOF) { return $states->fields['zone_code']; } return $state_desc; }It would need to be changed to:```
function get_state_abbr($state_desc) {
global $db;
$states = $db->Execute("select zone_code [B]from " . TABLE_ZONES . " where[/B] zone_name like '%" . $state_desc . "%'");
while (!$states->EOF) {
return $states->fields['zone_code'];
}
return $state_desc;
}


You should also work directly with their technical support team to make correct adjustments to the following lines. If you don't, then your payment transactions are not being handled securely, and you run the risk of credit card theft: ```
        curl_setopt($c, CURLOPT_SSL_VERIFYHOST, 0);
        curl_setopt($c, CURLOPT_SSL_VERIFYPEER, 0);

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

30 May 2013, 1:12 PM
#9
jspector106 avatar

jspector106

New Zenner

Join Date:
May 2013
Location:
Black Forest, CO
Posts:
12
Plugin Contributions:
0

Post #9 by jspector106

Thanks so much for that information. I will forward that on to them. Interestingly, even with my very limited knowledge, I pointed out to them that this area might be part of the issue since the error line was in there. Their initial response was to have me comment it out. Which, of course, did not work either.

So, I will get this back to them to make the correction in their includes.

Thanks again!!!!!!

Jeff