Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RhythmOne Adapter - schain support #4414

Merged
merged 1 commit into from Nov 18, 2019
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: 9 additions & 1 deletion modules/rhythmoneBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ function RhythmOneBidAdapter() {
}

function frameBid(BRs, bidderRequest) {
return {
let bid = {
id: BRs[0].bidderRequestId,
imp: frameImp(BRs, bidderRequest),
site: frameSite(bidderRequest),
Expand All @@ -181,6 +181,14 @@ function RhythmOneBidAdapter() {
}
}
};
if (BRs[0].schain) {
bid.source = {
'ext': {
'schain': BRs[0].schain
}
}
}
return bid;
}

function getFirstParam(key, validBidRequests) {
Expand Down
40 changes: 40 additions & 0 deletions test/spec/modules/rhythmoneBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -702,6 +702,46 @@ describe('rhythmone adapter tests', function () {
expect(openrtbRequest.imp[0].secure).to.equal(1);
});

it('should pass schain', function() {
var schain = {
'ver': '1.0',
'complete': 1,
'nodes': [{
'asi': 'indirectseller.com',
'sid': '00001',
'hp': 1
}, {
'asi': 'indirectseller-2.com',
'sid': '00002',
'hp': 1
}]
};
var bidRequestList = [
{
'bidder': 'rhythmone',
'params': {
'placementId': 'myplacement',
'zone': 'myzone',
'path': 'mypath'
},
'mediaType': 'banner',
'adUnitCode': 'div-gpt-ad-1438287399331-0',
'sizes': [[300, 250]],
'transactionId': 'd7b773de-ceaa-484d-89ca-d9f51b8d61ec',
'bidderRequestId': '418b37f85e772c',
'auctionId': '18fd8b8b0bd757',
'bidRequestsCount': 1,
'bidId': '51ef8751f9aead',
'schain': schain
}
];

var bidRequest = r1adapter.buildRequests(bidRequestList, this.defaultBidderRequest);
const openrtbRequest = JSON.parse(bidRequest.data);

expect(openrtbRequest.source.ext.schain).to.deep.equal(schain);
});

describe('misc interpretResponse', function () {
it('No bid response', function() {
var noBidResponse = r1adapter.interpretResponse({
Expand Down