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

PgamSSP: Add currency converter #3907

Merged
merged 15 commits into from
Nov 4, 2024
Merged

PgamSSP: Add currency converter #3907

merged 15 commits into from
Nov 4, 2024

Conversation

PGAMSSP
Copy link
Contributor

@PGAMSSP PGAMSSP commented Sep 9, 2024

No description provided.

Copy link

github-actions bot commented Sep 9, 2024

Code coverage summary

Note:

  • Prebid team doesn't anticipate tests covering code paths that might result in marshal and unmarshal errors
  • Coverage summary encompasses all commits leading up to the latest one, 37da854

pgamssp

Refer here for heat map coverage report

github.com/prebid/prebid-server/v2/adapters/pgamssp/pgamssp.go:29:	Builder		100.0%
github.com/prebid/prebid-server/v2/adapters/pgamssp/pgamssp.go:36:	MakeRequests	87.9%
github.com/prebid/prebid-server/v2/adapters/pgamssp/pgamssp.go:94:	makeRequest	85.7%
github.com/prebid/prebid-server/v2/adapters/pgamssp/pgamssp.go:112:	MakeBids	100.0%
github.com/prebid/prebid-server/v2/adapters/pgamssp/pgamssp.go:145:	getBidMediaType	83.3%
total:									(statements)	90.8%

@bsardo bsardo changed the title PgamSSP: add currency converter PgamSSP: Add currency converter Oct 15, 2024
// 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")
Copy link
Collaborator

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.

Copy link
Contributor Author

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

@przemkaczmarek przemkaczmarek self-requested a review October 17, 2024 14:01
@PGAMSSP PGAMSSP requested a review from bsardo October 23, 2024 15:36
@bsardo bsardo merged commit 3403544 into prebid:master Nov 4, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants