close ad
Help us test the new Databridge BETA with MySQLi support
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

UspsCom::DoAuth 80040b1aAuthorization failure. You are not authorized to connect to

Thread began 4/09/2012 9:49 pm by lr_leal239405 | Last modified 5/25/2012 12:59 pm by Jason Byrnes | 7305 views | 17 replies |

lr_leal239405

UspsCom::DoAuth 80040b1aAuthorization failure. You are not authorized to connect to

I'm trying to apply USPS shipping to my checkout. I keep getting 'UspsCom::DoAuth 80040b1aAuthorization failure. You are not authorized to connect to this server. UspsCom::DoAuth'. I tried different USPS server addresses from what I found on the forums and USPS instructions, but so far I can't get in. I did find on the forums the following response:

"eCart uses the V3 rate request API which is not supported on the testing server, you will need to use the production server address, and contact USPS to have you account updated to use the production server."

Is this still the case? Do I have to go with the production address?

Sign in to reply to this post

lr_leal239405

I ended up trying the url: ShippingAPITest.dll

and now I'm getting this:

"RateV3 is not a valid API name for this protocol"

so I guess this is answering my first question.

Sign in to reply to this post

Jason ByrnesWebAssist

yes, you will need to use the production address:
shippingapi.dll

you may also need to contact USPS to have your account upgraded to allow connecting to the production server.

Sign in to reply to this post

lr_leal239405

It works now, but my formulas are wrong. The shipping charges are extremely high. I've attached a couple of snapshots of what I got. It adds a line for shipping on the item and then again for USPS shipping. But even for a 2 oz item the shipping is more than doubled when I add two items to the cart. Can you let me know how to write the formula? I have the item as weighing 2 oz. Thanks.

Attached Files
extra.zip
Sign in to reply to this post

Jason ByrnesWebAssist

on the shipping tab, you probably have 2 shipping rules, one for USPS and a second for the Book and DVD set, both using the rate returned, i would think you only need the one rule.

the rate returned by USPS will depend on the setting you use in the USPS shipping server behavior on the confirm page.

Open the confirm page, then double click on the USPS Shipping server behavior to inspect the settings, on the last page, make sure that you have set the weight units to Ounces if that is what is being used in the cart.

Sign in to reply to this post

lr_leal239405

This post has been deleted.

lr_leal239405

ok. that was indeed the case. I removed Book and DVD shipping.

Also, in the weight units of the USPS Server behavior, I see this line of code:

$Shipping_PackageArray[$Shipping_PackageIndex]["WeightUnits"] = "".strtolower($eCart1->WeightUnits) ."";

I changed to oz and it seems to be calculating differently. Why wouldn't it just pick up that info from the eCart object?

And why is it that the calculation for one item is $3.16 (10 oz. item) but then for two, it more than doubles shipping price at $10.60? I can't understand that. It should be maybe another dollar or two I would think.

Sorry for all the questions, but this is the first time ever that I'm doing this.

Thank you.

Sign in to reply to this post

Jason ByrnesWebAssist

in the eCart object what are the weight units set to, the default weight units are Ponds, not ounces.

In the shipping rate behavior, do you have it set to for One package for the entire order? OR set to a package for each item?

By the fact that it is doubling the shipping rate, it sounds like it is set to a package for each item.

Sign in to reply to this post

lr_leal239405

It's set to oz in the eCart object per my previous posts. The Shipping Rate behavior is set for 1 package for entire order. It's not doubling it, it's more than than doubling it per my previous post. I now have the item at 16 oz. It's $5.20 for one item and $10.60 for two. For a 4 oz. item it's coming up with $2.12 for one item, $5.60 for two and $10.44 for three. Below is the code for the USPS behavior.

<?php
if ($_SERVER["REQUEST_METHOD"] == "POST") {
//WA eCart (Copyright 2007, WebAssist)
//WA eCart USPS Shipping - USPS
$Shipping_SuccessURL = "";
$Shipping_FailureURL = "shipping_failure.php";
$Shipping_Packaging = 0;
$Shipping_PackageArray = array();
$Shipping_PackageIndex = 0;
$Shipping_Counter = 0;
$Shipping_Parameters = array();
$Shipping_Parameters["UserID"] = "";
$Shipping_Parameters["USPSServer"] = "http://production.shippingapis.com/shippingapi.dll";
$Shipping_Parameters["CarrierCode"] = "FIRST CLASS";
$Shipping_Parameters["DefaultIntl"] = "none";
$Shipping_Parameters["ShipperZip"] = "07470";
$Shipping_Parameters["ShiptoZip"] = "".((isset($_POST["shipping_postcode"]))?$_POST["shipping_postcode"]:"") ."";
$Shipping_Parameters["ShiptoCountry"] = "".((isset($_POST["shipping_country"]))?$_POST["shipping_country"]:"") ."";
while (($Shipping_Packaging == 1 && !$eCart1->EOF()) || ($Shipping_Packaging == 0 && $Shipping_Counter == 0)) {
if (WA_eCart_USPS_IsTrueValue("true")) {
$Shipping_PackageArray[] = array();
$Shipping_PackageIndex = sizeof($Shipping_PackageArray)-1;
$Shipping_PackageArray[$Shipping_PackageIndex]["eCart_Quantity"] = (($Shipping_Packaging == 1)?$eCart1->DisplayInfo("Quantity"):1);
$Shipping_PackageArray[$Shipping_PackageIndex]["IsPackage"] = "true";
$Shipping_PackageArray[$Shipping_PackageIndex]["Quantity"] = "".WA_eCart_FormatNumber($eCart1->DisplayInfo('Quantity'), true, 1) ."";
$Shipping_PackageArray[$Shipping_PackageIndex]["WeightUnits"] = "oz";
$Shipping_PackageArray[$Shipping_PackageIndex]["PackageWeight"] = "".WA_eCart_FormatNumber($eCart1->TotalColumn('TotalWeight'), true, 1) ."";
$Shipping_PackageArray[$Shipping_PackageIndex]["PackageType"] = "YOURPACKAGING";
$Shipping_PackageArray[$Shipping_PackageIndex]["PackageSize"] = "REGULAR";
$Shipping_PackageArray[$Shipping_PackageIndex]["PackageMachinable"] = "true";
$Shipping_PackageArray[$Shipping_PackageIndex]["IPackageType"] = "Package";
//Special Services
}
$Shipping_Counter++;
if ($Shipping_Packaging == 1) $eCart1->MoveNext();
}
if ($Shipping_Packaging == 1) $eCart1->MoveFirst();
$Shipping_Result = WA_eCart_USPS_GetRateQuote($eCart1, $Shipping_Parameters, $Shipping_PackageArray);
if ($Shipping_Result && $Shipping_SuccessURL != "")
$eCart1->redirStr = $Shipping_SuccessURL;
else if (!$Shipping_Result && $Shipping_FailureURL != "") {
Header("Location: " . $Shipping_FailureURL); exit;
}
}
else if (!isset($_SESSION["eCart1_USPS_Success"])) {
WA_eCart_USPS_SetSessionDefaults($eCart1);
}
?>

Sign in to reply to this post

Jason ByrnesWebAssist

since you are using one package for entire order, the package quantity should be set to 1:
change:

php:
$Shipping_PackageArray[$Shipping_PackageIndex]["Quantity"] = "".WA_eCart_FormatNumber($eCart1->DisplayInfo('Quantity'), true, 1) ."";




to:

php:
$Shipping_PackageArray[$Shipping_PackageIndex]["Quantity"] = "1";
Sign in to reply to this post
loading

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...