Skip to content

Commit

Permalink
Revert "Vrtcal Bid Adapter: added Non-Static Bid Floor Support (#7324)…
Browse files Browse the repository at this point in the history
…" (#7331)

This reverts commit a1c8a1e.
  • Loading branch information
ChrisHuie authored Aug 20, 2021
1 parent a1c8a1e commit 4da2c8a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 24 deletions.
13 changes: 2 additions & 11 deletions modules/vrtcalBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,25 +10,16 @@ export const spec = {
},
buildRequests: function (bidRequests) {
const requests = bidRequests.map(function (bid) {
let floor = 0;

if (typeof bid.getFloor === 'function') {
const floorInfo = bid.getFloor({ currency: 'USD', mediaType: 'banner', size: bid.sizes.map(([w, h]) => ({w, h})) });

if (typeof floorInfo === 'object' && floorInfo.currency === 'USD' && !isNaN(parseFloat(floorInfo.floor))) {
floor = Math.max(floor, parseFloat(floorInfo.floor));
}
}

const params = {

prebidJS: 1,
prebidAdUnitCode: bid.adUnitCode,
id: bid.bidId,
imp: [{
id: '1',
banner: {
},
bidfloor: floor
bidfloor: 0.75
}],
site: {
id: 'VRTCAL_FILLED',
Expand Down
14 changes: 1 addition & 13 deletions test/spec/modules/vrtcalBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ describe('vrtcalBidAdapter', function () {
}
];

let request = spec.buildRequests(bidRequests);
const request = spec.buildRequests(bidRequests);

it('sends bid request to our endpoint via POST', function () {
expect(request[0].method).to.equal('POST');
Expand All @@ -38,18 +38,6 @@ describe('vrtcalBidAdapter', function () {
it('adUnitCode should be sent as prebidAdUnitCode parameters on any requests', function () {
expect(request[0].data).to.match(/"prebidAdUnitCode":"adunit0001"/);
});

it('if the publisher has NOT set a floor via the floors module, zero should be sent as bidfloor parameter on any requests', function () {
expect(request[0].data).to.match(/"bidfloor":0/);
});

it('if the publisher has set a floor via the floors module, it should be sent as bidfloor parameter on any requests', function () {
let floorInfo;
bidRequests[0].getFloor = () => floorInfo;
floorInfo = {currency: 'USD', floor: 0.55};
request = spec.buildRequests(bidRequests);
expect(request[0].data).to.match(/"bidfloor":0.55/);
});
});

describe('interpretResponse', function () {
Expand Down

0 comments on commit 4da2c8a

Please sign in to comment.