From 10ea6b3f6b4bbb30bef1d1d2df1b94937a669b4c Mon Sep 17 00:00:00 2001 From: pm-shashank-jain Date: Wed, 8 Apr 2020 14:22:43 +0530 Subject: [PATCH] Pull changes for dspid and seatid from prebid master --- modules/pubmaticBidAdapter.js | 2 ++ test/spec/modules/pubmaticBidAdapter_spec.js | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/modules/pubmaticBidAdapter.js b/modules/pubmaticBidAdapter.js index ec87563d4c2..b5ecd784a6c 100644 --- a/modules/pubmaticBidAdapter.js +++ b/modules/pubmaticBidAdapter.js @@ -1031,6 +1031,8 @@ export const spec = { br.ttl = 300; br.referrer = parsedReferrer; br.ad = bid.adm; + br.pm_seat = seatbidder.seat || null; + br.pm_dspid = bid.ext && bid.ext.dspid ? bid.ext.dspid : null if (requestData.imp && requestData.imp.length > 0) { requestData.imp.forEach(req => { if (bid.impid === req.id) { diff --git a/test/spec/modules/pubmaticBidAdapter_spec.js b/test/spec/modules/pubmaticBidAdapter_spec.js index 3ad33d5f66c..cf7d98948e2 100644 --- a/test/spec/modules/pubmaticBidAdapter_spec.js +++ b/test/spec/modules/pubmaticBidAdapter_spec.js @@ -89,6 +89,7 @@ describe('PubMatic adapter', function () { bidRequests = [firstBid, secoundBid]; firstResponse = { + 'seat': 'seat-id', 'bid': [{ 'id': '74858439-49D7-4169-BA5D-44A046315B2F', 'impid': '23acc48ad47af5', @@ -2589,6 +2590,8 @@ describe('PubMatic adapter', function () { expect(response[0].meta.clickUrl).to.equal('blackrock.com'); expect(response[0].referrer).to.include(data.site.ref); expect(response[0].ad).to.equal(bidResponses.body.seatbid[0].bid[0].adm); + expect(response[0].pm_seat).to.equal(bidResponses.body.seatbid[0].seat); + expect(response[0].pm_dspid).to.equal(bidResponses.body.seatbid[0].bid[0].ext.dspid); expect(response[1].requestId).to.equal(bidResponses.body.seatbid[1].bid[0].impid); expect(response[1].cpm).to.equal((bidResponses.body.seatbid[1].bid[0].price).toFixed(2)); @@ -2608,6 +2611,8 @@ describe('PubMatic adapter', function () { expect(response[1].meta.clickUrl).to.equal('hivehome.com'); expect(response[1].referrer).to.include(data.site.ref); expect(response[1].ad).to.equal(bidResponses.body.seatbid[1].bid[0].adm); + expect(response[1].pm_seat).to.equal(bidResponses.body.seatbid[1].seat || null); + expect(response[1].pm_dspid).to.equal(bidResponses.body.seatbid[1].bid[0].ext.dspid); }); it('should check for dealChannel value selection', function () {