From 2fc9405d37a086f2b58f14a09bcb2dc827c68b84 Mon Sep 17 00:00:00 2001 From: shubhendu-singh-doceree <66065249+shubhendu-singh-doceree@users.noreply.github.com> Date: Tue, 7 Dec 2021 13:11:11 +0530 Subject: [PATCH 1/8] Update docereeBidAdapter.md --- modules/docereeBidAdapter.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/docereeBidAdapter.md b/modules/docereeBidAdapter.md index d977e11f40a..d9cd0486279 100644 --- a/modules/docereeBidAdapter.md +++ b/modules/docereeBidAdapter.md @@ -25,6 +25,8 @@ var adUnits = [ params: { placementId: 'DOC_7jm9j5eqkl0xvc5w', //required publisherUrl: document.URL || window.location.href, //optional + gdpr: '1', //optional + gdpr_consent:'CPQfU1jPQfU1jG0AAAENAwCAAAAAAAAAAAAAAAAAAAAA.IGLtV_T9fb2vj-_Z99_tkeYwf95y3p-wzhheMs-8NyZeH_B4Wv2MyvBX4JiQKGRgksjLBAQdtHGlcTQgBwIlViTLMYk2MjzNKJrJEilsbO2dYGD9Pn8HT3ZCY70-vv__7v3ff_3g', //optional } } ] From ea6a9c98a8f439fd1e7f8a273f612e0fff6606cd Mon Sep 17 00:00:00 2001 From: shubhendu-singh-doceree <66065249+shubhendu-singh-doceree@users.noreply.github.com> Date: Tue, 7 Dec 2021 13:11:16 +0530 Subject: [PATCH 2/8] Update docereeBidAdapter.js --- modules/docereeBidAdapter.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/docereeBidAdapter.js b/modules/docereeBidAdapter.js index 704619f3ff7..4fec9799e65 100644 --- a/modules/docereeBidAdapter.js +++ b/modules/docereeBidAdapter.js @@ -21,7 +21,7 @@ export const spec = { const encodedUserInfo = window.btoa(encodeURIComponent(JSON.stringify(data))) validBidRequests.forEach(function(validBidRequest) { - const { publisherUrl, placementId } = validBidRequest.params; + const { publisherUrl, placementId, gdpr, gdpr_consent } = validBidRequest.params; const url = publisherUrl || page let queryString = ''; queryString = tryAppendQueryString(queryString, 'id', placementId); @@ -32,6 +32,8 @@ export const spec = { queryString = tryAppendQueryString(queryString, 'prebidjs', true); queryString = tryAppendQueryString(queryString, 'token', token); queryString = tryAppendQueryString(queryString, 'requestId', validBidRequest.bidId); + queryString = tryAppendQueryString(queryString, 'gdpr', gdpr); + queryString = tryAppendQueryString(queryString, 'gdpr_consent', gdpr_consent); serverRequests.push({ method: 'GET', From c366616079346cc31a00f8e82896a678db5a02b1 Mon Sep 17 00:00:00 2001 From: shubhendu-singh-doceree <66065249+shubhendu-singh-doceree@users.noreply.github.com> Date: Tue, 7 Dec 2021 15:57:09 +0530 Subject: [PATCH 3/8] Update docereeBidAdapter.js --- modules/docereeBidAdapter.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/docereeBidAdapter.js b/modules/docereeBidAdapter.js index 4fec9799e65..2715a6d1371 100644 --- a/modules/docereeBidAdapter.js +++ b/modules/docereeBidAdapter.js @@ -21,7 +21,7 @@ export const spec = { const encodedUserInfo = window.btoa(encodeURIComponent(JSON.stringify(data))) validBidRequests.forEach(function(validBidRequest) { - const { publisherUrl, placementId, gdpr, gdpr_consent } = validBidRequest.params; + const { publisherUrl, placementId, gdpr, gdprConsent } = validBidRequest.params; const url = publisherUrl || page let queryString = ''; queryString = tryAppendQueryString(queryString, 'id', placementId); @@ -33,7 +33,7 @@ export const spec = { queryString = tryAppendQueryString(queryString, 'token', token); queryString = tryAppendQueryString(queryString, 'requestId', validBidRequest.bidId); queryString = tryAppendQueryString(queryString, 'gdpr', gdpr); - queryString = tryAppendQueryString(queryString, 'gdpr_consent', gdpr_consent); + queryString = tryAppendQueryString(queryString, 'gdpr_consent', gdprConsent); serverRequests.push({ method: 'GET', From d8b441b15490842b060a787d806f32e5c945452d Mon Sep 17 00:00:00 2001 From: shubhendu-singh-doceree <66065249+shubhendu-singh-doceree@users.noreply.github.com> Date: Tue, 7 Dec 2021 15:57:49 +0530 Subject: [PATCH 4/8] Update docereeBidAdapter.md --- modules/docereeBidAdapter.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/docereeBidAdapter.md b/modules/docereeBidAdapter.md index d9cd0486279..9072fb374b6 100644 --- a/modules/docereeBidAdapter.md +++ b/modules/docereeBidAdapter.md @@ -26,7 +26,7 @@ var adUnits = [ placementId: 'DOC_7jm9j5eqkl0xvc5w', //required publisherUrl: document.URL || window.location.href, //optional gdpr: '1', //optional - gdpr_consent:'CPQfU1jPQfU1jG0AAAENAwCAAAAAAAAAAAAAAAAAAAAA.IGLtV_T9fb2vj-_Z99_tkeYwf95y3p-wzhheMs-8NyZeH_B4Wv2MyvBX4JiQKGRgksjLBAQdtHGlcTQgBwIlViTLMYk2MjzNKJrJEilsbO2dYGD9Pn8HT3ZCY70-vv__7v3ff_3g', //optional + gdprConsent:'CPQfU1jPQfU1jG0AAAENAwCAAAAAAAAAAAAAAAAAAAAA.IGLtV_T9fb2vj-_Z99_tkeYwf95y3p-wzhheMs-8NyZeH_B4Wv2MyvBX4JiQKGRgksjLBAQdtHGlcTQgBwIlViTLMYk2MjzNKJrJEilsbO2dYGD9Pn8HT3ZCY70-vv__7v3ff_3g', //optional } } ] From f91d275ff9b2a56184af487559b3330c83d68973 Mon Sep 17 00:00:00 2001 From: shubhendu-singh-doceree <66065249+shubhendu-singh-doceree@users.noreply.github.com> Date: Fri, 10 Dec 2021 16:51:50 +0530 Subject: [PATCH 5/8] Function to check gdpr consent present --- modules/docereeBidAdapter.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/modules/docereeBidAdapter.js b/modules/docereeBidAdapter.js index 2715a6d1371..897d7f1f83c 100644 --- a/modules/docereeBidAdapter.js +++ b/modules/docereeBidAdapter.js @@ -14,6 +14,13 @@ export const spec = { const { placementId } = bid.params; return !!placementId }, + isGdprConsentPresent: (bid) => { + const { gdpr, gdprConsent } = bid.params; + if (gdpr=='1'){ + return !!gdprConsent + } + return true + }, buildRequests: (validBidRequests) => { const serverRequests = []; const { data } = config.getConfig('doceree.user') From a4734d76251b295dfc72e0891c6c6627d51d1c6f Mon Sep 17 00:00:00 2001 From: shubhendu-singh-doceree <66065249+shubhendu-singh-doceree@users.noreply.github.com> Date: Fri, 10 Dec 2021 16:56:50 +0530 Subject: [PATCH 6/8] Unit test case to check if gdpr consent present --- test/spec/modules/docereeBidAdapter_spec.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/spec/modules/docereeBidAdapter_spec.js b/test/spec/modules/docereeBidAdapter_spec.js index efff2efa319..2882b9abbd6 100644 --- a/test/spec/modules/docereeBidAdapter_spec.js +++ b/test/spec/modules/docereeBidAdapter_spec.js @@ -31,6 +31,8 @@ describe('BidlabBidAdapter', function () { bidder: 'doceree', params: { placementId: 'DOC_7jm9j5eqkl0xvc5w', + gdpr: '1', + gdprConsent: 'CPQfU1jPQfU1jG0AAAENAwCAAAAAAAAAAAAAAAAAAAAA.IGLtV_T9fb2vj-_Z99_tkeYwf95y3p-wzhheMs-8NyZeH_B4Wv2MyvBX4JiQKGRgksjLBAQdtHGlcTQgBwIlViTLMYk2MjzNKJrJEilsbO2dYGD9Pn8HT3ZCY70-vv__7v3ff_3g' } }; @@ -43,6 +45,12 @@ describe('BidlabBidAdapter', function () { expect(spec.isBidRequestValid(bid)).to.be.false; }); }); + + describe('isGdprConsentPresent', function () { + it('Should return true if gdpr consent is present', function () { + expect(spec.isGdprConsentPresent(bid)).to.be.true; + }); + }); describe('buildRequests', function () { let serverRequest = spec.buildRequests([bid]); From 7a4f52bfd35416c3c4cfcd22d2fa5273b33fe2ab Mon Sep 17 00:00:00 2001 From: shubhendu-singh-doceree <66065249+shubhendu-singh-doceree@users.noreply.github.com> Date: Fri, 10 Dec 2021 17:00:22 +0530 Subject: [PATCH 7/8] Update docereeBidAdapter_spec.js --- test/spec/modules/docereeBidAdapter_spec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/spec/modules/docereeBidAdapter_spec.js b/test/spec/modules/docereeBidAdapter_spec.js index 2882b9abbd6..b476c999ae7 100644 --- a/test/spec/modules/docereeBidAdapter_spec.js +++ b/test/spec/modules/docereeBidAdapter_spec.js @@ -45,7 +45,7 @@ describe('BidlabBidAdapter', function () { expect(spec.isBidRequestValid(bid)).to.be.false; }); }); - + describe('isGdprConsentPresent', function () { it('Should return true if gdpr consent is present', function () { expect(spec.isGdprConsentPresent(bid)).to.be.true; From e0188a9a2da59afbdef0b34e4d65bab6c9921e97 Mon Sep 17 00:00:00 2001 From: Shubhendu Singh Date: Fri, 10 Dec 2021 17:20:06 +0530 Subject: [PATCH 8/8] Fixed build errors --- modules/docereeBidAdapter.js | 2 +- test/spec/modules/docereeBidAdapter_spec.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/docereeBidAdapter.js b/modules/docereeBidAdapter.js index 897d7f1f83c..737a9f707db 100644 --- a/modules/docereeBidAdapter.js +++ b/modules/docereeBidAdapter.js @@ -16,7 +16,7 @@ export const spec = { }, isGdprConsentPresent: (bid) => { const { gdpr, gdprConsent } = bid.params; - if (gdpr=='1'){ + if (gdpr == '1') { return !!gdprConsent } return true diff --git a/test/spec/modules/docereeBidAdapter_spec.js b/test/spec/modules/docereeBidAdapter_spec.js index b476c999ae7..dadbb56b0c0 100644 --- a/test/spec/modules/docereeBidAdapter_spec.js +++ b/test/spec/modules/docereeBidAdapter_spec.js @@ -45,7 +45,7 @@ describe('BidlabBidAdapter', function () { expect(spec.isBidRequestValid(bid)).to.be.false; }); }); - + describe('isGdprConsentPresent', function () { it('Should return true if gdpr consent is present', function () { expect(spec.isGdprConsentPresent(bid)).to.be.true; @@ -64,7 +64,7 @@ describe('BidlabBidAdapter', function () { expect(serverRequest.method).to.equal('GET'); }); it('Returns valid URL', function () { - expect(serverRequest.url).to.equal('https://bidder.doceree.com/v1/adrequest?id=DOC_7jm9j5eqkl0xvc5w&pubRequestedURL=undefined&loggedInUser=JTdCJTIyZ2VuZGVyJTIyJTNBJTIyJTIyJTJDJTIyZW1haWwlMjIlM0ElMjIlMjIlMkMlMjJoYXNoZWRFbWFpbCUyMiUzQSUyMiUyMiUyQyUyMmZpcnN0TmFtZSUyMiUzQSUyMiUyMiUyQyUyMmxhc3ROYW1lJTIyJTNBJTIyJTIyJTJDJTIybnBpJTIyJTNBJTIyJTIyJTJDJTIyaGFzaGVkTlBJJTIyJTNBJTIyJTIyJTJDJTIyY2l0eSUyMiUzQSUyMiUyMiUyQyUyMnppcENvZGUlMjIlM0ElMjIlMjIlMkMlMjJzcGVjaWFsaXphdGlvbiUyMiUzQSUyMiUyMiU3RA%3D%3D&prebidjs=true&requestId=testing&'); + expect(serverRequest.url).to.equal('https://bidder.doceree.com/v1/adrequest?id=DOC_7jm9j5eqkl0xvc5w&pubRequestedURL=undefined&loggedInUser=JTdCJTIyZ2VuZGVyJTIyJTNBJTIyJTIyJTJDJTIyZW1haWwlMjIlM0ElMjIlMjIlMkMlMjJoYXNoZWRFbWFpbCUyMiUzQSUyMiUyMiUyQyUyMmZpcnN0TmFtZSUyMiUzQSUyMiUyMiUyQyUyMmxhc3ROYW1lJTIyJTNBJTIyJTIyJTJDJTIybnBpJTIyJTNBJTIyJTIyJTJDJTIyaGFzaGVkTlBJJTIyJTNBJTIyJTIyJTJDJTIyY2l0eSUyMiUzQSUyMiUyMiUyQyUyMnppcENvZGUlMjIlM0ElMjIlMjIlMkMlMjJzcGVjaWFsaXphdGlvbiUyMiUzQSUyMiUyMiU3RA%3D%3D&prebidjs=true&requestId=testing&gdpr=1&gdpr_consent=CPQfU1jPQfU1jG0AAAENAwCAAAAAAAAAAAAAAAAAAAAA.IGLtV_T9fb2vj-_Z99_tkeYwf95y3p-wzhheMs-8NyZeH_B4Wv2MyvBX4JiQKGRgksjLBAQdtHGlcTQgBwIlViTLMYk2MjzNKJrJEilsbO2dYGD9Pn8HT3ZCY70-vv__7v3ff_3g&'); }); }); describe('interpretResponse', function () {