You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by si...@apache.org on 2007/12/08 01:36:03 UTC

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

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);



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

Posted by Bilgin Ibryam <bi...@iguanait.com>.
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
-- 
View this message in context: http://www.nabble.com/svn-commit%3A-r602282----ofbiz-trunk-applications-product-src-org-ofbiz-shipment-thirdparty-usps-UspsServices.java-tp14223805p14239546.html
Sent from the OFBiz - Commits mailing list archive at Nabble.com.