-
Notifications
You must be signed in to change notification settings - Fork 750
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
PgamSSP: Add currency converter #3907
Conversation
Code coverage summaryNote:
pgamsspRefer here for heat map coverage report
|
// Check if imp comes with bid floor amount defined in a foreign currency | ||
if imp.BidFloor > 0 && imp.BidFloorCur != "" && strings.ToUpper(imp.BidFloorCur) != "USD" { | ||
// Convert to US dollars | ||
convertedValue, err := reqInfo.ConvertCurrency(imp.BidFloor, imp.BidFloorCur, "USD") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you encounter an error when attempting to convert, how do you want to proceed? You're currently sending the bid request with a potentially invalid floor. Are you ok with that? Do you want to halt processing and return that error? Another option is to just halt processing on that imp, append the error and continue processing the next imp.
You might also want to add a supplemental invalid imp bid floor currency JSON test to verify the behavior.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that's right, we're fine with that. If for some reason the conversion fails, the request should be sent with the current floor
No description provided.