Jump to content

Resolved - USPS Module not working


Guest AlanGalbraith

Recommended Posts

Guest AlanGalbraith

The USPS shipping option isnt showing up when I go to check out in my store... (although others, ala UPS are)

is there any kinda sneaky setting in the USPS shipping module that I could be missing?

I've made sure that the zones are set both in the shipping module and in the Zones setting

I've made sure the "Status" check mark for the module is checked in both the Shipping list and the USPS Shipping Module Settings

I've made sure that my USPS username is correctly entered.

I've cleared my store cache and tried it all again

any help?

looking at my request logs it looks like my UPS requests are going through fine... which would make sense since that module is working... but I'm getting an error returned from the USPS api...

API=RateV4&XML=<RateV4Request USERID="CORRECTUSERNAMEHERE"> <Package ID="0"> <Service>ALL</Service> <ZipOrigination>95608</ZipOrigination> <ZipDestination>55082</ZipDestination><Pounds>2</Pounds> <Ounces>0</Ounces> <Container>VARIABLE</Container> <Size>REGULAR</Size> <Machinable>False</Machinable> <ReturnLocations>TRUE</ReturnLocations> </Package> </RateV4Request>

Response received

<Error> <Number>80040b1a</Number> <Description>Authorization failure. You are not authorized to connect to this server.</Description> <Source>UspsCom::DoAuth</Source> </Error>

I just upgraded to 5.1.2

havent tried the USPS module before the upgrade... it hasnt worked at all.

pretty frustrating... if I cant get the USPS module to work I'll have to use a different shopping cart software as this will be my main shipping method.

Link to comment
Share on other sites

Guest AlanGalbraith

o apparently you have to call USPS and get them to activate your account once you set it up... NOTHING in any documentation anywhere mentions this.... You know how I found out? by installing a different shopping cart system that mentioned it.

Telephone USPS 1-800-344-7779 and ask them to move your account to the Production Server or email them at [email protected], quoting your Web Tools User ID.

is what ZenCart tells you to do. I did that and now its still not working, but the error I'm getting has changed.

I refuse to believe that I'm the first person to go through this... someone, somewhere has to have known that this step is required... where is the documentation?

Anyway... now I am getting THIS error...

API=IntlRateV2&XML=<IntlRateV2Request USERID="CORRECTUSERNAMEHERE"> <Package ID="0"> <Pounds>3</Pounds> <Ounces>0</Ounces> <Machinable>false</Machinable> <MailType>Package</MailType> <ValueOfContents>50.00</ValueOfContents> <Country>United States</Country> <Container>VARIABLE</Container> <Size>REGULAR</Size> <Width>6</Width> <Length>6</Length> <Height>6</Height> <Girth/> </Package> </IntlRateV2Request>

Response received

<?xml version="1.0"?> <IntlRateV2Response><Package ID="0"><Error><Number>-2147218040</Number><Source>IntlPostage;clsIntlPostage.GetCountryAndRestirctedServiceId;clsIntlPostage.Ca

lcAllPostageDimensionsXML;IntlRateV2.ProcessRequest</Source><Description>The country name is a US Possession.</Description><HelpFile></HelpFile><HelpContext>1000440</HelpContext></Error></Package></IntlRateV2Response>

my account works with ZenCart, but still not with CubeCart... looks like cube cart thinks its an international request... its not... sigh....

Link to comment
Share on other sites

If we are to work on the theory that somehow your authorization to use the API has been cancelled, then please contact the USPS.

From USPS:

If you require technical support, contact the USPS Internet Customer Care Center (ICCC). This office operates from 7:00AM to 11:00PM EST.

E-mail: [email protected]

Telephone: 1-800-344-7779 (7:00AM to 11:00PM EST)

Warning: If the U.S. Postal Service discovers use of the same user ID from more than one web site, all users will be subject to immediate loss of access to the USPS server and termination of the licenses granted under the Terms and Conditions of Use.

Here is the Developer's Guide that lists the steps necessary to register and activate a USPS account:

https://www.usps.com/webtools/htm/Development-Guide-v3-1a.htm

Link to comment
Share on other sites

A test is made to determine if the Country of the delivery address is the same as the Country that your store is located in. The names have to match.

If the order's delivery address is "United States" and your store's address is "USA" (but should be "United States" from the drop-down selector), then International is assumed. Please check the country you specified in the Store Settings, General tab.

Link to comment
Share on other sites

Guest AlanGalbraith

Got it to work ONCE if ai said the package was being shipped to Austria. The API returned international shipping costs.... But if the shipping address is the US is doesnt work...

yes i do have the domestic options checked to "on" in the module.

arrrrrrggggghhhhhh!!!!!!

Link to comment
Share on other sites

How comfortable are you at editing a PHP script? If you feel you can do this, then:

In the file, modulesshippingUSPSshipping.class.php, on an empty line at about line 68, add this:

$fp = fopen('trace_log.txt', 'a+');

fwrite($fp, date("ymd H:i:s")." The country_d is: ".$delivery['country']." and the store_country is: ".$GLOBALS['config']->get('config','store_country')."rn");

fwrite($fp,"So the shipping api is: ".$this->_api."rn");

fclose($fp);

Make a sale that uses the USPS. When the USPS module is run, there should now be a file, trace_log.txt, in the base folder of your store. FTP that file to your workstation and see what was recorded.

Link to comment
Share on other sites

Guest AlanGalbraith

Sorry i didnt catch your post before I did a fresh install. I would have liked to known what the bug was...

I did fresh install and its working great now. Totally wierd. Same settings. I deleted the old database and started a fresh one. Installed all the files again....

Now it works great.

Link to comment
Share on other sites

Well, darn.

I understand the need to throw away the malfunctioning unit and see if a fresh unit works as the most expeditious course of action to take to get production going again.

That leaves the question of what was wrong still open.

Link to comment
Share on other sites

OK. We just had our first customer attempt at an order on our small site after v5.1.3 upgrade, and we're getting the exact same problem.

I added your code to shipping.class.php and this is the result of trace_log.txt:


120814 16:45:59 The country_d is: United States and the store_country is: 840

So the shipping api is: IntlRateV2

120814 16:45:59 The country_d is: United States and the store_country is: 840

So the shipping api is: IntlRateV2

Link to comment
Share on other sites

Please tell me this:

1. Did this customer have an account or was it a non-registering customer? If an account, how old is it? (Date registered)

2. Look in the database table CC_order_summary at the country and country_d columns. Do any of them have a non-number?

The variable $delivery['country'] should be a number. We need to find out where it is getting messed up.

Link to comment
Share on other sites

Registered customer created today. On order_summary - country 840 and country_d 840.

BUT

A test is made to determine if the Country of the delivery address is the same as the Country that your store is located in. The names have to match.

lang is en-GB on that order and it should be en-US.

I went in and played with an order using her info and as long as I delivered it to an international address it went through the Checkout, but if I used any US address, it failed as not having appropriate shipping available.

Our customer paid for her order via invoice from PP, so I tried to add a completely new order for her from the Admin side, and it wouldn't save. I ended up creating a new Customer with her information and renaming the one she made that had a flaw of some kind. Her original flawed Customer account was created BEFORE I made the jquery change.

I'll test some more tomorrow.

Link to comment
Share on other sites

  • 2 weeks later...

Hi guys.

I am new here. New to CubeCart, new to e-commerce. I am both the merchant and 'site developer'. I've been having a hell of a time getting my USPS module to work and show up during checkout testing. I'm going thru SiteGround hosting, and first tried with Prestashop e-commerce template, (same exact USPS shipping module failure issue), and now switched to CubeCart (I like the templates better anyway, so that was ok).

But still cannot make USPS module work at all.

1) I had no idea that my first install was CubeCart Lite. I have since purchased the full CubeCart Pro package, but have not received it or any confirmation emails, etc. containing license key and copyright key codes, etc. It's been half a day...seems odd. Is this normal? (I am in Las Vegas, US). Can I assume I can still solve this issue in Lite, at least until Pro magically appears? (Yes, Paypal payment email did arrive in seconds, so I know the money was sent).

2) I am in this specific thread because it is the exact issue I seem to be having all along. No one (SiteGround, Prestashop or CubeCart) explains, instructs or even hints to tell you that a USPS WebTool (or business) account is necessary, and only found out by reading this thread. Like I said newbie...but still. I registered at USPS (with the link above, thanks), and I have my USPS ID now. I have put it into the USPS Module settings. Have all my product details loaded, zones activated (is there no easier way to load multiple countries for International? -- was I even correct in doing this?) It didn't fix anything, but think USPS hasn't activated me yet from their and move me to the Production Server (by the above comments)?

3) So with that said, I have to get USPS to activate my account from their end to ensure my site orders and USPS communicate properly? This is probably the single most critical element of the site since I ship Internationally 75% of my product sales. If I screw this up, I'm done.

4) With these parameters set, once USPS activates me, can I now expect my USPS shipping to work as expected in the checkout process?

5) Or do I have to, as mentioned above, "delete" everything and start over? Do I assume dump "the whole site and rebuild it" is what is being referred to here? Or just clear out all of the shipping info only?

6) I am newbie...smart enough to get in trouble, but don't speak all of this new e-commerce language correctly yet. Please explain in detail if at all possible. I don't know code, but can certainly cut and past. I've been trying to get my site working for a month now and with little to no luck, or help. I just learned I had to "buy" tech support, but since my Pro package has not arrived, I still cannot even go that route, thus I'm here asking.

Simply finding this forum was a bit of victory, it's been that bad of an experience.

Thanks,

Mike

Link to comment
Share on other sites

Welcome RinaldiStudio! Glad to see you made it to the forums.

1. There are some non-deal-killer restrictions in CC-Lite. But everything you need to get started, sell, get paid, and ship your first inventory item can be done with Lite. I cannot speak to any delays in getting license codes.

2. If USPS still has you on their testing server, be sure to have the USPS module communicate with that. Maybe the reason why the option to ship USPS isn't getting listed in the checkout screens is because of this.

3. The USPS testing server should be all you need to make sure the module functions correctly.

4. We are still trying to find the cause of a situation where CC5 will state that there are no shipping options available due to weight or no zones enabled for the destination address. So far, we have determined that the USPS module is given bad data and this bad data causes the USPS module to choose International Rates for a domestic destination address. It doesn't happen all the time, and troubleshooting has led us to think that it depends on how the customer 'registers':

1. Creates an account first thing.

2. Creates an account during the checkout phase.

3. Chooses to not create an account during the checkout phase.

5. Don't do anything that drastic unless someone here specifically believes such is your last option.

6. We're here to help as best we can. As we proceed, you will come to know how to ask the right questions, find and report back with the info we ask for, and come to adopt the attitude that we all share and share alike.

Link to comment
Share on other sites

Hi guys -- ok, loaded USPS ID, they have confirm I am now on their production server. I was informed of this from them, but cannot find it anywhere to make this change:

per [email protected] email exchange:

Because you are using CubeCart, no testing is required. Your profile has been updated to allow you access to the Production Server. Additionally, I have granted access to the Address Information APIs to your WebTools account.

1. The Production Server URL is: http://production.shippingapis.com. For APIs calling the secure server, the URL ishttps://secure.shippingapis.com.

2. There is a line of code that refers to "shippingapitest.dll". You'll need to remove the word "test".

If you are using third party software and need assistance, please contact the vendor of the software. They should be able to assist you in obtaining live information using our APIs."

So, since the USPS shipping option is still not working (I can get chekcout to work using price or weight options, but it doens't cover my needs of all the countries I'll be shipping to...it's a lot).

What's next? I'm not sure what to do from here...ANY help appreciated!!

Again a newbie, but learning fast. Please be as specific as possible if it involved restting or dumping code, or whatever I may need to do from here. I can even dump the whole site are restart if need be (not that I want to mind you...). But I'm getting desperate from both a customer requests standpoints, my investors, my schedule, etc.

Thanks,

Mike

Link to comment
Share on other sites

SOLUTION! I opened a support ticket with CubeCart Support. Milos Homola, who worked my support ticket, uploaded to my site a new "module class file".

The ticket was taken care of in less than one day!

BAM! Everything works perfectly now!

Thanks to everyone for the awesome help!!!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...