Skip to content

Commit d5247e6

Browse files
Wls-demoAiholkinvladis-teqblazeMykhailo YaremchukChrisHuie
authored andcommitted
Boldwin Bid Adapter: added endpointId param (prebid#8798)
* new boldwin bid adapter * fix * Restarting ci / circleci * changes * fixed conflicts * added endpointId param * kick off CircleCI tests Co-authored-by: Aiholkin <[email protected]> Co-authored-by: Vladislav Isaiko <[email protected]> Co-authored-by: Mykhailo Yaremchuk <[email protected]> Co-authored-by: Chris Huie <[email protected]>
1 parent edaa499 commit d5247e6

File tree

3 files changed

+31
-4
lines changed

3 files changed

+31
-4
lines changed

modules/boldwinBidAdapter.js

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ export const spec = {
4646
supportedMediaTypes: [BANNER, VIDEO, NATIVE],
4747

4848
isBidRequestValid: (bid) => {
49-
return Boolean(bid.bidId && bid.params && bid.params.placementId);
49+
return Boolean(bid.bidId && bid.params && (bid.params.placementId || bid.params.endpointId));
5050
},
5151

5252
buildRequests: (validBidRequests = [], bidderRequest) => {
@@ -85,7 +85,7 @@ export const spec = {
8585

8686
for (let i = 0; i < len; i++) {
8787
let bid = validBidRequests[i];
88-
const { mediaTypes } = bid;
88+
const { mediaTypes, params } = bid;
8989
const placement = {};
9090
let sizes;
9191
if (mediaTypes) {
@@ -114,9 +114,18 @@ export const spec = {
114114
placement.native = mediaTypes[NATIVE];
115115
}
116116
}
117+
118+
const { placementId, endpointId } = params;
119+
if (placementId) {
120+
placement.placementId = placementId;
121+
placement.type = 'publisher';
122+
} else if (endpointId) {
123+
placement.endpointId = endpointId;
124+
placement.type = 'network';
125+
}
126+
117127
placements.push({
118128
...placement,
119-
placementId: bid.params.placementId,
120129
bidId: bid.bidId,
121130
sizes: sizes || [],
122131
wPlayer: sizes ? sizes[0] : 0,

modules/boldwinBidAdapter.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,5 +47,22 @@ Module that connects to boldwin demand sources
4747
}
4848
]
4949
}
50+
// Will return static test banner
51+
{
52+
code: 'endpointId_0',
53+
mediaTypes: {
54+
banner: {
55+
sizes: [[300, 250]],
56+
}
57+
},
58+
bids: [
59+
{
60+
bidder: 'boldwin',
61+
params: {
62+
endpointId: 'testBanner',
63+
}
64+
}
65+
]
66+
},
5067
];
5168
```

test/spec/modules/boldwinBidAdapter_spec.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,12 @@ describe('BoldwinBidAdapter', function () {
5959
expect(data.gdpr).to.not.exist;
6060
expect(data.ccpa).to.not.exist;
6161
let placement = data['placements'][0];
62-
expect(placement).to.have.keys('placementId', 'bidId', 'adFormat', 'sizes', 'hPlayer', 'wPlayer', 'schain', 'bidFloor');
62+
expect(placement).to.have.keys('placementId', 'bidId', 'adFormat', 'sizes', 'hPlayer', 'wPlayer', 'schain', 'bidFloor', 'type');
6363
expect(placement.placementId).to.equal('testBanner');
6464
expect(placement.bidId).to.equal('23fhj33i987f');
6565
expect(placement.adFormat).to.equal(BANNER);
6666
expect(placement.schain).to.be.an('object');
67+
expect(placement.type).to.exist.and.to.equal('publisher');
6768
});
6869

6970
it('Returns valid data for mediatype video', function () {

0 commit comments

Comments
 (0)