Skip to content

Commit 9297612

Browse files
authored
welect: update parameters to match backend specs of tcf2.0 (#5613)
* update parameters to match backend specs of tcf2.0 * add gvlid to spec
1 parent b211409 commit 9297612

File tree

2 files changed

+25
-20
lines changed

2 files changed

+25
-20
lines changed

modules/welectBidAdapter.js

Lines changed: 21 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ const DEFAULT_DOMAIN = 'www.welect.de';
77
export const spec = {
88
code: BIDDER_CODE,
99
aliases: ['wlt'],
10+
gvlid: 282,
1011
supportedMediaTypes: ['video'],
1112

1213
// short code
@@ -17,7 +18,10 @@ export const spec = {
1718
* @return boolean True if this is a valid bid, and false otherwise.
1819
*/
1920
isBidRequestValid: function (bid) {
20-
return utils.deepAccess(bid, 'mediaTypes.video.context') === 'instream' && !!(bid.params.placementId);
21+
return (
22+
utils.deepAccess(bid, 'mediaTypes.video.context') === 'instream' &&
23+
!!bid.params.placementId
24+
);
2125
},
2226
/**
2327
* Make a server request from the list of BidRequests.
@@ -26,9 +30,11 @@ export const spec = {
2630
* @return ServerRequest Info describing the request to the server.
2731
*/
2832
buildRequests: function (validBidRequests) {
29-
return validBidRequests.map(bidRequest => {
30-
let rawSizes = utils.deepAccess(bidRequest, 'mediaTypes.video.playerSize') || bidRequest.sizes;
31-
let size = rawSizes[0]
33+
return validBidRequests.map((bidRequest) => {
34+
let rawSizes =
35+
utils.deepAccess(bidRequest, 'mediaTypes.video.playerSize') ||
36+
bidRequest.sizes;
37+
let size = rawSizes[0];
3238

3339
let domain = bidRequest.params.domain || DEFAULT_DOMAIN;
3440

@@ -38,20 +44,19 @@ export const spec = {
3844

3945
if (bidRequest && bidRequest.gdprConsent) {
4046
gdprConsent = {
41-
gdpr_consent:
42-
{
43-
gdpr_applies: bidRequest.gdprConsent.gdprApplies,
44-
gdpr_consent: bidRequest.gdprConsent.gdprConsent
45-
}
46-
}
47+
gdpr_consent: {
48+
gdprApplies: bidRequest.gdprConsent.gdprApplies,
49+
tcString: bidRequest.gdprConsent.gdprConsent,
50+
},
51+
};
4752
}
4853

4954
const data = {
5055
width: size[0],
5156
height: size[1],
5257
bid_id: bidRequest.bidId,
53-
...gdprConsent
54-
}
58+
...gdprConsent,
59+
};
5560

5661
return {
5762
method: 'POST',
@@ -61,8 +66,8 @@ export const spec = {
6166
contentType: 'application/json',
6267
withCredentials: false,
6368
crossOrigin: true,
64-
}
65-
}
69+
},
70+
};
6671
});
6772
},
6873
/**
@@ -82,6 +87,6 @@ export const spec = {
8287
const bidResponse = responseBody.bidResponse;
8388
bidResponses.push(bidResponse);
8489
return bidResponses;
85-
}
86-
}
90+
},
91+
};
8792
registerBidder(spec);

test/spec/modules/welectBidAdapter_spec.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,8 @@ describe('WelectAdapter', function () {
9595
width: 640,
9696
height: 360,
9797
gdpr_consent: {
98-
gdpr_applies: 1,
99-
gdpr_consent: 'some_string'
98+
gdprApplies: 1,
99+
tcString: 'some_string'
100100
}
101101
}
102102

@@ -166,8 +166,8 @@ describe('WelectAdapter', function () {
166166
width: 640,
167167
height: 320,
168168
gdpr_consent: {
169-
gdpr_applies: 1,
170-
gdpr_consent: 'some_string'
169+
gdprApplies: 1,
170+
tcString: 'some_string'
171171
}
172172
},
173173
method: 'POST',

0 commit comments

Comments
 (0)