Skip to content

Commit

Permalink
Updating seedingAlliance Adapter (#5517)
Browse files Browse the repository at this point in the history
* add seedingAlliance Adapter

* add two native default params

* ...

* ...

* seedingAlliance Adapter: add two more default native params

* updating seedingAlliance Adapter
  • Loading branch information
SeedingAllianceTech authored Jul 21, 2020
1 parent c56a03f commit bb91d54
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
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

0 comments on commit bb91d54

Please sign in to comment.