diff --git a/modules/betweenBidAdapter.js b/modules/betweenBidAdapter.js index 5ad78a6bdc6..521c6cb6f98 100644 --- a/modules/betweenBidAdapter.js +++ b/modules/betweenBidAdapter.js @@ -1,5 +1,5 @@ import {registerBidder} from '../src/adapters/bidderFactory.js'; - +import { getAdUnitSizes, parseSizesInput } from '../src/utils.js'; const BIDDER_CODE = 'between'; export const spec = { @@ -13,7 +13,7 @@ export const spec = { * @return boolean True if this is a valid bid, and false otherwise. */ isBidRequestValid: function(bid) { - return !!(bid.params.w && bid.params.h && bid.params.s); + return Boolean(bid.params.s); }, /** * Make a server request from the list of BidRequests. @@ -27,13 +27,12 @@ export const spec = { validBidRequests.forEach(i => { let params = { + sizes: parseSizesInput(getAdUnitSizes(i)), jst: 'hb', ord: Math.random() * 10000000000000000, tz: getTz(), fl: getFl(), rr: getRr(), - w: i.params.w, - h: i.params.h, s: i.params.s, bidid: i.bidId, transactionid: i.transactionId, diff --git a/modules/betweenBidAdapter.md b/modules/betweenBidAdapter.md index 426d0aa2ed7..4aadd31d3a3 100644 --- a/modules/betweenBidAdapter.md +++ b/modules/betweenBidAdapter.md @@ -15,14 +15,17 @@ About us : http://betweendigital.com ```javascript var adUnits = [ { - code: 'test-div', + code: 'ad_slot', + mediaTypes: { + banner: { + sizes: [[970, 250], [240, 400], [728, 90]] + } + }, bids: [ { bidder: "between", params: { - w: 200, - h: 400, - s: 111 + s: 122938 } } ] @@ -45,14 +48,16 @@ Where: var PREBID_TIMEOUT = 700; var adUnits = [{ - code: 'example', - sizes: [[300, 250], [200,400]], + code: 'example', + mediaTypes: { + banner: { + sizes: [[970, 250], [240, 400], [728, 90]] + } + }, bids: [{ bidder: 'between', params: { - w: 240, - h: 400, - s: 8 + s: 809832 } }] diff --git a/test/spec/modules/betweenBidAdapter_spec.js b/test/spec/modules/betweenBidAdapter_spec.js index 3a6be953d7b..5dff32ca4d8 100644 --- a/test/spec/modules/betweenBidAdapter_spec.js +++ b/test/spec/modules/betweenBidAdapter_spec.js @@ -201,4 +201,24 @@ describe('betweenBidAdapterTests', function () { expect(syncs).to.be.an('array').that.to.have.lengthOf(1); expect(syncs[0]).to.deep.equal({type: 'iframe', url: 'https://ads.betweendigital.com/sspmatch-iframe'}); }); + + it('check sizes', function() { + let bidRequestData = [{ + bidId: 'bid1234', + bidder: 'between', + mediaTypes: { + banner: { + sizes: [[970, 250], [240, 400], [728, 90]] + } + }, + params: { + s: 1112, + }, + }]; + + let request = spec.buildRequests(bidRequestData); + let req_data = request[0].data; + + expect(req_data.sizes).to.deep.equal(['970x250', '240x400', '728x90']); + }); });