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 #3070

Closed
wants to merge 12 commits into from
11 changes: 6 additions & 5 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 @@ -68,7 +68,7 @@ function getDomain(url) {

function makePrebidRequest(req) {
let host = req.params.host || DEFAULT_HOST;
let url = window.location.protocol + '//' + host + '/dsp?id=' + req.params.id + '&token=' + req.params.token;
let url = '//' + host + '/dsp?id=' + req.params.id + '&token=' + req.params.token;
let reqData = makeRtbRequest(req);
return {
method: 'POST',
Expand Down Expand Up @@ -124,9 +124,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
10 changes: 5 additions & 5 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 All @@ -29,4 +29,4 @@ Module that connects to rxrtb's demand source
]
},
];
```
```
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', () => {
describe('rexrtb adapater', () => {
describe('Test validate req', () => {
it('should accept minimum valid bid', () => {
let bid = {
bidder: 'rxrtb',
bidder: 'rexrtb',
params: {
id: 89,
token: '658f11a5efbbce2f9be3f1f146fcbc22',
Expand All @@ -19,7 +19,7 @@ describe('rxrtb adapater', () => {

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

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

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

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

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

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