Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add verizon alias to aol #5722

Merged
merged 2 commits into from
Sep 11, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 18 additions & 9 deletions modules/aolBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { BANNER } from '../src/mediaTypes.js';

const AOL_BIDDERS_CODES = {
AOL: 'aol',
VERIZON: 'verizon',
ONEMOBILE: 'onemobile',
ONEDISPLAY: 'onedisplay'
};
Expand Down Expand Up @@ -48,23 +49,27 @@ const NUMERIC_VALUES = {
};

function template(strings, ...keys) {
return function(...values) {
return function (...values) {
let dict = values[values.length - 1] || {};
let result = [strings[0]];
keys.forEach(function(key, i) {
keys.forEach(function (key, i) {
let value = utils.isInteger(key) ? values[key] : dict[key];
result.push(value, strings[i + 1]);
});
return result.join('');
};
}

function _isMarketplaceBidder(bidder) {
return bidder === AOL_BIDDERS_CODES.AOL || bidder === AOL_BIDDERS_CODES.ONEDISPLAY;
function _isMarketplaceBidder(bidderCode) {
return bidderCode === AOL_BIDDERS_CODES.AOL ||
bidderCode === AOL_BIDDERS_CODES.VERIZON ||
bidderCode === AOL_BIDDERS_CODES.ONEDISPLAY;
}

function _isOneMobileBidder(bidderCode) {
return bidderCode === AOL_BIDDERS_CODES.AOL || bidderCode === AOL_BIDDERS_CODES.ONEMOBILE;
return bidderCode === AOL_BIDDERS_CODES.AOL ||
bidderCode === AOL_BIDDERS_CODES.VERIZON ||
bidderCode === AOL_BIDDERS_CODES.ONEMOBILE;
}

function _isNexageRequestPost(bid) {
Expand Down Expand Up @@ -101,7 +106,11 @@ function resolveEndpointCode(bid) {
export const spec = {
code: AOL_BIDDERS_CODES.AOL,
gvlid: 25,
aliases: [AOL_BIDDERS_CODES.ONEMOBILE, AOL_BIDDERS_CODES.ONEDISPLAY],
aliases: [
AOL_BIDDERS_CODES.ONEMOBILE,
AOL_BIDDERS_CODES.ONEDISPLAY,
AOL_BIDDERS_CODES.VERIZON
],
supportedMediaTypes: [BANNER],
isBidRequestValid(bid) {
return isMarketplaceBid(bid) || isMobileBid(bid);
Expand All @@ -121,7 +130,7 @@ export const spec = {
}
});
},
interpretResponse({body}, bidRequest) {
interpretResponse({ body }, bidRequest) {
if (!body) {
utils.logError('Empty bid response', bidRequest.bidderCode, body);
} else {
Expand Down Expand Up @@ -216,11 +225,11 @@ export const spec = {
}));
},
buildOneMobileGetUrl(bid, consentData) {
let {dcn, pos, ext} = bid.params;
let { dcn, pos, ext } = bid.params;
let nexageApi = this.buildOneMobileBaseUrl(bid);
if (dcn && pos) {
let dynamicParams = this.formatOneMobileDynamicParams(ext, consentData);
nexageApi += nexageGetApiTemplate({dcn, pos, dynamicParams});
nexageApi += nexageGetApiTemplate({ dcn, pos, dynamicParams });
}
return nexageApi;
},
Expand Down