diff --git a/modules/adformBidAdapter.js b/modules/adformBidAdapter.js index 9754653cfe4..1da6042f63a 100644 --- a/modules/adformBidAdapter.js +++ b/modules/adformBidAdapter.js @@ -13,13 +13,13 @@ export const spec = { buildRequests: function (validBidRequests) { var i, l, j, k, bid, _key, _value, reqParams; var request = []; - var globalParams = [ [ 'adxDomain', 'adx.adform.net' ], [ 'fd', 1 ], [ 'url', null ], [ 'tid', null ] ]; - var netRevenue = 'net'; + var globalParams = [ [ 'adxDomain', 'adx.adform.net' ], [ 'fd', 1 ], [ 'url', null ], [ 'tid', null ], [ 'pt', null ] ]; + var netRevenue = 'gross'; var bids = JSON.parse(JSON.stringify(validBidRequests)); for (i = 0, l = bids.length; i < l; i++) { bid = bids[i]; - if (bid.params.priceType === 'gross') { - netRevenue = 'gross'; + if (bid.params.priceType === 'net') { + bid.params.pt = netRevenue = 'net'; } for (j = 0, k = globalParams.length; j < k; j++) { _key = globalParams[j][0]; diff --git a/modules/adformBidAdapter.md b/modules/adformBidAdapter.md index b2f67273a18..10ebec37e08 100644 --- a/modules/adformBidAdapter.md +++ b/modules/adformBidAdapter.md @@ -21,7 +21,7 @@ Banner and video formats are supported. params: { adxDomain: 'adx.adform.net', //optional mid: '292063', - priceType: 'gross' // default is 'net' + priceType: 'net' // default is 'gross' } } ] diff --git a/test/spec/modules/adformBidAdapter_spec.js b/test/spec/modules/adformBidAdapter_spec.js index a330f18e685..f3aa735be00 100644 --- a/test/spec/modules/adformBidAdapter_spec.js +++ b/test/spec/modules/adformBidAdapter_spec.js @@ -62,8 +62,7 @@ describe('Adform adapter', () => { { mid: '2', someVar: 'someValue', - transactionId: '5f33781f-9552-4iuy', - priceType: 'gross' + transactionId: '5f33781f-9552-4iuy' }, { mid: '3', @@ -166,12 +165,20 @@ describe('Adform adapter', () => { assert.equal(result[i].mediaType, expected[i]); } }); + + it('should set default netRevenue as gross', () => { + bidRequest.netRevenue = 'gross'; + const result = spec.interpretResponse(serverResponse, bidRequest); + for (let i = 0; i < result.length; i++) { + assert.equal(result[i].netRevenue, false); + } + }); }); beforeEach(() => { let sizes = [[250, 300], [300, 250], [300, 600]]; let placementCode = ['div-01', 'div-02', 'div-03', 'div-04', 'div-05']; - let params = [{ mid: 1, url: 'some// there' }, {adxDomain: null, mid: 2, someVar: 'someValue', priceType: 'gross'}, { adxDomain: null, mid: 3, pdom: 'home' }]; + let params = [{ mid: 1, url: 'some// there' }, {adxDomain: null, mid: 2, someVar: 'someValue', pt: 'gross'}, { adxDomain: null, mid: 3, pdom: 'home' }]; bids = [ { adUnitCode: placementCode[0], @@ -285,7 +292,8 @@ describe('Adform adapter', () => { bidder: 'adform', bids: bids, method: 'GET', - url: 'url' + url: 'url', + netRevenue: 'net' }; }); });