Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

International USPS rate returns sometimes wrong because of incorrect rate return from USPS #39

Open
jjohndrow opened this issue Feb 8, 2016 · 1 comment

Comments

@jjohndrow
Copy link

I just encountered this new issue. It arises when you have several packages you are sending and USPS gives incomplete rate list. When this happens the shipping service just sums the totals and does not check to see if it got rates for each box. The example I have is that we split the order into 5 packages when giving a quote. The USPS Priority International rate was way cheaper then USPS Priority International Express. Digging into it I found that the call to the USPS specified 5 packages but only returned 2 for priority and all 5 for USPS Priority Express. This means that 3 whole packages were left out of the rate return. The issue occurs on line 136 of the USPSInternationalProvider.cs file.

var rates = document.Descendants("Service").GroupBy(item => (string) item.Element("SvcDescription")).Select(g => new {Name = g.Key, TotalCharges = g.Sum(x => Decimal.Parse((string) x.Element("Postage")))});

It assumes that you will get quotes for all or no boxes which is a pretty big issue if it only returns rates for two of them and causes the quote to be hundreds of dollars short. Looking into how to fix this one right now. Currently I'm under the gun to fix this as our management team wants to know why we underquoted a HK shipment by so much.

Attached is the Call and its return that we captured to debug the issue.

USPSRequest.txt

USPSResponse.txt

@kylewest
Copy link
Owner

kylewest commented Apr 6, 2016

@jjohndrow you mentioned you were working on a fix for this. were you able to find one? Is it something you'd be able to send as a pull request or point us to your changes and we'll try to merge it in on our own.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants