Skip to content

Commit

Permalink
PE-87: remove BT specific logic (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
PavloMalashnyak authored Dec 22, 2023
1 parent 0edb357 commit b28a062
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 21 deletions.
16 changes: 4 additions & 12 deletions modules/BTBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ import { ortbConverter } from '../libraries/ortbConverter/converter.js';

const BIDDER_CODE = 'blockthrough';
const GVLID = 815;
const ENDPOINT_URL = 'https://pbs.btloader.com/openrtb2/auction';
const SYNC_URL = 'https://cdn.btloader.com/user_sync.html';
// reach out for approval to marketing@blockthrough.com
const ENDPOINT_URL = 'https://pbs.sample.com';
const SYNC_URL = 'https://cdn.sample.com';

const CONVERTER = ortbConverter({
context: {
Expand All @@ -32,16 +33,7 @@ function imp(buildImp, bidRequest, context) {
const { params, ortb2Imp } = bidRequest;

if (params) {
const { blockthrough, ...btBidderParams } = params;

deepSetValue(imp, 'ext', btBidderParams);
if (blockthrough?.auctionID) {
deepSetValue(
imp,
'ext.prebid.blockthrough.auctionID',
blockthrough.auctionID
);
}
deepSetValue(imp, 'ext', params);
}
if (ortb2Imp?.ext.gpid) {
deepSetValue(imp, 'gpid', ortb2Imp.ext.gpid);
Expand Down
2 changes: 1 addition & 1 deletion modules/BTBidAdapter.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ The BT adapter requires setup and approval from the Blockthrough team. Please re

# Bidder Config

Make sure to set ab, orgID, websiteID values received after approval using `pbjs.setBidderConfig`.
Make sure to set required ab, orgID, websiteID values received after approval using `pbjs.setBidderConfig`.

## Example

Expand Down
10 changes: 2 additions & 8 deletions test/spec/modules/BTBidAdapte_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,14 @@ import 'modules/gppControl_usnat.js';
import 'modules/schain.js';

describe('BT Bid Adapter', () => {
const ENDPOINT_URL = 'https://pbs.btloader.com/openrtb2/auction';
const ENDPOINT_URL = 'https://pbs.sample.com';
const validBidRequests = [
{
bidId: '2e9f38ea93bb9e',
bidder: 'blockthrough',
adUnitCode: 'adunit-code',
mediaTypes: { [BANNER]: { sizes: [[300, 250]] } },
params: {
blockthrough: {
auctionID: 'auctionID',
},
bidderA: {
pubId: '11111',
},
Expand Down Expand Up @@ -78,9 +75,6 @@ describe('BT Bid Adapter', () => {
bidderA: {
pubId: '11111',
},
prebid: {
blockthrough: { auctionID: 'auctionID' },
},
};

const requests = spec.buildRequests(validBidRequests, bidderRequest);
Expand Down Expand Up @@ -152,7 +146,7 @@ describe('BT Bid Adapter', () => {
});

describe('getUserSyncs', () => {
const SYNC_URL = 'https://cdn.btloader.com/user_sync.html';
const SYNC_URL = 'https://cdn.sample.com/';

it('should return an empty array if no sync options are provided', () => {
const syncs = spec.getUserSyncs({}, [], null, null, null);
Expand Down

0 comments on commit b28a062

Please sign in to comment.