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

[Update] Change name BidAdapter and some fix #3118

Merged
merged 20 commits into from
Oct 1, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 5 additions & 7 deletions modules/rxrtbBidAdapter.js → modules/rexrtbBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {BANNER} from 'src/mediaTypes';
import {registerBidder} from 'src/adapters/bidderFactory';
import {config} from 'src/config';

const BIDDER_CODE = 'rxrtb';
const BIDDER_CODE = 'rexrtb';
const DEFAULT_HOST = 'bid.rxrtb.bid';
const AUCTION_TYPE = 2;
const RESPONSE_TTL = 900;
Expand All @@ -12,7 +12,7 @@ export const spec = {
code: BIDDER_CODE,
supportedMediaTypes: [BANNER],
isBidRequestValid: function (bidRequest) {
return 'params' in bidRequest && bidRequest.params.source !== undefined && bidRequest.params.id !== undefined && utils.isInteger(bidRequest.params.id) && bidRequest.params.token !== undefined;
return 'params' in bidRequest && bidRequest.params.id !== undefined && utils.isInteger(bidRequest.params.id) && bidRequest.params.token !== undefined;
},
buildRequests: function (validBidRequests) {
var requests = [];
Expand Down Expand Up @@ -62,7 +62,6 @@ registerBidder(spec);
function getDomain(url) {
var a = document.createElement('a');
a.href = url;

return a.host;
}

Expand Down Expand Up @@ -99,11 +98,9 @@ function makeImp(req) {
'tagid': req.adUnitCode,
'banner': makeBanner(req)
};

if (req.params.bidfloor && isFinite(req.params.bidfloor)) {
imp.bidfloor = req.params.bidfloor
}

return imp;
}

Expand All @@ -124,9 +121,10 @@ function makeBanner(req) {
}

function makeSite(req) {
let domain = getDomain(config.getConfig('publisherDomain'));
return {
'id': req.params.source,
'domain': getDomain(config.getConfig('publisherDomain')),
'id': req.params.source || domain,
'domain': domain,
'page': utils.getTopWindowUrl(),
'ref': utils.getTopWindowReferrer()
};
Expand Down
8 changes: 4 additions & 4 deletions modules/rxrtbBidAdapter.md → modules/rexrtbBidAdapter.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# Overview

Module Name: rxrtb Bidder Adapter
Module Name: REXRTB Bidder Adapter

Module Type: Bidder Adapter

Maintainer: contact@picellaltd.com
Maintainer: tech@rexrtb.com


# Description

Module that connects to rxrtb's demand source
Module that connects to REXRTB's demand source

# Test Parameters
```javascript
Expand All @@ -19,7 +19,7 @@ Module that connects to rxrtb's demand source
sizes: [[728, 98]],
bids: [
{
bidder: 'rxrtb',
bidder: 'rexrtb',
params: {
id: 89,
token: '658f11a5efbbce2f9be3f1f146fcbc22',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import {expect} from 'chai';
import {spec} from 'modules/rxrtbBidAdapter';
import {spec} from 'modules/rexrtbBidAdapter';

describe('rxrtb adapater', function () {
describe('rexrtb adapater', function () {
describe('Test validate req', function () {
it('should accept minimum valid bid', function () {
let bid = {
bidder: 'rxrtb',
bidder: 'rexrtb',
params: {
id: 89,
token: '658f11a5efbbce2f9be3f1f146fcbc22',
Expand All @@ -19,7 +19,7 @@ describe('rxrtb adapater', function () {

it('should reject missing id', function () {
let bid = {
bidder: 'rxrtb',
bidder: 'rexrtb',
params: {
token: '658f11a5efbbce2f9be3f1f146fcbc22',
source: 'prebidtest'
Expand All @@ -32,7 +32,7 @@ describe('rxrtb adapater', function () {

it('should reject id not Integer', function () {
let bid = {
bidder: 'rxrtb',
bidder: 'rexrtb',
params: {
id: '123',
token: '658f11a5efbbce2f9be3f1f146fcbc22',
Expand All @@ -43,25 +43,12 @@ describe('rxrtb adapater', function () {

expect(isValid).to.equal(false);
});

it('should reject missing source', function () {
let bid = {
bidder: 'rxrtb',
params: {
id: 89,
token: '658f11a5efbbce2f9be3f1f146fcbc22'
}
};
const isValid = spec.isBidRequestValid(bid);

expect(isValid).to.equal(false);
});
});

describe('Test build request', function () {
it('minimum request', function () {
let bid = {
bidder: 'rxrtb',
bidder: 'rexrtb',
sizes: [[728, 90]],
bidId: '4d0a6829338a07',
adUnitCode: 'div-gpt-ad-1460505748561-0',
Expand Down