You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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 const shipmentData = { to_address: toAddress, from_address: fromAddress, parcel: await easypost.Parcel.create({ weight: getLineItemWeight(productWithQty), }), options: { currency: "USD", }, mode, };
shipment = await easypost.Shipment.create(shipmentData);
Where the addresses were from 2 different countries
This requested rates where we preferred them in USD. Some of the carriers didn't seem to work for the currency option though and still gave us back rates in the local currency. const lowestRate = shipment.lowestRate([ "UPS", "CanadaPost", "FedExDefault", "USPSReturns", ]);
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: