Totally Zenned
- Join Date:
- Apr 2007
- Posts:
- 632
- Plugin Contributions:
- 0
Stamps.com getting error while importing
I am trying to use Stamps.com, but where the heck is the batch file??? I can't find it anywhere.
Views: 25,453
Totally Zenned
I am trying to use Stamps.com, but where the heck is the batch file??? I can't find it anywhere.
New Zenner
Hello,
If there is anything else you need help with, please feel free to let me know.
Thanks!
Chuck
Stamps.com
Zen Follower
I just got done upgrading to 1.5.3, and stamps.com will no longer import orders. It appears to be a compatibility issue, but I have no clue what to edit, so that it will work again. I tested, and it can access the database by doing this:
https:// my site admin /stamps.php?shipping_access_token=XXXXXXXXXXXXXXXXXXXXXX&cmd=ping
I have already tried the latest stamps.com integration software, and they claim it has only been tested to work up to 1.5.0
Totally Zenned
Can't help with the Stamps.com issue other than to offer a suggestion.
ShipStation.com has a better interface, has the capability of applying rules and filters that you build to orders imported and has the ability to use both Stamps.com (or Endicia) and Express1 rates for printing USPS postage. Will also print UPS and Fedex labels if you have accounts with them. When shipping Priority and Express mail, Express 1 rates are better than Stamps.com
OH, and Stamps.com recently bought ShipStation.
If you are not subscribed to receive zencart notices, the zencart USPS plugin will be updated next week so that it will work with the USPS updates that go into effect on Sept 7, 2014.
Zen Follower
I may have to do that. I just don't like how ship station is double the price of stamps.com
Totally Zenned
That was my thought too, initially. It doesn't take much shipping per month to offset the expense with timesavings and reduced frustration by not beating my head against the wall every time I had a Stamps.com problem and the months it took for them to address the problems.
Zen Follower
I started the free trial of ship station, and I really like how it works, but it is going to cost me $65 a month, because I also import orders from Ebay, and Paypal.
Totally Zenned
Instead of upgrading from bronze to gold,
Try Changing your subscription plan and instead of clicking the upgrade button for silver or gold, look in the upper right of that window and try Increasing the number of selling channels by 2 which appears to keep the features of bronze but allowing 3 channels @ $10/channel instead of $20/channel.
Zen Follower
RixStix:
Instead of upgrading from bronze to gold,
Try Changing your subscription plan and instead of clicking the upgrade button for silver or gold, look in the upper right of that window and try Increasing the number of selling channels by 2 which appears to keep the features of bronze but allowing 3 channels @ $10/channel instead of $20/channel.
Apparently they won't let me do that until the trial is over.
Does anybody have any suggestion on how to add logon credentials to ShippingZSettings.php, or another workaround to make this work again? I can always just use the sales record form Paypal to ship from, but it doesn't post back to zencart.
Zen Follower
I recently upgraded to the new stamps.com software, and you now install it in the admin folder, and it goes straight to the database. It is working flawlessly, except it sets an error in the log folder every time.
I had to edit out the admin folder name, and login credentials on this:
[18-Sep-2015 10:07:27 America/Denver] Request URI: /XXXXXXXXXXXXXXXX/stamps.php?username=XXXXXXXXXXXXXXXX&password=XXXXXXXXXXXXXXXX&action=getorders&maxcount=50&start=2015-09-17T22%3A00%3A51, IP address: 216.52.211.20
#1 mysql_real_escape_string() called at [/home2/redsauto/public_html/XXXXXXXXXXXXXXXX/stamps.php:828]
#2 GetCountryID() called at [/home2/redsauto/public_html/XXXXXXXXXXXXXXXX/stamps.php:846]
#3 GetStateCode() called at [/home2/redsauto/public_html/XXXXXXXXXXXXXXXX/stamps.php:492]
#4 WriteOrder() called at [/home2/redsauto/public_html/XXXXXXXXXXXXXXXX/stamps.php:384]
#5 Action_GetOrders() called at [/home2/redsauto/XXXXXXXXXXXXXXXX/stamps.php:176]
[18-Sep-2015 10:07:27 America/Denver] PHP Warning: mysql_real_escape_string(): Access denied for user 'XXXXXXXXXXXXXXXX'@'localhost' (using password: NO) in /home2/redsauto/public_html/XXXXXXXXXXXXXXXX/stamps.php on line 828
[18-Sep-2015 10:07:27 America/Denver] Request URI: XXXXXXXXXXXXXXXX/stamps.php?username=XXXXXXXXXXXXXXXX&password=XXXXXXXXXXXXXXXX&action=getorders&maxcount=50&start=2015-09-17T22%3A00%3A51, IP address: 216.52.211.20
#1 mysql_real_escape_string() called at [/home2/redsauto/public_html/XXXXXXXXXXXXXXXX/stamps.php:828]
#2 GetCountryID() called at [/home2/redsauto/public_html/XXXXXXXXXXXXXXXX/stamps.php:846]
#3 GetStateCode() called at [/home2/redsauto/public_html/XXXXXXXXXXXXXXXX/stamps.php:492]
#4 WriteOrder() called at [/home2/redsauto/public_html/XXXXXXXXXXXXXXXX/stamps.php:384]
#5 Action_GetOrders() called at [/home2/redsauto/public_html/XXXXXXXXXXXXXXXX/stamps.php:176]
[18-Sep-2015 10:07:27 America/Denver] PHP Warning: mysql_real_escape_string(): A link to the server could not be established in /home2/redsauto/public_html/XXXXXXXXXXXXXXXX/stamps.php on line 828
[18-Sep-2015 10:07:27 America/Denver] Request URI: /XXXXXXXXXXXXXXXX/stamps.php?username=XXXXXXXXXXXXXXXX&password=XXXXXXXXXXXXXXXX&action=getorders&maxcount=50&start=2015-09-17T22%3A00%3A51, IP address: 216.52.211.20
#1 mysql_real_escape_string() called at [/home2/redsauto/public_html/XXXXXXXXXXXXXXXX/stamps.php:855]
#2 GetStateCode() called at [/home2/redsauto/public_html/XXXXXXXXXXXXXXXX/stamps.php:492]
#3 WriteOrder() called at [/home2/redsauto/public_html/XXXXXXXXXXXXXXXX/stamps.php:384]
#4 Action_GetOrders() called at [/home2/redsauto/public_html/XXXXXXXXXXXXXXXX/stamps.php:176]
[18-Sep-2015 10:07:27 America/Denver] PHP Warning: mysql_real_escape_string(): Access denied for user 'XXXXXXXXXXXXXXXX'@'localhost' (using password: NO) in /home2/redsauto/public_html/XXXXXXXXXXXXXXXX/stamps.php on line 855
[18-Sep-2015 10:07:27 America/Denver] Request URI: /XXXXXXXXXXXXXXXX/stamps.php?username=XXXXXXXXXXXXXXXX&password=XXXXXXXXXXXXXXXX&action=getorders&maxcount=50&start=2015-09-17T22%3A00%3A51, IP address: 216.52.211.20
#1 mysql_real_escape_string() called at [/home2/redsauto/public_html/XXXXXXXXXXXXXXXX/stamps.php:855]
#2 GetStateCode() called at [/home2/redsauto/public_html/XXXXXXXXXXXXXXXX/stamps.php:492]
#3 WriteOrder() called at [/home2/redsauto/public_html/XXXXXXXXXXXXXXXX/stamps.php:384]
#4 Action_GetOrders() called at [/home2/redsauto/public_html/XXXXXXXXXXXXXXXX/stamps.php:176]
[18-Sep-2015 10:07:27 America/Denver] PHP Warning: mysql_real_escape_string(): A link to the server could not be established in /home2/redsauto/public_html/XXXXXXXXXXXXXXXX/stamps.php on line 855
[18-Sep-2015 10:07:27 America/Denver] Request URI: /XXXXXXXXXXXXXXXX/stamps.php?username=XXXXXXXXXXXXXXXX&password=XXXXXXXXXXXXXXXX&action=getorders&maxcount=50&start=2015-09-17T22%3A00%3A51, IP address: 216.52.211.20
#1 mysql_real_escape_string() called at [/home2/redsauto/public_html/XXXXXXXXXXXXXXXX/stamps.php:856]
#2 GetStateCode() called at [/home2/redsauto/public_html/XXXXXXXXXXXXXXXX/stamps.php:492]
#3 WriteOrder() called at [/home2/redsauto/public_html/XXXXXXXXXXXXXXXX/stamps.php:384]
#4 Action_GetOrders() called at [/home2/redsauto/public_html/XXXXXXXXXXXXXXXX/stamps.php:176]
[18-Sep-2015 10:07:27 America/Denver] PHP Warning: mysql_real_escape_string(): Access denied for user 'XXXXXXXXXXXXXXXX'@'localhost' (using password: NO) in /home2/redsauto/public_html/XXXXXXXXXXXXXXXX/stamps.php on line 856
[18-Sep-2015 10:07:27 America/Denver] Request URI: /XXXXXXXXXXXXXXXX/stamps.php?username=XXXXXXXXXXXXXXXX&password=XXXXXXXXXXXXXXXX&action=getorders&maxcount=50&start=2015-09-17T22%3A00%3A51, IP address: 216.52.211.20
#1 mysql_real_escape_string() called at [/home2/redsauto/public_html/XXXXXXXXXXXXXXXX/stamps.php:856]
#2 GetStateCode() called at [/home2/redsauto/public_html/XXXXXXXXXXXXXXXX/stamps.php:492]
#3 WriteOrder() called at [/home2/redsauto/public_html/XXXXXXXXXXXXXXXX/stamps.php:384]
#4 Action_GetOrders() called at [/home2/redsauto/public_html/XXXXXXXXXXXXXXXX/stamps.php:176]
[18-Sep-2015 10:07:27 America/Denver] PHP Warning: mysql_real_escape_string(): A link to the server could not be established in /home2/redsauto/public_html/XXXXXXXXXXXXXXXX/stamps.php on line 856
[18-Sep-2015 10:07:27 America/Denver] Request URI: /XXXXXXXXXXXXXXXX/stamps.php?username=XXXXXXXXXXXXXXXX&password=XXXXXXXXXXXXXXXX&action=getorders&maxcount=50&start=2015-09-17T22%3A00%3A51, IP address: 216.52.211.20
#1 mysql_real_escape_string() called at [/home2/redsauto/public_html/XXXXXXXXXXXXXXXX/stamps.php:828]
#2 GetCountryID() called at [/home2/redsauto/public_html/XXXXXXXXXXXXXXXX/stamps.php:846]
#3 GetStateCode() called at [/home2/redsauto/public_html/XXXXXXXXXXXXXXXX/stamps.php:506]
#4 WriteOrder() called at [/home2/redsauto/public_html/XXXXXXXXXXXXXXXX/stamps.php:384]
#5 Action_GetOrders() called at [/home2/redsauto/public_html/XXXXXXXXXXXXXXXX/stamps.php:176]
[18-Sep-2015 10:07:27 America/Denver] PHP Warning: mysql_real_escape_string(): Access denied for user 'XXXXXXXXXXXXXXXX'@'localhost' (using password: NO) in /home2/redsauto/public_html/XXXXXXXXXXXXXXXX/stamps.php on line 828
[18-Sep-2015 10:07:27 America/Denver] Request URI: /XXXXXXXXXXXXXXXX/stamps.php?username=XXXXXXXXXXXXXXXX&password=XXXXXXXXXXXXXXXX&action=getorders&maxcount=50&start=2015-09-17T22%3A00%3A51, IP address: 216.52.211.20
#1 mysql_real_escape_string() called at [/home2/redsauto/public_html/XXXXXXXXXXXXXXXX/stamps.php:828]
#2 GetCountryID() called at [/home2/redsauto/public_html/XXXXXXXXXXXXXXXX/stamps.php:846]
#3 GetStateCode() called at [/home2/redsauto/public_html/XXXXXXXXXXXXXXXX/stamps.php:506]
#4 WriteOrder() called at [/home2/redsauto/public_html/XXXXXXXXXXXXXXXX/stamps.php:384]
#5 Action_GetOrders() called at [/home2/redsauto/public_html/XXXXXXXXXXXXXXXX/stamps.php:176]
[18-Sep-2015 10:07:27 America/Denver] PHP Warning: mysql_real_escape_string(): A link to the server could not be established in /home2/redsauto/public_html/XXXXXXXXXXXXXXXX/stamps.php on line 828
[18-Sep-2015 10:07:27 America/Denver] Request URI: /XXXXXXXXXXXXXXXX/stamps.php?username=XXXXXXXXXXXXXXXX&password=XXXXXXXXXXXXXXXX&action=getorders&maxcount=50&start=2015-09-17T22%3A00%3A51, IP address: 216.52.211.20
#1 mysql_real_escape_string() called at [/home2/redsauto/public_html/XXXXXXXXXXXXXXXX/stamps.php:855]
#2 GetStateCode() called at [/home2/redsauto/public_html/XXXXXXXXXXXXXXXX/stamps.php:506]
#3 WriteOrder() called at [/home2/redsauto/public_html/XXXXXXXXXXXXXXXX/stamps.php:384]
#4 Action_GetOrders() called at [/home2/redsauto/public_html/XXXXXXXXXXXXXXXX/stamps.php:176]
[18-Sep-2015 10:07:27 America/Denver] PHP Warning: mysql_real_escape_string(): Access denied for user 'XXXXXXXXXXXXXXXX'@'localhost' (using password: NO) in /home2/redsauto/public_html/XXXXXXXXXXXXXXXX/stamps.php on line 855
[18-Sep-2015 10:07:27 America/Denver] Request URI: /XXXXXXXXXXXXXXXX/stamps.php?username=XXXXXXXXXXXXXXXX&password=XXXXXXXXXXXXXXXX&action=getorders&maxcount=50&start=2015-09-17T22%3A00%3A51, IP address: 216.52.211.20
#1 mysql_real_escape_string() called at [/home2/redsauto/public_html/XXXXXXXXXXXXXXXX/stamps.php:855]
#2 GetStateCode() called at [/home2/redsauto/public_html/XXXXXXXXXXXXXXXX/stamps.php:506]
#3 WriteOrder() called at [/home2/redsauto/public_html/XXXXXXXXXXXXXXXX/stamps.php:384]
#4 Action_GetOrders() called at [/home2/redsauto/public_html/XXXXXXXXXXXXXXXX/stamps.php:176]
[18-Sep-2015 10:07:27 America/Denver] PHP Warning: mysql_real_escape_string(): A link to the server could not be established in /home2/redsauto/public_html/XXXXXXXXXXXXXXXX/stamps.php on line 855
[18-Sep-2015 10:07:27 America/Denver] Request URI: /XXXXXXXXXXXXXXXX/stamps.php?username=XXXXXXXXXXXXXXXX&password=XXXXXXXXXXXXXXXX&action=getorders&maxcount=50&start=2015-09-17T22%3A00%3A51, IP address: 216.52.211.20
#1 mysql_real_escape_string() called at [/home2/redsauto/public_html/XXXXXXXXXXXXXXXX/stamps.php:856]
#2 GetStateCode() called at [/home2/redsauto/public_html/XXXXXXXXXXXXXXXX/stamps.php:506]
#3 WriteOrder() called at [/home2/redsauto/public_html/XXXXXXXXXXXXXXXX/stamps.php:384]
#4 Action_GetOrders() called at [/home2/redsauto/public_html/XXXXXXXXXXXXXXXX/stamps.php:176]
[18-Sep-2015 10:07:27 America/Denver] PHP Warning: mysql_real_escape_string(): Access denied for user 'XXXXXXXXXXXXXXXX'@'localhost' (using password: NO) in /home2/redsauto/public_html/XXXXXXXXXXXXXXXX/stamps.php on line 856
[18-Sep-2015 10:07:27 America/Denver] Request URI: /XXXXXXXXXXXXXXXX/stamps.php?username=XXXXXXXXXXXXXXXX&password=XXXXXXXXXXXXXXXX&action=getorders&maxcount=50&start=2015-09-17T22%3A00%3A51, IP address: 216.52.211.20
#1 mysql_real_escape_string() called at [/home2/redsauto/public_html/XXXXXXXXXXXXXXXX/stamps.php:856]
#2 GetStateCode() called at [/home2/redsauto/public_html/XXXXXXXXXXXXXXXX/stamps.php:506]
#3 WriteOrder() called at [/home2/redsauto/public_html/XXXXXXXXXXXXXXXX/stamps.php:384]
#4 Action_GetOrders() called at [/home2/redsauto/public_html/XXXXXXXXXXXXXXXX/stamps.php:176]
[18-Sep-2015 10:07:27 America/Denver] PHP Warning: mysql_real_escape_string(): A link to the server could not be established in /home2/redsauto/public_html/XXXXXXXXXXXXXXXX/stamps.php on line 856
Lines 171-179
switch (strtolower($action))
{
case 'getmodule': Action_GetModule(); break;
case 'getstore': Action_GetStore(); break;
case 'getcount': Action_GetCount(); break;
case 'getorders': Action_GetOrders(); break;
case 'getstatuscodes': Action_GetStatusCodes(); break;
case 'updatestatus': Action_UpdateStatus(); break;
default: outputError(60, "'$action' not supported");
lines 381-387
$processedIds .= $row->fields['orders_id'];
// output the order xml
WriteOrder($row);
// Next order
$row->MoveNext();
lines 485-497
writeStartTag("ShippingAddress");
writeElement("FullName", $row->fields['delivery_name']);
writeElement("Company", $row->fields['delivery_company']);
writeElement("Street1", $row->fields['delivery_street_address']);
writeElement("Street2", $row->fields['delivery_suburb']);
writeElement("Street3", "");
writeElement("City", $row->fields['delivery_city']);
writeElement("State", GetStateCode($row->fields['delivery_country'], $row->fields['delivery_state']));
writeElement("PostalCode", $row->fields['delivery_postcode']);
writeElement("Country", $row->fields['delivery_country']);
writeElement("Phone", $shipPhone);
writeElement("Email", $shipEmail);
writeCloseTag("ShippingAddress");
lines 824-867
function GetCountryID($country_name)
{
global $db;
$qry = sprintf("select countries_id from ". TABLE_COUNTRIES. " where countries_name = '%s'",
mysql_real_escape_string($country_name));
$countryQuery = $db->Execute($qry);
if ($countryQuery->RecordCount() == 0)
{
return $country_name;
}
else
{
return $countryQuery->fields['countries_id'];
}
}
// Returns the state code for a given state and country name
function GetStateCode($country_name, $state_name)
{
global $db;
$country_id = GetCountryID($country_name);
if ($country_id == '')
{
return $state_name;
}
// now lookup the state code based on countryid and state name
$qry = sprintf("select zone_code from ". TABLE_ZONES. " where zone_country_id = '%s' and zone_name = '%s'",
mysql_real_escape_string($country_id),
mysql_real_escape_string($state_name));
$stateQuery = $db->Execute($qry);
if ($stateQuery->RecordCount() == 0)
{
return $state_name;
}
else
{
return $stateQuery->fields['zone_code'];
}
}
Administrator
I've reported this issue to stamps.com (and included the suggested correction). There are 3 areas to be changed:
Line 776:
$comments = /*mysql_escape_string($_REQUEST['comments'])*/ $db->prepare_input ($_REQUEST['comments']); //-20150917-lat9 *** 1 of 3 ***
Line 828
/*mysql_real_escape_string($country_name)*/ $db->prepare_input ($country_name)); //-20150917-lat9 *** 2 of 3 ***
Lines 854-856
$qry = sprintf("select zone_code from ". TABLE_ZONES. " where zone_country_id = '%s' and zone_name = '%s'",
/*mysql_real_escape_string($country_id)*/ $db->prepare_input ($country_id),
/*mysql_real_escape_string($state_name)*/ $db->prepare_input ($state_name)); //-20150917-lat9 *** 3 of 3 ***
Zen Follower
Thank you, that fixed it.
Administrator
Excellent! According to the customer-care email that I received from stamps.com, they should have those changes incorporated real-soon-now.
Zen Follower
You mean, two years from now, right?
Administrator
vanhorn_s:
You mean, two years from now, right?
We'll see; they were quite responsive to the email query that I sent in. Since they've got the fix, "all" they need to do is re-validate and release!
Zen Follower
The last time I emailed them a fix, they told me they would implement it, but they never did.
Totally Zenned
And people ask why we switched from the Stamps.com interface to
ShipStation.com interface with is owned by Stamps.com but easier to implement, more functionality and includes a better rate discount for PriorityMail through an ExpressONE account running parallel to Stamps.com account.
I did receive a notice a few months ago that a priority issue/trouble ticket generated 18 months ago was finally patched.
Zen Follower
I tried shipstation last time there was a serious issue, and It works great, but I didn't want to pay the extra amount.
I figured out what the problem was, and that was the one they never fixed, after I emailed it to them.
https://www.zen-cart.com/showthread.php?214441-stamps-com-no-longer-working-with-1-5-3/page2
New Zenner
tonyreynolds:
OK, So I got 1 hit when I searched both on the Admin/Catalog, but zero hits when I searched Catalog only. The stamps.php file is in the catalog root directory. I take the search to mean that the function is not available from the catalog root directory.
I will research to insure the stamps.php file is in the correct location.TR
The stamps.php file was in the wrong place. It should be in the admin folder and updated to the correct path in the stamps.com software.
Thanks everybody for their help. I learned a new Zen tool as well!
TR
New Zenner
I was able to get stamps.com integration to work with 1.5.5e with this version where I made a few edits to the file to account for the Mysql depreciated functions and replaced them with MySqli equivalents. I am quite sure there are more elegant ways to get this fixed but for now I would like some comments from the other programmers if this compromises security doing it this way.
I modified the original function:
// Returns the zen country id for the given named country
function GetCountryID($country_name)
{
global $db;
$qry = sprintf("select countries_id from ". TABLE_COUNTRIES. " where countries_name = '%s'",
mysql_real_escape_string($country_name));
$countryQuery = $db->Execute($qry);
if ($countryQuery->RecordCount() == 0)
{
return $country_name;
}
else
{
return $countryQuery->fields['countries_id'];
}
}
and changed it to look like this since the mysqli_real_escape_string() requires a connection string as the first parameter:
// Returns the zen country id for the given named country
function GetCountryID($country_name)
{
global $db;
$mysqli = new mysqli('DB_SERVER' , 'DB_SERVER_USERNAME' , 'DB_SERVER_PASSWORD' , 'DB_DATABASE' );
$qry = sprintf("select countries_id from ". TABLE_COUNTRIES. " where countries_name = '%s'",
mysqli_real_escape_string($mysqli, $country_name));
$countryQuery = $db->Execute($qry);
if ($countryQuery->RecordCount() == 0)
{
return $country_name;
}
else
{
return $countryQuery->fields['countries_id'];
}
}
I did the same for three other functions that were using similar code see the attached updated stamps module if you wish to see the all the changes.
Tell staff why this post should be reviewed.