@@ -2,7 +2,7 @@ import {config} from 'src/config';
2
2
import { registerBidder } from 'src/adapters/bidderFactory' ;
3
3
import { BANNER , NATIVE , VIDEO } from "../src/mediaTypes" ;
4
4
const BIDDER_CODE = 'freestar' ;
5
- const ENDPOINT_URL = ' https://ssp.pub.network/ssp-server/HeaderBiddingService';
5
+ const ENDPOINT_URL = ( window . location . search . indexOf ( 'fsdebug' ) === - 1 ) ? ' https://ssp.pub.network/ssp-server/HeaderBiddingService' : 'https://dev- ssp.pub.network/ssp-server/HeaderBiddingService';
6
6
const syncURLs = [ ] ;
7
7
export const spec = {
8
8
code : BIDDER_CODE ,
@@ -102,7 +102,10 @@ export const spec = {
102
102
winner . winningSeat . bid [ 0 ] ,
103
103
) ) ) ;
104
104
if ( typeof winner . supplier . cookieSync != 'undefined' ) {
105
- syncURLs . push ( decodeURIComponent ( winner . supplier . cookieSync ) . split ( '\'' ) [ 1 ] ) ;
105
+ syncURLs . push ( {
106
+ type : 'image' ,
107
+ url : decodeURIComponent ( winner . supplier . cookieSync ) . split ( '\'' ) [ 1 ]
108
+ } ) ;
106
109
}
107
110
}
108
111
}
@@ -111,8 +114,8 @@ export const spec = {
111
114
// @TODO : How are we doing user sync?
112
115
getUserSyncs : function ( syncOptions ) {
113
116
if ( syncURLs . length > 0 ) {
114
- let tmp = syncURLs . filter ( ( elm , pos , arr ) => {
115
- console . log ( 'freestar::' , 'elm, pos, arr ' , elm , pos , arr ) ;
117
+ let tmp = syncURLs . filter ( ( syncURL ) => {
118
+ console . log ( 'freestar::' , 'syncURL ' , syncURL ) ;
116
119
} ) ;
117
120
}
118
121
return false ;
@@ -130,17 +133,21 @@ registerBidder(spec);
130
133
* @returns {{requestId, cpm, width, height, creativeId: string|string|string|*|string|string, currency, netRevenue: boolean, ttl: number, ad} }
131
134
*/
132
135
function parseBid ( bid ) {
136
+ let adUnit = bid . adm , cpm = ( window . location . search . indexOf ( 'fsbidprice' ) === - 1 ) ? bid . price : 25.00 ;
137
+ if ( typeof bid . nurl != 'undefined' ) {
138
+ adUnit = `<img src="${ bid . nurl . replace ( '${AUCTION_PRICE}' , cpm ) } " width="0" height="0" style="display:none">` + adUnit ;
139
+ }
133
140
const bidResponse = {
134
141
requestId : bid . impid ,
135
- cpm : bid . price ,
142
+ cpm : cpm ,
136
143
width : bid . w ,
137
144
height : bid . h ,
138
145
creativeId : bid . cid , //@TODO : verify
139
146
// // dealId: DEAL_ID,
140
147
currency : bid . currency ,
141
148
netRevenue : true ,
142
149
ttl : 60 , //@TODO : verify
143
- ad : bid . adm
150
+ ad : adUnit
144
151
} ;
145
152
return bidResponse ;
146
153
}
0 commit comments