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

Updating seedingAlliance Adapter #5517

Merged
merged 11 commits into from
Jul 21, 2020
20 changes: 13 additions & 7 deletions modules/seedingAllianceBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ export const spec = {
const pt = setOnAny(validBidRequests, 'params.pt') || setOnAny(validBidRequests, 'params.priceType') || 'net';
const tid = validBidRequests[0].transactionId;
const cur = [config.getConfig('currency.adServerCurrency') || DEFAULT_CUR];
let pubcid = null;
let url = bidderRequest.refererInfo.referer;

const imp = validBidRequests.map((bid, id) => {
Expand Down Expand Up @@ -112,10 +111,6 @@ export const spec = {
};
});

if (validBidRequests[0].crumbs && validBidRequests[0].crumbs.pubcid) {
pubcid = validBidRequests[0].crumbs.pubcid;
}

const request = {
id: bidderRequest.auctionId,
site: {
Expand All @@ -126,15 +121,26 @@ export const spec = {
},
cur,
imp,
user: {
buyeruid: pubcid
user: {},
regs: {
ext: {
gdpr: 0
}
}
};

if (bidderRequest && bidderRequest.gdprConsent) {
utils.deepSetValue(request, 'user.ext.consent', bidderRequest.gdprConsent.consentString);
utils.deepSetValue(request, 'regs.ext.gdpr', (typeof bidderRequest.gdprConsent.gdprApplies === 'boolean' && bidderRequest.gdprConsent.gdprApplies) ? 1 : 0);
}

return {
method: 'POST',
url: ENDPOINT_URL,
data: JSON.stringify(request),
options: {
contentType: 'application/json'
},
bids: validBidRequests
};
},
Expand Down
2 changes: 1 addition & 1 deletion test/spec/modules/seedingAllianceAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ describe('SeedingAlliance adapter', function () {
});

it('should have default request structure', function () {
let keys = 'site,device,cur,imp,user'.split(',');
let keys = 'site,device,cur,imp,user,regs'.split(',');
let validBidRequests = [{
bidId: 'bidId',
params: {}
Expand Down