Skip to content

Commit

Permalink
Adf adapter: schain support added (#7292)
Browse files Browse the repository at this point in the history
  • Loading branch information
braizhas authored Aug 12, 2021
1 parent 217c8f6 commit 3d8ed53
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
5 changes: 5 additions & 0 deletions modules/adfBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ export const spec = {
const currency = getConfig('currency.adServerCurrency');
const cur = currency && [ currency ];
const eids = setOnAny(validBidRequests, 'userIdAsEids');
const schain = setOnAny(validBidRequests, 'schain');

const imp = validBidRequests.map((bid, id) => {
bid.netRevenue = pt;
Expand Down Expand Up @@ -206,6 +207,10 @@ export const spec = {
utils.deepSetValue(request, 'user.ext.eids', eids);
}

if (schain) {
utils.deepSetValue(request, 'source.ext.schain', schain);
}

return {
method: 'POST',
url: 'https://' + adxDomain + '/adx/openrtb',
Expand Down
21 changes: 21 additions & 0 deletions test/spec/modules/adfBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,27 @@ describe('Adf adapter', function () {
assert.deepEqual(request.cur, [ 'EUR' ]);
});

it('should pass supply chain object', function () {
let validBidRequests = [{
bidId: 'bidId',
params: {},
schain: {
validation: 'strict',
config: {
ver: '1.0'
}
}
}];

let request = JSON.parse(spec.buildRequests(validBidRequests, { refererInfo: { referer: 'page' } }).data);
assert.deepEqual(request.source.ext.schain, {
validation: 'strict',
config: {
ver: '1.0'
}
});
});

describe('priceType', function () {
it('should send default priceType', function () {
let validBidRequests = [{
Expand Down

0 comments on commit 3d8ed53

Please sign in to comment.