Skip to content

Commit

Permalink
remove onBidWon callback from adapter (#5414)
Browse files Browse the repository at this point in the history
* orbidder adapter: add withCredentials:true header to BidRequest and onBidWon Requests

* add blank in order to trigger build again

* remove blank to trigger build ... again

* adding extra line to trigger build ... again

* add prebid version to request

* add unit test for version parameter

* add version parameter to win requests

* fix comment

* trigger rebuild

* trigger rebuild

* remove onBidWon callback from adapter

Co-authored-by: Volk, Rainer <[email protected]>
Co-authored-by: RainerVolk4014 <[email protected]>
Co-authored-by: siggi-otto <[email protected]>
Co-authored-by: Hendrik Iseke <[email protected]>
Co-authored-by: Hendrik Iseke <[email protected]>
Co-authored-by: rvolk <>
  • Loading branch information
6 people authored Jul 1, 2020
1 parent d8e5796 commit 8c87a9e
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 53 deletions.
19 changes: 0 additions & 19 deletions modules/orbidderBidAdapter.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
import {detectReferer} from '../src/refererDetection.js';
import {ajax} from '../src/ajax.js';
import {registerBidder} from '../src/adapters/bidderFactory.js';
import { getStorageManager } from '../src/storageManager.js';

const storage = getStorageManager();

export const spec = {
code: 'orbidder',
bidParams: {},
orbidderHost: (() => {
let ret = 'https://orbidder.otto.de';
try {
Expand Down Expand Up @@ -48,7 +45,6 @@ export const spec = {
params: bidRequest.params
}
};
spec.bidParams[bidRequest.bidId] = bidRequest.params;
if (bidderRequest && bidderRequest.gdprConsent) {
ret.data.gdprConsent = {
consentString: bidderRequest.gdprConsent.consentString,
Expand Down Expand Up @@ -76,21 +72,6 @@ export const spec = {
}
return bidResponses;
},

onBidWon(bid) {
const getRefererInfo = detectReferer(window);

bid.v = $$PREBID_GLOBAL$$.version;
bid.pageUrl = getRefererInfo().referer;
if (spec.bidParams[bid.requestId] && (typeof bid.params === 'undefined')) {
bid.params = [spec.bidParams[bid.requestId]];
}
spec.ajaxCall(`${spec.orbidderHost}/win`, JSON.stringify(bid));
},

ajaxCall(endpoint, data) {
ajax(endpoint, null, data, { withCredentials: true });
}
};

registerBidder(spec);
34 changes: 0 additions & 34 deletions test/spec/modules/orbidderBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,40 +153,6 @@ describe('orbidderBidAdapter', () => {
});
});

describe('onCallbackHandler', () => {
let ajaxStub;
const bidObj = {
adId: 'testId',
test: 1,
pageUrl: 'www.someurl.de',
referrer: 'www.somereferrer.de',
requestId: '123req456'
};

spec.bidParams['123req456'] = {'accountId': '123acc456'};

let bidObjClone = deepClone(bidObj);
bidObjClone.v = $$PREBID_GLOBAL$$.version;
bidObjClone.pageUrl = detectReferer(window)().referer;
bidObjClone.params = [{'accountId': '123acc456'}];

beforeEach(() => {
ajaxStub = sinon.stub(spec, 'ajaxCall');
});

afterEach(() => {
ajaxStub.restore();
});

it('calls orbidder\'s callback endpoint', () => {
spec.onBidWon(bidObj);
expect(ajaxStub.calledOnce).to.equal(true);
expect(ajaxStub.firstCall.args[0].indexOf('https://')).to.equal(0);
expect(ajaxStub.firstCall.args[0]).to.equal(`${spec.orbidderHost}/win`);
expect(ajaxStub.firstCall.args[1]).to.equal(JSON.stringify(bidObjClone));
});
});

describe('interpretResponse', () => {
it('should get correct bid response', () => {
const serverResponse = [
Expand Down

0 comments on commit 8c87a9e

Please sign in to comment.