diff --git a/modules/adfBidAdapter.js b/modules/adfBidAdapter.js index 7666e98b374..43dcdcd1604 100644 --- a/modules/adfBidAdapter.js +++ b/modules/adfBidAdapter.js @@ -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; @@ -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', diff --git a/test/spec/modules/adfBidAdapter_spec.js b/test/spec/modules/adfBidAdapter_spec.js index 25ad6987153..ef11490529a 100644 --- a/test/spec/modules/adfBidAdapter_spec.js +++ b/test/spec/modules/adfBidAdapter_spec.js @@ -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 = [{