UPS ship gateway broken

For general questions and discussions specific to the AbleCommerce GOLD ASP.Net shopping cart software.
Post Reply
User avatar
AbleMods
Master Yoda
Master Yoda
Posts: 5169
Joined: Wed Sep 26, 2007 5:47 am
Location: Fort Myers, Florida USA

UPS ship gateway broken

Post by AbleMods » Mon Jul 13, 2020 7:48 am

As of 7-12-2020 5:06pm EST, all of my Able Gold installs have stopped calculating UPS shipping rates. Every Able Gold install I've checked can no longer calculate UPS rates.

The error reported in the error log is:
Exception: An item with the same key has already been added.Stack Trace: at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource) at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add) at CommerceBuilder.Shipping.Providers.UPS.UPS.ParseProviderRateReponse(XmlDocument providerResponse, Package[] packages) at CommerceBuilder.Shipping.Providers.UPS.UPS.GetAllProviderShipRateQuotes(Warehouse origin, Address destination, IList`1 contents) at CommerceBuilder.Shipping.Providers.UPS.UPS.GetShipRateQuote(Warehouse origin, Address destination, IList`1 contents, String serviceCode) at CommerceBuilder.Shipping.Providers.ShippingProviderBase.GetShipRateQuote(IShipment shipment, String serviceCode) at CommerceBuilder.Shipping.ShipMethod.GetShipRateQuote(IShipment shipment)
I've traced the problem to how the API response is parsed from UPS. Normally UPS only returns one entry for each serviceCode (ship method) in the response. Suddenly now they're turning the 3-Day Select ship method (serviceCode=12) twice.

The Able code is built assuming every service code is unique. And for a very long time that has worked fine. There's no way to know how long before UPS reviews and resolves this issue. In the mean time, the fix is fairly simple if you have full source code access to the Able UPS provider:

Open the UPS.cs class file in the UPS project of the full source code.

Locate the ParseProviderRateResponse() method.

Within that method, find the code listed below and replace it with the suggested replacement.

Recompile the CommerceBuilder.UPS.Dll file in Visual Studio and deploy the updated DLL file to your live website /bin/ folder.

Restart your IIS application pool.

Here's the code to look for...

Code: Select all

                        availableServices.Add(serviceQuote.ServiceCode, serviceQuote);    
Replace with this:

Code: Select all

                    if (!availableServices.ContainsKey(serviceQuote.ServiceCode))
                    {
                        availableServices.Add(serviceQuote.ServiceCode, serviceQuote);    
                    }
Joe Payne
AbleCommerce Custom Programming and Modules http://www.AbleMods.com/
AbleCommerce Hosting http://www.AbleModsHosting.com/
Precise Fishing and Hunting Time Tables http://www.Solunar.com

User avatar
Naveed
Rear Admiral (RADM)
Rear Admiral (RADM)
Posts: 611
Joined: Thu Apr 03, 2008 4:48 am

Re: UPS ship gateway broken

Post by Naveed » Mon Jul 13, 2020 8:26 am

Hi,

Thanks for reporting the issue.

jguengerich
Commodore (COMO)
Commodore (COMO)
Posts: 434
Joined: Tue May 07, 2013 1:59 pm

Re: UPS ship gateway broken

Post by jguengerich » Mon Jul 13, 2020 9:18 am

Thanks Joe! Not sure how long it would have taken me to figure that out.

I did a quick test (one fake order) after I applied your fix with logging turned on, and there was a slight difference in the two service code 12 responses. One (the second one) had a slightly higher TransportationCharges and a $4.00 ServiceOptionsCharges.
Jay

User avatar
AbleMods
Master Yoda
Master Yoda
Posts: 5169
Joined: Wed Sep 26, 2007 5:47 am
Location: Fort Myers, Florida USA

Re: UPS ship gateway broken

Post by AbleMods » Mon Jul 13, 2020 9:35 am

jguengerich wrote:
Mon Jul 13, 2020 9:18 am
Thanks Joe! Not sure how long it would have taken me to figure that out.

I did a quick test (one fake order) after I applied your fix with logging turned on, and there was a slight difference in the two service code 12 responses. One (the second one) had a slightly higher TransportationCharges and a $4.00 ServiceOptionsCharges.
No problem.

I saw the same thing with the rates. Seemed to make more sense keeping the first one since it always seemed to be lower than the duplicate. Clearly a UPS issue, unless maybe they're doing something new for only 3-Day Select like a built-in service fee of some sort?
Joe Payne
AbleCommerce Custom Programming and Modules http://www.AbleMods.com/
AbleCommerce Hosting http://www.AbleModsHosting.com/
Precise Fishing and Hunting Time Tables http://www.Solunar.com

rlopez
Lieutenant Commander (LCDR)
Lieutenant Commander (LCDR)
Posts: 93
Joined: Mon Mar 15, 2004 1:08 pm
Contact:

Re: UPS ship gateway broken

Post by rlopez » Mon Jul 13, 2020 10:46 am

Is there another way to access the UPS.cs file without having the source code?
Rick L.
https://www.boatingsolutions.com
We make boat repair easy!

User avatar
AbleMods
Master Yoda
Master Yoda
Posts: 5169
Joined: Wed Sep 26, 2007 5:47 am
Location: Fort Myers, Florida USA

Re: UPS ship gateway broken

Post by AbleMods » Mon Jul 13, 2020 11:41 am

I'm afraid not. Only AbleCommerce can provide a fix to the general public.
Joe Payne
AbleCommerce Custom Programming and Modules http://www.AbleMods.com/
AbleCommerce Hosting http://www.AbleModsHosting.com/
Precise Fishing and Hunting Time Tables http://www.Solunar.com

rlopez
Lieutenant Commander (LCDR)
Lieutenant Commander (LCDR)
Posts: 93
Joined: Mon Mar 15, 2004 1:08 pm
Contact:

Re: UPS ship gateway broken

Post by rlopez » Mon Jul 13, 2020 1:33 pm

That's a bummer. What is interesting when testing from the front end, it will give UPS rates in the state I reside but not in any other Contiguous sate in the USA when I try and use a different state and zip. Can Ablecommerce help with a temp fix? As a Note: This is also happening with Able9 if no one has complained yet.
Rick L.
https://www.boatingsolutions.com
We make boat repair easy!

jguengerich
Commodore (COMO)
Commodore (COMO)
Posts: 434
Joined: Tue May 07, 2013 1:59 pm

Re: UPS ship gateway broken

Post by jguengerich » Mon Jul 13, 2020 1:44 pm

I don't know that it matters, but when I look at UPS' Retail Rates guide, the only $4.00 add-on specific to 3 Day Select is Saturday Delivery. There is also a $4.00 UPS On-Call Pickup Area Surcharge (Residential) that applies to "certain ZIP codes".
Jay

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5082
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: UPS ship gateway broken

Post by mazhar » Mon Jul 13, 2020 1:54 pm

We are looking into it. We can surely get a temp fix for it that won't break the checkout but for a proper fix we need to understand the change that UPS made. We trying to contact them and get an explanation about duplicate rates returned.

AC 7.0.7 Patch
Download, extract and then Copy CommerceBuilder.UPS.dll into Website/bin folder. Please take backup of your existing file before replacing it with this one.

Gold R11-R12 Patch
Download, extract and then Copy CommerceBuilder.UPS.dll into Website/bin folder. Please take backup of your existing file before replacing it with this one.

Gold R9-R10 Patch
Download, extract and then Copy CommerceBuilder.UPS.dll into Website/bin folder. Please take backup of your existing file before replacing it with this one.

Gold R8 Patch
Download, extract and then Copy CommerceBuilder.UPS.dll into Website/bin folder. Please take backup of your existing file before replacing it with this one.

Gold R7 Patch
Download, extract and then Copy CommerceBuilder.UPS.dll into Website/bin folder. Please take backup of your existing file before replacing it with this one.

Gold R3-R6 Patch
Download, extract and then Copy CommerceBuilder.UPS.dll into Website/bin folder. Please take backup of your existing file before replacing it with this one.

AC9 Patch
Please download and put UPS.zip file into your Website/Plugins folder. Please take backup of existing UPS.zip file in Plugins folder before replacing it with this one. You will need to restart your website to make new updates effective.

rlopez
Lieutenant Commander (LCDR)
Lieutenant Commander (LCDR)
Posts: 93
Joined: Mon Mar 15, 2004 1:08 pm
Contact:

Re: UPS ship gateway broken

Post by rlopez » Mon Jul 13, 2020 2:10 pm

Mazhar, thank you!
Rick L.
https://www.boatingsolutions.com
We make boat repair easy!

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5082
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: UPS ship gateway broken

Post by mazhar » Mon Jul 13, 2020 3:11 pm

I just posted the temporary patches with Joe updates in my above post.

rlopez
Lieutenant Commander (LCDR)
Lieutenant Commander (LCDR)
Posts: 93
Joined: Mon Mar 15, 2004 1:08 pm
Contact:

Re: UPS ship gateway broken

Post by rlopez » Mon Jul 13, 2020 5:03 pm

I installed both patches for Gold12 and AC9. Both are now calculating UPS shipping again. As far as correct shipping cost, not going to worry as long as the customer can now checkout. We will wait for a complete fix down the road. Also, sorry for the AC9 info on this Forum.

Thanks again Mazhar for the quick fix.
Rick L.
https://www.boatingsolutions.com
We make boat repair easy!

User avatar
laramp
Lieutenant, Jr. Grade (LT JG)
Lieutenant, Jr. Grade (LT JG)
Posts: 36
Joined: Tue Jul 25, 2006 1:01 pm

Re: UPS ship gateway broken

Post by laramp » Mon Jul 13, 2020 6:13 pm

Thank You, it worked great!

User avatar
laramp
Lieutenant, Jr. Grade (LT JG)
Lieutenant, Jr. Grade (LT JG)
Posts: 36
Joined: Tue Jul 25, 2006 1:01 pm

Re: UPS ship gateway broken

Post by laramp » Mon Jul 13, 2020 6:24 pm

Will this patch work for
AbleCommerce for ASP.NET
VERSION: 7.0.7.14600
CommerceBuilder.UPS: 7.0.10041.0

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5082
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: UPS ship gateway broken

Post by mazhar » Tue Jul 14, 2020 5:34 am

I just updated the patch list with a patch for AC 7.0.7. Please give it a try and let me know if it works.

User avatar
laramp
Lieutenant, Jr. Grade (LT JG)
Lieutenant, Jr. Grade (LT JG)
Posts: 36
Joined: Tue Jul 25, 2006 1:01 pm

Re: UPS ship gateway broken

Post by laramp » Tue Jul 14, 2020 8:57 am

Thank You, I’ll give it a try!

User avatar
Shopping Cart Admin
AbleCommerce Admin
AbleCommerce Admin
Posts: 3054
Joined: Mon Dec 01, 2003 8:41 pm
Location: Vancouver, WA
Contact:

Re: UPS ship gateway broken

Post by Shopping Cart Admin » Tue Jul 14, 2020 11:28 pm

Hello All,

We've received confirmation that UPS has corrected the issue!
Thank you for the information. We were notified there was an issue with the Rate and Ship API option and that was causing the double rates. The issue has been fixed. Please try again and let me know if you are still having the same issue.
Thanks for your support

Shopping Cart Guru
AbleCommerce.com
Follow us on Facebook

Post Reply