@@ -19,7 +19,7 @@ const SUPPORTED_AD_TYPES = [BANNER, VIDEO];
19
19
const BIDDER_CODE = 'minutemedia' ;
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 SELLER_ENDPOINT = 'https://hb.minutemedia-prebid.com/' ;
24
24
const MODES = {
25
25
PRODUCTION : 'hb-mm-multi' ,
@@ -72,7 +72,7 @@ export const spec = {
72
72
const bidResponse = {
73
73
requestId : adUnit . requestId ,
74
74
cpm : adUnit . cpm ,
75
- currency : adUnit . currency || CURRENCY ,
75
+ currency : adUnit . currency || DEFAULT_CURRENCY ,
76
76
width : adUnit . width ,
77
77
height : adUnit . height ,
78
78
ttl : adUnit . ttl || TTL ,
@@ -141,16 +141,16 @@ registerBidder(spec);
141
141
* @param bid {bid}
142
142
* @returns {Number }
143
143
*/
144
- function getFloor ( bid , mediaType ) {
144
+ function getFloor ( bid , mediaType , currency ) {
145
145
if ( ! isFn ( bid . getFloor ) ) {
146
146
return 0 ;
147
147
}
148
148
let floorResult = bid . getFloor ( {
149
- currency : CURRENCY ,
149
+ currency : currency ,
150
150
mediaType : mediaType ,
151
151
size : '*'
152
152
} ) ;
153
- return floorResult . currency === CURRENCY && floorResult . floor ? floorResult . floor : 0 ;
153
+ return floorResult . currency === currency && floorResult . floor ? floorResult . floor : 0 ;
154
154
}
155
155
156
156
/**
@@ -286,6 +286,7 @@ function generateBidParameters(bid, bidderRequest) {
286
286
const { params} = bid ;
287
287
const mediaType = isBanner ( bid ) ? BANNER : VIDEO ;
288
288
const sizesArray = getSizesArray ( bid , mediaType ) ;
289
+ const currency = params . currency || config . getConfig ( 'currency.adServerCurrency' ) || DEFAULT_CURRENCY ;
289
290
290
291
// fix floor price in case of NAN
291
292
if ( isNaN ( params . floorPrice ) ) {
@@ -296,12 +297,13 @@ function generateBidParameters(bid, bidderRequest) {
296
297
mediaType,
297
298
adUnitCode : getBidIdParameter ( 'adUnitCode' , bid ) ,
298
299
sizes : sizesArray ,
299
- floorPrice : Math . max ( getFloor ( bid , mediaType ) , params . floorPrice ) ,
300
+ currency : currency ,
301
+ floorPrice : Math . max ( getFloor ( bid , mediaType , currency ) , params . floorPrice ) ,
300
302
bidId : getBidIdParameter ( 'bidId' , bid ) ,
301
303
loop : getBidIdParameter ( 'bidderRequestsCount' , bid ) ,
302
304
bidderRequestId : getBidIdParameter ( 'bidderRequestId' , bid ) ,
303
305
transactionId : bid . ortb2Imp ?. ext ?. tid || '' ,
304
- coppa : 0
306
+ coppa : 0 ,
305
307
} ;
306
308
307
309
const pos = deepAccess ( bid , `mediaTypes.${ mediaType } .pos` ) ;
0 commit comments