-
Notifications
You must be signed in to change notification settings - Fork 54
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
[Bug]: getLowestRate() doesn't account for difference currencies #421
Comments
Hello, thank you for reaching out! We are triaging the issue currently. Do you perhaps have any logs you could share to help us reproduce the issue, specifically how you retrieved a combination of USD and non-USD rates? |
Hey, what I did to produce this was creating a shipment
|
Hey @Harrison-Burgess, thanks for providing additional details. This particular issue sounds like it could be better solved at the API level as this client library's function behaved correctly based on its intended use-case - it can only determine the lowest rate with good data. With that said, you can reach our support team at [email protected] and describe the perceived bug to them. They'll work with our internal teams if possible to correct this so the carrier (if possible) can return currencies in the requested type. I will note that per our documentation, the currency option does state that only carriers that allow conversion will respect the shipment option of defining an explicit currency, if I had to guess, I assume CanadaPost does not at present, though it's possible that could change if requested. ![]() As this issue happens at the API level, I'm going to close this issue since we do not intend to support currency conversion directly in our client libraries. |
Software Version
Language Version
Operating System
What happened?
getLowestRate() gives a bad result with different currencies, e.g. mixing CAD and USD sometimes chooses a numerically lower USD even if CAD quote is better.
I can't imagine any case where this is desirable behavior.
easypost-node/src/utils/util.js
Line 76 in 4f75889
What was expected?
Not sure, but the existence of getLowestRate() is a footgun.
Sample Code
No response
Relevant logs
No response
The text was updated successfully, but these errors were encountered: