Jump to content

USPS ending support for RateV3


shutack
 Share

Recommended Posts

From the USPS document (2014-rate-webtools-v3-v4-transition-guide.rtf)

 

1 RateV3 Retirement
 
We advise integrators currently using RateV3 to transition to RateV4 as soon as possible in preparation for the planned retirement of the API on September 28, 2014.
 
Corrections on how to update CC4 USPS module can be found here:
 
 
After working with Brian Smither yesterday, we discovered a couple things to add to this topic:
 
Also, go through both the calc.php and class.usps.php files and change all occurrences of:
IntlRate to IntlRateV2   (changed IntlRate2 to IntlRateV2)
RateV3 to RateV4
 
There are many types of International Shipping options. The admin/index.inc.php could be updated with these options (numbers are included for reference to the USPS document):
1 Priority Mail Express International
2 Priority Mail International
4 Global Express Guaranteed GXG
5 Global Express Guaranteed Document
6 Global Express Guaranteed Non-Document Rectangular
7 Global Express Guaranteed Non-Document Non-Rectangular
8 Priority Mail International Flat-Rate Envelope
9 Priority Mail International Medium Flat-Rate Box
10 Priority Mail Express International Flat-Rate Envelope
11 Priority Mail International Large Flat-Rate Box
12 USPS GXG Envelopes
13 First-Class Mail International Letter
14 First-Class Mail International Large Envelope
15 First-Class Package International Service
16 Priority Mail International Small Flat-Rate Box
17 Priority Mail Express International Legal Flat-Rate Envelope
18 Priority Mail International Gift Card Flat-Rate Envelope
19 Priority Mail International Window Flat-Rate Envelope
20 Priority Mail International Small Flat-Rate Envelope
21 First-Class Mail International Postcard
22 Priority Mail International Legal Flat-Rate Envelope
23 Priority Mail International Padded Flat-Rate Envelope
24 Priority Mail International DVD Flat-Rate Priced Box
25 Priority Mail International Large Video Flat-Rate Priced Box
26 Priority Mail Express International Flat-Rate Boxes
27 Priority Mail Express International Padded Flat-Rate Envelope
 
 
Link to comment
Share on other sites

One more piece of information to get the protocol working:

 

In the file class.usps.php, near line 427, find:
$this->request_xml .= '<Country>' . $attribs['country'] . '</Country>';

On a new line just after it, add:
$this->request_xml .= '<Container>' . $attribs['container'] . '</Container>'; // RECTANGULAR or NONRECTANGULAR - Required when Size is 'LARGE'
$this->request_xml .= '<Size>' . $attribs['size'] . '</Size>'; // REGULAR: all edges <= 12", LARGE: any edge > 12"
$this->request_xml .= '<Width>' . $attribs['width'] . '</Width>'; // Required when Size is 'LARGE'
$this->request_xml .= '<Length>' . $attribs['length'] . '</Length>'; // Required when Size is 'LARGE'
$this->request_xml .= '<Height>' . $attribs['height'] . </Height>'; // Required when Size is 'LARGE'
if($attribs['container']=="NONRECTANGULAR") {
$this->request_xml .= '<Girth>' . $attribs['girth'] . '</Girth>'; // Longest Width + Longest Length + Longest Height
} else {
$this->request_xml .= '<Girth></Girth>';
}

Link to comment
Share on other sites

As far as I can tell all I had to do for CC5.2.13 was to change the Rate3 to Rate4 everywhere it came up in the USPS shipping module files, and IntlRate to IntlRateV2 likewise. I also changed in the USPS language file the wording for 1 Priority Mail Express International and 15 First-Class Package International Service. Along with Bsmither's help getting rid of the Postcard choice, I can now mark my items as Machinable.

Link to comment
Share on other sites

  • 3 weeks later...

Post #2 has a syntax error (which is my fault). I will repeat post#2 with the correct code:

$this->request_xml .= '<Container>' . $attribs['container'] . '</Container>'; // RECTANGULAR or NONRECTANGULAR - Required when Size is 'LARGE'
$this->request_xml .= '<Size>' . $attribs['size'] . '</Size>'; // REGULAR: all edges <= 12", LARGE: any edge > 12"
$this->request_xml .= '<Width>' . $attribs['width'] . '</Width>'; // Required when Size is 'LARGE'
$this->request_xml .= '<Length>' . $attribs['length'] . '</Length>'; // Required when Size is 'LARGE'
$this->request_xml .= '<Height>' . $attribs['height'] . '</Height>'; // Required when Size is 'LARGE'
if($attribs['container']=="NONRECTANGULAR") {
  $this->request_xml .= '<Girth>' . $attribs['girth'] . '</Girth>'; // Longest Width + Longest Length + Longest Height
} else {
  $this->request_xml .= '<Girth></Girth>';
}
Link to comment
Share on other sites

I did notice that this section in 5.2.13 index.tpl of the USPS module is commented out. Enabling this section keeps the USPS shipping choices from working at all. Our shipping bags are "lumpy", so they are considered to be non-rectangular. The only way to get the module to work is to disable "Machinable".

 

 

<!--Not been able to get Rectangualr/Nonrectangular working... nightmare
                    <option value="RECTANGULAR" {$SELECT_container_RECTANGULAR}>Rectangular</option>
                    <option value="NONRECTANGULAR" {$SELECT_container_NONRECTANGULAR}>Nonrectangular</option>
                    -->

 

Could you suggest code to try with 5.2.13 to get the NONRECTANGULAR to work correctly?

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.

 Share

×
×
  • Create New...