Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions modules/33acrossBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const utils = require('../src/utils');

const BIDDER_CODE = '33across';
const END_POINT = 'https://ssc.33across.com/api/v1/hb';
const SYNC_ENDPOINT = 'https://de.tynt.com/deb/v2?m=xch';
const SYNC_ENDPOINT = 'https://de.tynt.com/deb/v2?m=xch&rt=html';

// All this assumes that only one bid is ever returned by ttx
function _createBidResponse(response) {
Expand All @@ -15,7 +15,7 @@ function _createBidResponse(response) {
height: response.seatbid[0].bid[0].h,
ad: response.seatbid[0].bid[0].adm,
ttl: response.seatbid[0].bid[0].ttl || 60,
creativeId: response.seatbid[0].bid[0].ext.rp.advid,
creativeId: response.seatbid[0].bid[0].crid,
currency: response.cur,
netRevenue: true
}
Expand Down Expand Up @@ -45,10 +45,14 @@ function _createServerRequest(bidRequest) {
// Go ahead send the bidId in request to 33exchange so it's kept track of in the bid response and
// therefore in ad targetting process
ttxRequest.id = bidRequest.bidId;
// Finally, set the openRTB 'test' param if this is to be a test bid
if (params.test === 1) {
ttxRequest.test = 1;
}

const options = {
contentType: 'application/json',
withCredentials: false
withCredentials: true
};

if (bidRequest.params.customHeaders) {
Expand Down
50 changes: 17 additions & 33 deletions test/spec/modules/33acrossBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ describe('33acrossBidAdapter:', function () {
data: JSON.stringify(ttxRequest),
options: {
contentType: 'application/json',
withCredentials: false
withCredentials: true
}
}
const builtServerRequests = buildRequests(this.bidRequests);
Expand Down Expand Up @@ -198,7 +198,7 @@ describe('33acrossBidAdapter:', function () {
data: JSON.stringify(ttxRequest),
options: {
contentType: 'application/json',
withCredentials: false,
withCredentials: true,
customHeaders: {
foo: 'bar'
}
Expand Down Expand Up @@ -227,14 +227,10 @@ describe('33acrossBidAdapter:', function () {
bid: [{
id: '1',
adm: '<html><h3>I am an ad</h3></html>',
ext: {
rp: {
advid: 1
}
},
h: 250,
w: 300,
price: 0.0938
price: 0.0938,
crid: '23455'
}]
}
]
Expand All @@ -248,7 +244,7 @@ describe('33acrossBidAdapter:', function () {
height: 250,
ad: '<html><h3>I am an ad</h3></html>',
ttl: 60,
creativeId: 1,
creativeId: '23455',
currency: 'USD',
netRevenue: true
}
Expand Down Expand Up @@ -281,41 +277,29 @@ describe('33acrossBidAdapter:', function () {
bid: [{
id: '1',
adm: '<html><h3>I am an ad</h3></html>',
ext: {
rp: {
advid: 1
}
},
h: 250,
w: 300,
price: 0.0940
price: 0.0940,
crid: 1
},
{
id: '2',
adm: '<html><h3>I am an ad</h3></html>',
ext: {
rp: {
advid: 2
}
},
h: 250,
w: 300,
price: 0.0938
price: 0.0938,
crid: 2
}
]
},
{
bid: [{
id: '3',
adm: '<html><h3>I am an ad</h3></html>',
ext: {
rp: {
advid: 3
}
},
h: 250,
w: 300,
price: 0.0938
price: 0.0938,
crid: 3
}]
}
]
Expand Down Expand Up @@ -361,37 +345,37 @@ describe('33acrossBidAdapter:', function () {
params: {
site: { id: 'id1' },
productId: 'p1',
syncUrl: 'https://staging-de.tynt.com/deb/v2?m=xch'
syncUrl: 'https://foo.com/v2?m=xch'
}
},
{
params: {
site: { id: 'id2' },
productId: 'p1',
syncUrl: 'https://staging-de.tynt.com/deb/v2?m=xch'
syncUrl: 'https://foo.com/v2?m=xch'
}
}
];

this.syncs = [
{
type: 'iframe',
url: 'https://de.tynt.com/deb/v2?m=xch&id=id1'
url: 'https://de.tynt.com/deb/v2?m=xch&rt=html&id=id1'
},
{
type: 'iframe',
url: 'https://de.tynt.com/deb/v2?m=xch&id=id2'
url: 'https://de.tynt.com/deb/v2?m=xch&rt=html&id=id2'
},
];

this.testSyncs = [
{
type: 'iframe',
url: 'https://staging-de.tynt.com/deb/v2?m=xch&id=id1'
url: 'https://foo.com/v2?m=xch&id=id1'
},
{
type: 'iframe',
url: 'https://staging-de.tynt.com/deb/v2?m=xch&id=id2'
url: 'https://foo.com/v2?m=xch&id=id2'
},
];
});
Expand Down