Problems with USPS Integrated Carrier Module

For general questions and discussions specific to the AbleCommerce 7.0 Asp.Net product.
Post Reply
User avatar
nborelli
Lieutenant, Jr. Grade (LT JG)
Lieutenant, Jr. Grade (LT JG)
Posts: 25
Joined: Sat Nov 17, 2007 2:03 pm
Location: Soquel, CA
Contact:

Problems with USPS Integrated Carrier Module

Post by nborelli » Tue May 20, 2008 4:23 pm

It seems that USPS changed their API as of May 14, 2008. The changes seem to effect Priority International Flat-Rate options. Is their a patch available for build 9381 to handle this API change? If not, is the source code for the CommerceBuilder.USPS.dll assembly available? I will also do some additional research and see if I can get more specifics about what exactly changed.

Thanks,
Neal
Neal Borelli
Nubius Organics (part time for my wife)
http://www.nubiusorganics.com

User avatar
nborelli
Lieutenant, Jr. Grade (LT JG)
Lieutenant, Jr. Grade (LT JG)
Posts: 25
Joined: Sat Nov 17, 2007 2:03 pm
Location: Soquel, CA
Contact:

Re: Problems with USPS Integrated Carrier Module

Post by nborelli » Tue May 20, 2008 4:42 pm

I see that since the assembly is not obfuscated, I can disassemble the code ands read it. I do notice that the the code contains a large number of hard coded values. It might be nice to break some of this into a separate configuration file so that the names of services and other options can be easily changed. For example, the static constructor of the USPS class reads as follows:

Code: Select all

static USPS()
{
      _services.Add("Express Mail", "USPS Express Mail");
      _services.Add("Express Mail Flat-Rate Envelope", "USPS Express Mail Flat Rate Envelope (12.5\" x 9.5\")");
      _services.Add("Priority Mail", "USPS Priority Mail");
      _services.Add("Priority Mail Flat-Rate Envelope", "USPS Priority Mail Flat Rate Envelope (12.5\" x 9.5\")");
      _services.Add("Priority Mail Flat-Rate Box", "USPS Priority Mail Flat Rate Box");
      _services.Add("First-Class Mail", "USPS First-Class Mail");
      _services.Add("Parcel Post", "USPS Parcel Post");
      _services.Add("Bound Printed Matter", "USPS Bound Printed Matter");
      _services.Add("Library Mail", "USPS Library Mail");
      _services.Add("Media Mail", "USPS Media Mail");
      _services.Add("Global Express Guaranteed", "USPS Global Express Guaranteed");
      _services.Add("Global Express Guaranteed Non-Document Rectangular", "USPS Global Express Guaranteed Non-Document Rectangular");
      _services.Add("Global Express Guaranteed Non-Document Non-Rectangular", "USPS Global Express Guaranteed Non-Document Non-Rectangular");
      _services.Add("Express Mail International (EMS)", "USPS Express Mail International (EMS)");
      _services.Add("Express Mail International (EMS) Flat Rate Envelope", "USPS Express Mail International (EMS) Flat Rate Envelope");
      _services.Add("Priority Mail International", "USPS Priority Mail International");
      _services.Add("Priority Mail International Flat Rate Envelope", "USPS Priority Mail International Flat Rate Envelope");
      _services.Add("Priority Mail International Flat Rate Box", "USPS Priority Mail International Flat Rate Box");
      _services.Add("First-Class Mail International", "USPS First-Class Mail International");
}
Couldn't this be driven by an XML config file? Also things like the default URLs, etc. are also hard-coded. Finally, methods like BuildProviderRequest and BuildProviderRequestIntl are very hard-coded. It might be possible to make this more data driven and configurable.

Of course, if we had the source, we could make our own changes.

Just my two cents,
Neal
Neal Borelli
Nubius Organics (part time for my wife)
http://www.nubiusorganics.com

User avatar
jmestep
AbleCommerce Angel
Posts: 8164
Joined: Sun Feb 29, 2004 8:04 pm
Location: Dayton, OH
Contact:

Re: Problems with USPS Integrated Carrier Module

Post by jmestep » Tue May 20, 2008 6:26 pm

The xml would be a great idea. grzyweasel had made a custom shipping wrapper to use with Able 5.5 and he used an xml file for settings and it was great- we could change it when we needed to.
Judy Estep
Web Developer
jestep@web2market.com
http://www.web2market.com
708-653-3100 x209
New search report plugin for business intelligence:
http://www.web2market.com/Search-Report ... -P154.aspx

Post Reply