diff --git a/modules/vidoomyBidAdapter.js b/modules/vidoomyBidAdapter.js index 64145b2c6b4..d268f7a9d64 100644 --- a/modules/vidoomyBidAdapter.js +++ b/modules/vidoomyBidAdapter.js @@ -42,6 +42,11 @@ const isBidRequestValid = bid => { return false; } + if (bid.params.bidfloor && (isNaN(bid.params.bidfloor) || bid.params.bidfloor < 0)) { + logError(BIDDER_CODE + ': bid.params.bidfloor should be a number equal or greater than zero'); + return false; + } + return true; }; @@ -77,6 +82,7 @@ const buildRequests = (validBidRequests, bidderRequest) => { const hostname = aElement.hostname const videoContext = deepAccess(bid, 'mediaTypes.video.context'); + const bidfloor = deepAccess(bid, `params.bidfloor`, 0); const queryParams = { id: bid.params.id, @@ -90,6 +96,8 @@ const buildRequests = (validBidRequests, bidderRequest) => { dt: /Mobi/.test(navigator.userAgent) ? 2 : 1, pid: bid.params.pid, requestId: bid.bidId, + schain: bid.schain || '', + bidfloor, d: getDomainWithoutSubdomain(hostname), // 'vidoomy.com', sp: encodeURIComponent(aElement.href), usp: bidderRequest.uspConsent || '', diff --git a/modules/vidoomyBidAdapter.md b/modules/vidoomyBidAdapter.md index 11e0ad40dbb..d91ace5a7b9 100644 --- a/modules/vidoomyBidAdapter.md +++ b/modules/vidoomyBidAdapter.md @@ -26,7 +26,8 @@ var adUnits = [ bidder: 'vidoomy', params: { id: '123123', - pid: '123123' + pid: '123123', + bidfloor: 0.5 // This is optional } } ] @@ -50,7 +51,8 @@ var adUnits = [ bidder: 'vidoomy', params: { id: '123123', - pid: '123123' + pid: '123123', + bidfloor: 0.5 // This is optional } } ] diff --git a/test/spec/modules/vidoomyBidAdapter_spec.js b/test/spec/modules/vidoomyBidAdapter_spec.js index 52f522bdcfc..8aa127faef2 100644 --- a/test/spec/modules/vidoomyBidAdapter_spec.js +++ b/test/spec/modules/vidoomyBidAdapter_spec.js @@ -16,7 +16,8 @@ describe('vidoomyBidAdapter', function() { 'bidder': 'vidoomy', 'params': { pid: '123123', - id: '123123' + id: '123123', + bidfloor: 0.5 }, 'adUnitCode': 'code', 'sizes': [[300, 250]] @@ -32,6 +33,11 @@ describe('vidoomyBidAdapter', function() { expect(spec.isBidRequestValid(bid)).to.equal(false); }); + it('should return false when bidfloor is invalid', function () { + bid.params.bidfloor = 'not a number'; + expect(spec.isBidRequestValid(bid)).to.equal(false); + }); + it('should return false when id is empty', function () { bid.params.id = ''; expect(spec.isBidRequestValid(bid)).to.equal(false);