@@ -19,7 +19,7 @@ const SUPPORTED_AD_TYPES = [BANNER, VIDEO];
19
19
const BIDDER_CODE = 'rise' ;
20
20
const ADAPTER_VERSION = '6.0.0' ;
21
21
const TTL = 360 ;
22
- const CURRENCY = 'USD' ;
22
+ const DEFAULT_CURRENCY = 'USD' ;
23
23
const DEFAULT_SELLER_ENDPOINT = 'https://hb.yellowblue.io/' ;
24
24
const MODES = {
25
25
PRODUCTION : 'hb-multi' ,
@@ -73,7 +73,7 @@ export const spec = {
73
73
const bidResponse = {
74
74
requestId : adUnit . requestId ,
75
75
cpm : adUnit . cpm ,
76
- currency : adUnit . currency || CURRENCY ,
76
+ currency : adUnit . currency || DEFAULT_CURRENCY ,
77
77
width : adUnit . width ,
78
78
height : adUnit . height ,
79
79
ttl : adUnit . ttl || TTL ,
@@ -140,18 +140,20 @@ registerBidder(spec);
140
140
/**
141
141
* Get floor price
142
142
* @param bid {bid}
143
+ * @param mediaType {string}
144
+ * @param currency {string}
143
145
* @returns {Number }
144
146
*/
145
- function getFloor ( bid , mediaType ) {
147
+ function getFloor ( bid , mediaType , currency ) {
146
148
if ( ! isFn ( bid . getFloor ) ) {
147
149
return 0 ;
148
150
}
149
151
let floorResult = bid . getFloor ( {
150
- currency : CURRENCY ,
152
+ currency : currency ,
151
153
mediaType : mediaType ,
152
154
size : '*'
153
155
} ) ;
154
- return floorResult . currency === CURRENCY && floorResult . floor ? floorResult . floor : 0 ;
156
+ return floorResult . currency === currency && floorResult . floor ? floorResult . floor : 0 ;
155
157
}
156
158
157
159
/**
@@ -289,7 +291,7 @@ function generateBidParameters(bid, bidderRequest) {
289
291
const { params} = bid ;
290
292
const mediaType = isBanner ( bid ) ? BANNER : VIDEO ;
291
293
const sizesArray = getSizesArray ( bid , mediaType ) ;
292
-
294
+ const currency = params . currency || config . getConfig ( 'currency.adServerCurrency' ) || DEFAULT_CURRENCY ;
293
295
// fix floor price in case of NAN
294
296
if ( isNaN ( params . floorPrice ) ) {
295
297
params . floorPrice = 0 ;
@@ -299,12 +301,13 @@ function generateBidParameters(bid, bidderRequest) {
299
301
mediaType,
300
302
adUnitCode : getBidIdParameter ( 'adUnitCode' , bid ) ,
301
303
sizes : sizesArray ,
302
- floorPrice : Math . max ( getFloor ( bid , mediaType ) , params . floorPrice ) ,
304
+ currency : currency ,
305
+ floorPrice : Math . max ( getFloor ( bid , mediaType , currency ) , params . floorPrice ) ,
303
306
bidId : getBidIdParameter ( 'bidId' , bid ) ,
304
307
bidderRequestId : getBidIdParameter ( 'bidderRequestId' , bid ) ,
305
308
loop : getBidIdParameter ( 'bidderRequestsCount' , bid ) ,
306
309
transactionId : bid . ortb2Imp ?. ext ?. tid ,
307
- coppa : 0
310
+ coppa : 0 ,
308
311
} ;
309
312
310
313
const pos = deepAccess ( bid , `mediaTypes.${ mediaType } .pos` ) ;
0 commit comments