Skip to content

Commit

Permalink
Gnet Bid Adapter: Change endpoint and add parameter (prebid#7934)
Browse files Browse the repository at this point in the history
* Add files via upload

* Add files via upload

* Change params on gnetBidder

* ADJ - Use parseSizesInput to get sizes
ADJ - Check serverResponse object
ADJ - Remove getUserSyncs function

* ADJ - Change prebid endpoint

* ADJ - Change endpoint on test

* GnetBidAdapter update for Prebid 5.x

* Change endpoint and add parameter

* import only used function from utils

Co-authored-by: Roberto Hsu Wu <hsuroberto@gmail.com>
Co-authored-by: Roberto Hsu <roberto.wu@grumft.com>
Co-authored-by: Denise Balesteros Silva <denise.balesteros@grumft.com>
  • Loading branch information
4 people authored Jan 13, 2022
1 parent a897fa6 commit 9783e9f
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
6 changes: 3 additions & 3 deletions modules/gnetBidAdapter.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { _each, parseSizesInput, isEmpty } from '../src/utils.js';
import { registerBidder } from '../src/adapters/bidderFactory.js';
import { _each, isEmpty, parseSizesInput } from '../src/utils.js';
import { BANNER } from '../src/mediaTypes.js';

const BIDDER_CODE = 'gnet';
const ENDPOINT = 'https://adserver.gnetproject.com/prebid.php';
const ENDPOINT = 'https://service.gnetrtb.com/api/adrequest';

export const spec = {
code: BIDDER_CODE,
Expand All @@ -16,7 +16,7 @@ export const spec = {
* @return boolean True if this is a valid bid, and false otherwise.
*/
isBidRequestValid: function (bid) {
return !!(bid.params.websiteId);
return !!(bid.params.websiteId && bid.params.adunitId);
},

/**
Expand Down
8 changes: 4 additions & 4 deletions modules/gnetBidAdapter.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# Overview

```
Module Name: Gnet Bidder Adapter
Module Name: Gnet RTB Bidder Adapter
Module Type: Bidder Adapter
Maintainer: roberto.wu@grumft.com
Maintainer: bruno.bonanho@grumft.com
```

# Description

Connect to Gnet Project exchange for bids.
Connect to Gnet RTB exchange for bids.

# Test Parameters
```
Expand All @@ -24,7 +24,7 @@ Connect to Gnet Project exchange for bids.
{
bidder: 'gnet',
params: {
websiteId: '4'
websiteId: '1', adunitId: '1'
}
}
]
Expand Down
12 changes: 6 additions & 6 deletions test/spec/modules/gnetBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
newBidder
} from 'src/adapters/bidderFactory.js';

const ENDPOINT = 'https://adserver.gnetproject.com/prebid.php';
const ENDPOINT = 'https://service.gnetrtb.com/api/adrequest';

describe('gnetAdapter', function () {
const adapter = newBidder(spec);
Expand All @@ -23,7 +23,7 @@ describe('gnetAdapter', function () {
let bid = {
bidder: 'gnet',
params: {
websiteId: '4'
websiteId: '1', adunitId: '1'
}
};

Expand All @@ -43,7 +43,7 @@ describe('gnetAdapter', function () {
const bidRequests = [{
bidder: 'gnet',
params: {
websiteId: '4'
websiteId: '1', adunitId: '1'
},
adUnitCode: '/150790500/4_ZONA_IAB_300x250_5',
sizes: [
Expand All @@ -57,7 +57,7 @@ describe('gnetAdapter', function () {

const bidderRequest = {
refererInfo: {
referer: 'https://gnetproject.com/'
referer: 'https://gnetrtb.com'
}
};

Expand All @@ -66,13 +66,13 @@ describe('gnetAdapter', function () {
expect(requests[0].url).to.equal(ENDPOINT);
expect(requests[0].method).to.equal('POST');
expect(requests[0].data).to.equal(JSON.stringify({
'referer': 'https://gnetproject.com/',
'referer': 'https://gnetrtb.com',
'adUnitCode': '/150790500/4_ZONA_IAB_300x250_5',
'bidId': '2a19afd5173318',
'transactionId': '894bdff6-61ec-4bec-a5a9-f36a5bfccef5',
'sizes': ['300x250'],
'params': {
'websiteId': '4'
'websiteId': '1', 'adunitId': '1'
}
}));
});
Expand Down

0 comments on commit 9783e9f

Please sign in to comment.