From 11adffe40f9542a4325e3910c7f55750d9098196 Mon Sep 17 00:00:00 2001 From: egsk Date: Mon, 7 Jun 2021 20:46:11 +0300 Subject: [PATCH] Between: Fix for bid floor issue#1787 (#1870) Co-authored-by: Egor Skorokhodov --- adapters/between/between.go | 12 ------------ .../between/betweentest/exemplary/multi-request.json | 2 -- .../between/betweentest/exemplary/secure-detect.json | 1 - .../betweentest/exemplary/simple-site-banner.json | 10 ++-------- .../supplemental/bad-dsp-request-example.json | 1 - .../betweentest/supplemental/bad-response-body.json | 1 - .../dsp-server-internal-error-example.json | 1 - .../between/betweentest/supplemental/no-bids.json | 1 - adapters/between/params_test.go | 9 ++++----- openrtb_ext/imp_between.go | 6 ++---- static/bidder-params/between.json | 9 --------- 11 files changed, 8 insertions(+), 45 deletions(-) diff --git a/adapters/between/between.go b/adapters/between/between.go index 9d77a0413fd..f710855a4cd 100644 --- a/adapters/between/between.go +++ b/adapters/between/between.go @@ -20,10 +20,6 @@ type BetweenAdapter struct { EndpointTemplate template.Template } -// BetweenSSP requires bidfloor > 0. -// If BidFloor of openrtb_ext.ExtImpBetween is zero, set it to defaultBidFloor value, see addImpProps -const defaultBidfloor = 0.00001 - func (a *BetweenAdapter) MakeRequests(request *openrtb2.BidRequest, reqInfo *adapters.ExtraRequestInfo) ([]*adapters.RequestData, []error) { var errors []error if len(request.Imp) == 0 { @@ -129,14 +125,6 @@ func buildImpBanner(imp *openrtb2.Imp) error { // Add Between required properties to Imp object func addImpProps(imp *openrtb2.Imp, secure *int8, betweenExt *openrtb_ext.ExtImpBetween) { imp.Secure = secure - if betweenExt.BidFloor <= 0 { - imp.BidFloor = defaultBidfloor - } else { - imp.BidFloor = betweenExt.BidFloor - } - if betweenExt.BidFloorCur != "" { - imp.BidFloorCur = betweenExt.BidFloorCur - } } // Adding header fields to request header diff --git a/adapters/between/betweentest/exemplary/multi-request.json b/adapters/between/betweentest/exemplary/multi-request.json index 0a68f2046ca..345e99dd527 100644 --- a/adapters/between/betweentest/exemplary/multi-request.json +++ b/adapters/between/betweentest/exemplary/multi-request.json @@ -71,7 +71,6 @@ "publisher_id": "1" } }, - "bidfloor": 1e-05, "secure": 0 }, { @@ -92,7 +91,6 @@ "publisher_id": "1" } }, - "bidfloor": 1e-05, "secure": 0 } ], diff --git a/adapters/between/betweentest/exemplary/secure-detect.json b/adapters/between/betweentest/exemplary/secure-detect.json index ab636ecb567..9df77f0d3cc 100644 --- a/adapters/between/betweentest/exemplary/secure-detect.json +++ b/adapters/between/betweentest/exemplary/secure-detect.json @@ -46,7 +46,6 @@ "w": 728, "h": 90 }, - "bidfloor": 1e-05, "secure": 1, "ext": { "bidder": { diff --git a/adapters/between/betweentest/exemplary/simple-site-banner.json b/adapters/between/betweentest/exemplary/simple-site-banner.json index d11f203319d..bcb7b30eea0 100644 --- a/adapters/between/betweentest/exemplary/simple-site-banner.json +++ b/adapters/between/betweentest/exemplary/simple-site-banner.json @@ -21,9 +21,7 @@ "ext": { "bidder": { "host": "127.0.0.1", - "publisher_id": "1", - "bid_floor_cur": "RUB", - "bid_floor": 1000 + "publisher_id": "1" } } } @@ -48,15 +46,11 @@ "w": 728, "h": 90 }, - "bidfloor": 1000, - "bidfloorcur": "RUB", "secure": 0, "ext": { "bidder": { "host": "127.0.0.1", - "publisher_id": "1", - "bid_floor_cur": "RUB", - "bid_floor": 1000 + "publisher_id": "1" } } } diff --git a/adapters/between/betweentest/supplemental/bad-dsp-request-example.json b/adapters/between/betweentest/supplemental/bad-dsp-request-example.json index 4e9bbac2928..0e52313502f 100644 --- a/adapters/between/betweentest/supplemental/bad-dsp-request-example.json +++ b/adapters/between/betweentest/supplemental/bad-dsp-request-example.json @@ -46,7 +46,6 @@ "w": 728, "h": 90 }, - "bidfloor": 1e-05, "secure": 0, "ext": { "bidder": { diff --git a/adapters/between/betweentest/supplemental/bad-response-body.json b/adapters/between/betweentest/supplemental/bad-response-body.json index fbd08206bd8..a916136c54e 100644 --- a/adapters/between/betweentest/supplemental/bad-response-body.json +++ b/adapters/between/betweentest/supplemental/bad-response-body.json @@ -42,7 +42,6 @@ "w": 300, "h": 250 }, - "bidfloor": 1e-05, "secure": 0, "ext": { "bidder": { diff --git a/adapters/between/betweentest/supplemental/dsp-server-internal-error-example.json b/adapters/between/betweentest/supplemental/dsp-server-internal-error-example.json index 67e6979891f..f17644bd1a1 100644 --- a/adapters/between/betweentest/supplemental/dsp-server-internal-error-example.json +++ b/adapters/between/betweentest/supplemental/dsp-server-internal-error-example.json @@ -46,7 +46,6 @@ "w": 728, "h": 90 }, - "bidfloor": 1e-05, "secure": 0, "ext": { "bidder": { diff --git a/adapters/between/betweentest/supplemental/no-bids.json b/adapters/between/betweentest/supplemental/no-bids.json index d73c3e6207c..d82828a9f1a 100644 --- a/adapters/between/betweentest/supplemental/no-bids.json +++ b/adapters/between/betweentest/supplemental/no-bids.json @@ -46,7 +46,6 @@ "w": 728, "h": 90 }, - "bidfloor": 1e-05, "secure": 0, "ext": { "bidder": { diff --git a/adapters/between/params_test.go b/adapters/between/params_test.go index 857718690d3..f0594c87f1d 100644 --- a/adapters/between/params_test.go +++ b/adapters/between/params_test.go @@ -41,16 +41,15 @@ func TestInvalidParams(t *testing.T) { var validParams = []string{ `{"host":"lbs-eu1.ads", "publisher_id": "1"}`, - `{"host":"lbs-eu1.ads", "publisher_id": "1", "bid_floor": 5.5}`, - `{"host":"lbs-eu1.ads", "publisher_id": "1", "bid_floor": 1, "bid_floor_cur": "RUB"}`, + `{"host":"lbs-ru1.ads", "publisher_id": "2"}`, + `{"host":"lbs-us-east1.ads", "publisher_id": "3"}`, + `{"host":"lbs-asia1.ads", "publisher_id": "4"}`, } var invalidParams = []string{ `{"host":"badhost.ads", "publisher_id": "1"}`, `{"host":"lbs-eu1.ads", "publisher_id": 1}`, - `{"host":"lbs-eu1.ads", "publisher_id": "1"", "bid_floor": 5.5}`, - `{"host":"lbs-eu1.ads", "publisher_id": "1", "bid_floor": "5.5"}`, - `{"host":"lbs-eu1.ads", "publisher_id": "1", "bid_floor": 5.5, "bid_floor_cur": "cur"}`, + `{"host":"lbs-eu1.ads", "publisher_id": "1""}`, ``, `null`, `true`, diff --git a/openrtb_ext/imp_between.go b/openrtb_ext/imp_between.go index c868baeb9da..9fe912a8618 100644 --- a/openrtb_ext/imp_between.go +++ b/openrtb_ext/imp_between.go @@ -1,8 +1,6 @@ package openrtb_ext type ExtImpBetween struct { - Host string `json:"host"` - PublisherID string `json:"publisher_id"` - BidFloor float64 `json:"bid_floor"` - BidFloorCur string `json:"bid_floor_cur"` + Host string `json:"host"` + PublisherID string `json:"publisher_id"` } diff --git a/static/bidder-params/between.json b/static/bidder-params/between.json index 032d38fec4b..64863462697 100644 --- a/static/bidder-params/between.json +++ b/static/bidder-params/between.json @@ -12,15 +12,6 @@ "publisher_id": { "type": "string", "description": "Publisher ID from Between Exchange control panel" - }, - "bid_floor": { - "type": "number", - "description": "The minimum price acceptable for a bid" - }, - "bid_floor_cur": { - "type": "string", - "description": "Currency of bid floor", - "enum": ["USD", "EUR", "RUB"] } }, "required": ["host", "publisher_id"]