diff --git a/modules/missenaBidAdapter.js b/modules/missenaBidAdapter.js index bba8f988be6..5fdc984ac0a 100644 --- a/modules/missenaBidAdapter.js +++ b/modules/missenaBidAdapter.js @@ -11,6 +11,7 @@ import { config } from '../src/config.js'; import { BANNER } from '../src/mediaTypes.js'; import { registerBidder } from '../src/adapters/bidderFactory.js'; import { getStorageManager } from '../src/storageManager.js'; +import { isAutoplayEnabled } from '../libraries/autoplayDetection/autoplay.js'; /** * @typedef {import('../src/adapters/bidderFactory.js').BidRequest} BidRequest @@ -91,8 +92,10 @@ function toPayload(bidRequest, bidderRequest) { const bidFloor = getFloor(bidRequest); payload.floor = bidFloor?.floor; payload.floor_currency = bidFloor?.currency; - payload.currency = config.getConfig('currency.adServerCurrency') || 'EUR'; + payload.currency = config.getConfig('currency.adServerCurrency'); payload.schain = bidRequest.schain; + payload.coppa = bidderRequest?.ortb2?.regs?.coppa ? 1 : 0; + payload.autoplay = isAutoplayEnabled() === true ? 1 : 0; return { method: 'POST', diff --git a/test/spec/modules/missenaBidAdapter_spec.js b/test/spec/modules/missenaBidAdapter_spec.js index 2b05a1f0830..5453e087eb2 100644 --- a/test/spec/modules/missenaBidAdapter_spec.js +++ b/test/spec/modules/missenaBidAdapter_spec.js @@ -1,6 +1,8 @@ import { expect } from 'chai'; import { spec, storage } from 'modules/missenaBidAdapter.js'; import { BANNER } from '../../../src/mediaTypes.js'; +import { config } from 'src/config.js'; +import * as autoplay from 'libraries/autoplayDetection/autoplay.js'; const REFERRER = 'https://referer'; const REFERRER2 = 'https://referer2'; @@ -12,6 +14,9 @@ describe('Missena Adapter', function () { storageAllowed: true, }, }; + let sandbox = sinon.sandbox.create(); + sandbox.stub(config, 'getConfig').withArgs('coppa').returns(true); + sandbox.stub(autoplay, 'isAutoplayEnabled').returns(false); const bidId = 'abc'; const bid = { @@ -69,6 +74,7 @@ describe('Missena Adapter', function () { topmostLocation: REFERRER, canonicalUrl: 'https://canonical', }, + ortb2: { regs: { coppa: 1 } }, }; const bids = [bid, bidWithoutFloor]; @@ -107,6 +113,15 @@ describe('Missena Adapter', function () { const payload = JSON.parse(request.data); const payloadNoFloor = JSON.parse(requests[1].data); + it('should send disabled autoplay', function () { + expect(payload.autoplay).to.equal(0); + }); + + it('should contain coppa', function () { + expect(payload.coppa).to.equal(1); + }); + sandbox.restore(); + it('should contain uspConsent', function () { expect(payload.us_privacy).to.equal('IDO'); });