Skip to content

Commit

Permalink
Revert "Displayio: Make imp.bidfloor optional (prebid#3959)"
Browse files Browse the repository at this point in the history
This reverts commit 97bd74d.
  • Loading branch information
krdzo authored Oct 30, 2024
1 parent 1500c5c commit 76e2439
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 3 deletions.
15 changes: 12 additions & 3 deletions adapters/displayio/displayio.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,18 +37,27 @@ func (adapter *adapter) MakeRequests(request *openrtb2.BidRequest, requestInfo *
for _, impression := range request.Imp {
var requestExt map[string]interface{}

if impression.BidFloorCur == "" || impression.BidFloor == 0 {
if impression.BidFloor == 0 {
errs = append(errs, &errortypes.BadInput{
Message: "BidFloor should be defined",
})
continue
}

if impression.BidFloorCur == "" {
impression.BidFloorCur = "USD"
} else if impression.BidFloorCur != "USD" {
}

if impression.BidFloorCur != "USD" {
convertedValue, err := requestInfo.ConvertCurrency(impression.BidFloor, impression.BidFloorCur, "USD")

if err != nil {
errs = append(errs, err)
continue
}

impression.BidFloor = convertedValue
impression.BidFloorCur = "USD"
impression.BidFloor = convertedValue
}

if len(impression.Ext) == 0 {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"mockBidRequest": {
"id": "testid",
"imp": [
{
"id": "testimpid",
"banner": {
"format": [
{
"w": 300,
"h": 250
},
{
"w": 320,
"h": 50
}
]
},
"ext": {
"bidder": {
"placementId": "1101",
"inventoryId": "1101",
"publisherId": "101"
}
}
}
]
},
"expectedMakeRequestsErrors": [
{
"value": "BidFloor should be defined",
"comparison": "literal"
}
]
}

0 comments on commit 76e2439

Please sign in to comment.