Skip to content

Commit

Permalink
Fix currency conversion bug. (#3867)
Browse files Browse the repository at this point in the history
Co-authored-by: ddubyk <[email protected]>
  • Loading branch information
CTMBNara and ddubyk authored Aug 21, 2024
1 parent d161712 commit a556e2d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
6 changes: 4 additions & 2 deletions adapters/rubicon/rubicon.go
Original file line number Diff line number Diff line change
Expand Up @@ -317,9 +317,11 @@ func (a *RubiconAdapter) MakeRequests(request *openrtb2.BidRequest, reqInfo *ada
continue
}

if resolvedBidFloor > 0 {
imp.BidFloorCur = "USD"
if resolvedBidFloor >= 0 {
imp.BidFloor = resolvedBidFloor
if imp.BidFloorCur != "" {
imp.BidFloorCur = "USD"
}
}

if request.User != nil {
Expand Down
8 changes: 8 additions & 0 deletions adapters/rubicon/rubicon_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,14 @@ func TestOpenRTBRequestWithDifferentBidFloorAttributes(t *testing.T) {
expectedBidCur: "",
expectedErrors: nil,
},
{
bidFloor: 0,
bidFloorCur: "EUR",
setMock: func(m *mock.Mock) {},
expectedBidFloor: 0,
expectedBidCur: "USD",
expectedErrors: nil,
},
{
bidFloor: -1,
bidFloorCur: "CZK",
Expand Down

0 comments on commit a556e2d

Please sign in to comment.