Skip to content

Commit

Permalink
added alias feature and host param
Browse files Browse the repository at this point in the history
  • Loading branch information
fatihkaya84 committed Nov 4, 2022
1 parent 42675a0 commit 6ec8f45
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
6 changes: 5 additions & 1 deletion modules/admaticBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export const spec = {
let isValid = false;
if (typeof bid.params !== 'undefined') {
let isValidNetworkId = _validateId(getValue(bid.params, 'networkId'));
let isValidHost = getValue(bid.params, 'host');
let isValidHost = _validateString(getValue(bid.params, 'host'));
isValid = isValidNetworkId && isValidHost;
}

Expand Down Expand Up @@ -198,4 +198,8 @@ function _validateId(id) {
return (parseInt(id) > 0);
}

function _validateString(str) {
return (typeof str == 'string');
}

registerBidder(spec);
1 change: 1 addition & 0 deletions modules/admaticBidAdapter.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ Use `admatic` as bidder.
```

## UserSync example

```
pbjs.setConfig({
userSync: {
Expand Down
6 changes: 4 additions & 2 deletions test/spec/modules/admaticBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ describe('admaticBidAdapter', () => {
let bid = {
'bidder': 'admatic',
'params': {
'networkId': 10433394
'networkId': 10433394,
'host': 'layer.serve.admatic.com.tr'
},
'adUnitCode': 'adunit-code',
'sizes': [[300, 250], [300, 600]],
Expand All @@ -37,7 +38,8 @@ describe('admaticBidAdapter', () => {
delete bid.params;

bid.params = {
'networkId': 0
'networkId': 0,
'host': 'layer.serve.admatic.com.tr'
};

expect(spec.isBidRequestValid(bid)).to.equal(false);
Expand Down

0 comments on commit 6ec8f45

Please sign in to comment.