Skip to content

Commit

Permalink
Appnexus adapter: Added dealPriority and dealCode to bidResponse (#3201)
Browse files Browse the repository at this point in the history
* Added dealPriority and dealCode to appnexus adapter

* update failed test

* added namespace and did deep merge

* keep all properties together
  • Loading branch information
jaiminpanchal27 authored and mkendall07 committed Oct 30, 2018
1 parent 903743a commit 0de2478
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
4 changes: 3 additions & 1 deletion modules/appnexusBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,9 @@ function newBid(serverBid, rtbBid, bidderRequest) {
netRevenue: true,
ttl: 300,
appnexus: {
buyerMemberId: rtbBid.buyer_member_id
buyerMemberId: rtbBid.buyer_member_id,
dealPriority: rtbBid.deal_priority,
dealCode: rtbBid.deal_code
}
};

Expand Down
10 changes: 10 additions & 0 deletions test/spec/modules/appnexusBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -561,5 +561,15 @@ describe('AppNexusAdapter', function () {
bidderRequest.bids[0].renderer.options
);
});

it('should add deal_priority and deal_code', function() {
let responseWithDeal = deepClone(response);
responseWithDeal.tags[0].ads[0].deal_priority = 'high';
responseWithDeal.tags[0].ads[0].deal_code = '123';

let bidderRequest;
let result = spec.interpretResponse({ body: responseWithDeal }, {bidderRequest});
expect(Object.keys(result[0].appnexus)).to.include.members(['buyerMemberId', 'dealPriority', 'dealCode']);
});
});
});

0 comments on commit 0de2478

Please sign in to comment.