svn commit: r602282 - /ofbiz/trunk/applications/product/src/org/ofbiz/shipment/thirdparty/usps/UspsServices.java

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r602282 - /ofbiz/trunk/applications/product/src/org/ofbiz/shipment/thirdparty/usps/UspsServices.java

sichen
Author: sichen
Date: Fri Dec  7 16:36:02 2007
New Revision: 602282

URL: http://svn.apache.org/viewvc?rev=602282&view=rev
Log:
Finally fixed the usps rate estimate: only parcel post can have a Container tag.  This is on the USPS web api documentation

Modified:
    ofbiz/trunk/applications/product/src/org/ofbiz/shipment/thirdparty/usps/UspsServices.java

Modified: ofbiz/trunk/applications/product/src/org/ofbiz/shipment/thirdparty/usps/UspsServices.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/shipment/thirdparty/usps/UspsServices.java?rev=602282&r1=602281&r2=602282&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/src/org/ofbiz/shipment/thirdparty/usps/UspsServices.java (original)
+++ ofbiz/trunk/applications/product/src/org/ofbiz/shipment/thirdparty/usps/UspsServices.java Fri Dec  7 16:36:02 2007
@@ -171,13 +171,17 @@
             UtilXml.addChildElementValue(packageElement, "Pounds", df.format(weightPounds), requestDocument);
             UtilXml.addChildElementValue(packageElement, "Ounces", df.format(weightOunces), requestDocument);
 
-            // TODO: handle other container types, package sizes, and machinabile packages
-            UtilXml.addChildElementValue(packageElement, "Container", "None", requestDocument);
+            // TODO: handle other container types, package sizes, and machinable packages
+            // IMPORTANT: Express or Priority Mail will fail if you supply a Container tag: you will get a message like
+            // Invalid container type. Valid container types for Priority Mail are Flat Rate Envelope and Flat Rate Box.
+            if ("Parcel".equalsIgnoreCase(serviceCode)) {
+                UtilXml.addChildElementValue(packageElement, "Container", "None", requestDocument);
+            }
             UtilXml.addChildElementValue(packageElement, "Size", "Regular", requestDocument);
             UtilXml.addChildElementValue(packageElement, "Machinable", "False", requestDocument);
         }
 
-        // send the request
+        // send the request                                                                รท
         Document responseDocument = null;
         try {
             responseDocument = sendUspsRequest("RateV2", requestDocument);


Reply | Threaded
Open this post in threaded view
|

Re: svn commit: r602282 - /ofbiz/trunk/applications/product/src/org/ofbiz/shipment/thirdparty/usps/UspsServices.java

Bilgin Ibryam
Hi Si,

it looks like there is an extra character in this commit.
I'm getting a warning druing ofbiz compile: unmappable character for encoding UTF8
 applications/product/src/org/ofbiz/shipment/thirdparty/usps/UspsServices.java:184:

Bilgin