Jump to content

usps shipping error after upgrading to V4


doublet

Recommended Posts

Hi A client of mine contacted me this morning about her USPS shipping module. I see it needed to be upgraded from RateV3 to RateV4.

I followed all the directions here :

   '?do=embed' frameborder='0' data-embedContent>>

and here:

   http://www.cubecartforums.org/lofiversion/index.php?t18105.html

 

I am getting this error now --> USPS Error: The element 'Package' has invalid child element 'Size'. List of possible elements expected: 'Container'.

 

 If someone could please point me in the correct direction to fix this please?

thank you so much for your time.

Link to comment
Share on other sites

Priority is set as it always was: enabled>>regular>>variable rate

   I have not set the size dimensions, no.

Debug is enabled.  I have a test account and as soon as I put something in my cart and then login I get this: USPS Error: The element 'Package' has invalid child element 'Size'. List of possible elements expected: 'Container'.

If I visit fresh and login first and try to purchase it is the same. I disabled the module and then enabled it again and still the same issue.

This is the only message given and the only thing on a complete white page.

 

This was the original error shown when she contacted me:

   USPS Error: API Disabled: RateV3. The RateV3 API is no longer available. Please follow the "RateV3 to RateV4" transition guide in the announcements section at www.usps.com/webtools to migrate to the latest version or contact your software provider or shipping administrator for assistance.

 

I must have done something wrong when I edited the calc and class.usps files?? help!

  edited to add photo and say THANK YOU so much for responding!

 

Edited by doublet
Link to comment
Share on other sites

Someone will need to look at the files. I will send you a PM with my email address - to which you can attach the files.

Hi, I am running cc3 and having the same problem after following the same instructions except my error is a little different (pasted below). Surely you must have found a solution and I am desperately needing help and was hoping you can help me.

Request XML:

<IntlRateRequest USERID="PurposefullyRemoved" PASSWORD="PurposefullyRemoved"></IntlRateRequest>

Return XML:

<?xml version="1.0" encoding="UTF-8"?>

<Error><Number>-2147221202</Number><Source>Common:XmlParse</Source><Description>The element 'IntlRateRequest' has incomplete content. List of possible elements expected: 'RateClientType, Package'.</Description><HelpFile/><HelpContext/></Error>

Please help!

Link to comment
Share on other sites

This:

Request XML:

<IntlRateRequest

tells me you may have missed or corrupted a statement where IntlRate needed to be changed to IntlRateV2.

Hi, thank you for your response!! I need to get this fixed ASAP!!

Unfortunately, I am getting the same error even when I change all instances to add "v2" like you said. The only difference is the error then says "intlratev2request" instead of "intlrate". I tried putting it back the way it was originally, updating it to intlrate2, intlratev2, still the same error.

It seems like it is expecting something where it says rate package type, etc. I have no idea how to fix it. Any other ideas?

Link to comment
Share on other sites

I'm updating this for people searching for help with this problem.

 

Since Cube Cart No longer supports ANY versions of Cube Cart lower than 5 , finding someone to edit the code and patch it is your only option.

 

No one from here can fix this. What I had to do (for the time being until I can make my client understand that the script needs to be updated to the latest version) is I completely disabled USPS module and enabled the UPS module.

 

I always recommend updating to the latest version BUT because they have to pay for it...it is ultimately up to my clients to upgrade and they usually choose not to.

  Because most are of the "if it works don't mess with it" mentality ... I NO longer recommend or set up Cube Cart at all because there are so many script updates. I have several clients with stores, 1 of them still running version 3.4.3 with no problems for many years until now with the USPS module. I had the most trouble all across the board for years with the version 4 stores, even the one kept updated and now they too are dysfuntional in regards to the USPS module. I have had little to no problems with the version 5 store although running 5.2.13 she needs upgrading now too, All these stores are being run with full license paid... honestly the amount of script updates is a BIG pita.

 

IF my clent decides to go with the patching I'll let you know how that goes and who did it, I've used this guy for many years and he is the best and most reliable when it comes to actually fixing what is wrong.

 

Link to comment
Share on other sites

Also, I should probably clarify something I realized since responding initially.  My problem seems to be related to IntlRateV2 only, not RateV4.  Domestic users can check out with USPS with V4 now just fine, it's when the customer is international that they receive this error.  Since many of our customers are international we will need to find a temporary work around such as using the UPS module.  It appears there is additional iformation that IntlRateV2 needs in order to provide the quote. 

Link to comment
Share on other sites

There needs to be this in the coding: "United Kingdom" is not recognized and the code needs to replace that with Great Britain. CubeCart has this code going back to early versions of CubeCart 3, so no worries there.

 

However, there has been a recent change that affects all applications that communicates with USPS:

Great Britain is no longer recognized and the code must use Great Britain and Northern Ireland

 

In CC3, calc.php, the code at line 54 needs updating. In class.usps.php, line 11 needs updating (don't mistakenly delete the comma at the end). I don't have line numbers handy for CC4 and CC5.

Link to comment
Share on other sites

Since Cube Cart No longer supports ANY versions of Cube Cart lower than 5 , finding someone to edit the code and patch it is your only option.

To put this into a little perspective !

CubeCart V3 was release in June 2005 and V4 was released in Sept 2007. The last V3 release (3.0.20) was in August 2009 with support for V3 only ending in June 2011 when V5 was released and support for V4 still being continued until the end of December 2012

Compare this situation to OpenCart that has just released 2.0 as a new branch from the current 1.5.6 V2.0 is far from stable yet and almost all plugins / mods from 1.5.6 are not compatible with 2.0 and have to be re-coded. Yet, support for 1.5.6 will cease in less than six months.

No one from here can fix this. What I had to do (for the time being until I can make my client understand that the script needs to be updated to the latest version) is I completely disabled USPS module and enabled the UPS module.

While this forum is meant to be for community support for the latest version, there are people both here and on the commercial forum that could fix it but may want compensating for their time, especially as you obviously benefit from the business of your clients.

I always recommend updating to the latest version BUT because they have to pay for it...it is ultimately up to my clients to upgrade and they usually choose not to.

There are plenty of people running very successful stores on V3 and several multi million pound turnover businesses (that I know about and I am sure there are more) running V4 that might never upgrade. BUT, these people generally realise that they need to spend a little time and/or money putting something into the software that provides the foundation of their business. V4 is very old and V3 is antique by software standards. Another thought - if they were running a bricks and mortar store and hadnt changed anything or done any maintenance in ten years, what state do you think they would be in.

Ian

Link to comment
Share on other sites

"V4 is very old and V3 is antique by software standards."

 

And stills runs perfectly well. Mostly. (Need to watch out for PHP -- ereg() and mysql() function family, for example.)

 

"If they were running a bricks and mortar store and hadn't changed anything or done any maintenance in ten years, what state do you think they would be in?"

 

Depends entirely on how well it was built and laid out to begin with.

 

But we digress.

Link to comment
Share on other sites

 

Since Cube Cart No longer supports ANY versions of Cube Cart lower than 5 , finding someone to edit the code and patch it is your only option.

To put this into a little perspective !

CubeCart V3 was release in June 2005 and V4 was released in Sept 2007. The last V3 release (3.0.20) was in August 2009 with support for V3 only ending in June 2011 when V5 was released and support for V4 still being continued until the end of December 2012

Compare this situation to OpenCart that has just released 2.0 as a new branch from the current 1.5.6 V2.0 is far from stable yet and almost all plugins / mods from 1.5.6 are not compatible with 2.0 and have to be re-coded. Yet, support for 1.5.6 will cease in less than six months.

No one from here can fix this. What I had to do (for the time being until I can make my client understand that the script needs to be updated to the latest version) is I completely disabled USPS module and enabled the UPS module.

While this forum is meant to be for community support for the latest version, there are people both here and on the commercial forum that could fix it but may want compensating for their time, especially as you obviously benefit from the business of your clients.

I always recommend updating to the latest version BUT because they have to pay for it...it is ultimately up to my clients to upgrade and they usually choose not to.

There are plenty of people running very successful stores on V3 and several multi million pound turnover businesses (that I know about and I am sure there are more) running V4 that might never upgrade. BUT, these people generally realise that they need to spend a little time and/or money putting something into the software that provides the foundation of their business. V4 is very old and V3 is antique by software standards. Another thought - if they were running a bricks and mortar store and hadnt changed anything or done any maintenance in ten years, what state do you think they would be in.

Ian

 

 

Doublet was simply providing an update on his situation in response to my asking since I am experiencing the same problem.  This is because there are many out there in the same boat and many who don't even know it yet, so keeping all the information together will most likely help somebody and save everyone time.  So while I appreciate your perspective on what Doublet has said, I would really like to stay focused on the actual error, whether it can be solved or not, and how.  We are all aware on what the various outcomes might be and that sometimes people expect to be compensated for their work.

Link to comment
Share on other sites

Please enable the debug mode for the USPS module. In this mode, the module will "die" with the first thing it has been programmed not to like with the message of what it didn't like.

 

Since the last test that I have knowledge of that you performed, the module's error response indicated it was still using "IntlRate".

 

Please enable debug mode and make another test.

 

(I also also emailed you a correction to an edit you made.)

Link to comment
Share on other sites

Please enable the debug mode for the USPS module. In this mode, the module will "die" with the first thing it has been programmed not to like with the message of what it didn't like.

 

Since the last test that I have knowledge of that you performed, the module's error response indicated it was still using "IntlRate".

 

Please enable debug mode and make another test.

 

(I also also emailed you a correction to an edit you made.)

 

Hi Brian,

 

I just got home.  I made the corrections to the file that you noticed and reuploaded.  I checked the module to ensure debugging mode is on (and it still is) and recreated the error.  It is now:

 

Request XML:

<IntlRateV2Request USERID="XXXXX" PASSWORD="XXXXX"><Package ID="0"><Pounds>2</Pounds><Ounces>0</Ounces><MailType>Package</MailType><ValueOfContents>150</ValueOfContents><Country>Great Britain</Country></Package></IntlRateV2Request>

Return XML:

<?xml version="1.0" encoding="UTF-8"?>

<Error><Number>-2147221202</Number><Source>Common:XmlParse</Source><Description>The element 'Package' has incomplete content. List of possible elements expected: 'Container'.</Description><HelpFile/><HelpContext/></Error>

 

Thanks for your time, effort, and patience!!

Link to comment
Share on other sites

Ok, a step in the right direction. You still need to make the edits I mentioned earlier about changing "Great Britain" to "Great Britain and Northern Ireland".

 

Now it is mentioning Container is missing. Did you re-try to make the edits discussed in the other post?

 

And also:

http://www.cubecartforums.org/lofiversion/index.php?t18105.html

 

 

IMPORTANT: Please read:

Link to comment
Share on other sites

Ok, a step in the right direction. You still need to make the edits I mentioned earlier about changing "Great Britain" to "Great Britain and Northern Ireland".

 

Now it is mentioning Container is missing. Did you re-try to make the edits discussed in the other post?

 

And also:

http://www.cubecartforums.org/lofiversion/index.php?t18105.html

 

 

IMPORTANT: Please read:

?do=embed#entry203560'' frameborder='0' data-embedContent>>?do=embed#entry203560' frameborder='0' data-embedContent>

 

Yes, everything is working great.  I tested for domestic and several different countries.  I have disabled the UPS module and went back to USPS as everything is working great!

 

If any Cube Cart 3 users out there are having problems with the new USPS RateV4 and IntlRateV2 API integration, you can get your store working again following the steps in this post: '?do=embed' frameborder='0' data-embedContent>>

 

Be sure to follow through the entire post to see any corrections to the coding. 

 

Brian, thank you so much.  I am so impressed with your knowledge and ability.  If not for you I would be in a huge mess.

Link to comment
Share on other sites

well Ian from havenswift  it looks as though I hit a sore spot with you.

Thank you for the time it took you to look up all the version dates, others who come here for help may find that usefull.   

....as for those other 2 little remarks that you made...

 

I've spent many years on the CubeCart forums reading and learning from others as well as email help from Alistair to learn how to fix little problems myself while NEVER CHARGING MY CLIENTS A RED CENT to do so.

I have ALWAYS PAID anyone who was nice enough to help me. The only time I charge my clients for work on their scripts is for the time it takes me to upgrade or perhaps in reimbursement for any amount I may have had to pay support to do the upgrade OR for the fee my CubeCart expert charges me to work on something that I cannot fix.

 

Of course I am not benefiting in any way by being a partner or a troll to offer help for payment only here, so what do I know?

Link to comment
Share on other sites

The "I never charge" comments comes up a lot on the forums over the year and it's truly very nice of you... (if you can afford to). :)

 

For a lot us us this is our bread and butter and have no choice but to charge. 

 

I agree with your comment on "if its not broke don't fix it" but at some point something's gotta give... you can't buy cassette tapes anymore so that old tape player is no good. The same applies when your hosting company upgrade the server software around your store stopping it working.

 

I hope you don't think I'm being rude or a know it all. I just wanted to give a little food for thought. I think its great that so many merchants have got so much out of v3 and continue to do so. Of course there is no obligation to upgrade.. but thanks to those that have the lights are still on at CubeCart HQ and for example our forums are still having their web hosting costs paid for. 

Link to comment
Share on other sites

No I don't think you are rude at all. I have depended on you too many times over the years and appreciated every time you did help me, paid or free.  This "if its not broke don't fix it "  mentality is not my outlook at all, it is my clients who feel this way. I push them to upgrade but I can't make them. 

     Because of that, the last two CC licenses I purchased from you were for remote hosted clients. I told them upfront buy your own hosting then I'll buy the script, design it, set it up for you, but it's your responsibility to pay attention to your admin panel and contact support for update versions.... and to deal with your host when you have server problems. Then I give them all the contact and login information for your support center and to contact milos for non support based help.  I have enough to do with my own hosting clients plus running a huge high traffic forum and another server with automated sales boards.

 

The last two CC stores that I set up..I don't stress about because they are Not on my server thank goodness, not my regular clients BUT I do still help those people, the latest being helping with what to do about the php upgrade and now the usps upgrade. This ticket was started for one of those remote clients. Her store was set up in 2010 and in that time I did one upgrade for her in 2011, I did charge her $35. once in 2012 for many hours of work on her store and her PayPal account. She emails me when she has a problem, I help her with what to do and who to pay. If I can get support with a support credit or read here and fix it for her quickly no I don't charge her. When I can't fix by reading and have to pay someone else then I do charge her but it's a reimbursement fee.

 

I am still working on getting 2 stores to upgrade to version 5, (the store I started this topic for is one of them and her main reason for not upgrading is the price to update her skin) and for one version 5 store to upgrade to its latest version.  One of the stores, the oldest one, IS on my server so that one I do stress over. Sooner than later this store will not work at all... wouldn't now if I couldn't have went back to the last php version.

 

I tell them all it's much cheaper in the long run to keep everything patched and upgraded and if you do so then you have premium support and way less down time. preaching to the choir though I think.

Link to comment
Share on other sites

  • 2 weeks later...

If anyone is still receiving this error after replacing all the occurrences mentioned,

 

USPS Error: The element 'Package' has invalid child element 'Size'. List of possible elements expected: 'Container'.

 

Around line 355 in class.usps.php, there is a conditional statement regarding the container type, just comment out the if statement and the closing brackets:

//if(strtoupper($attribs['container'])!=="VARIABLE") {
    $this->request_xml .= '<Container>' . strtoupper($attribs['container']) . '</Container>';
//}
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...