Skip to content

Commit

Permalink
Rise Bid Adapter : remove multi currency support (#11427)
Browse files Browse the repository at this point in the history
* removed currency test

* removed currency from optional params in md

* removed currency from generateBidParameters

* removed currency from getFloor
  • Loading branch information
Dedis23 authored May 1, 2024
1 parent c561843 commit 0bb0ad3
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 19 deletions.
11 changes: 4 additions & 7 deletions modules/riseBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,19 +146,18 @@ registerBidder(spec);
* Get floor price
* @param bid {bid}
* @param mediaType {string}
* @param currency {string}
* @returns {Number}
*/
function getFloor(bid, mediaType, currency) {
function getFloor(bid, mediaType) {
if (!isFn(bid.getFloor)) {
return 0;
}
let floorResult = bid.getFloor({
currency: currency,
currency: DEFAULT_CURRENCY,
mediaType: mediaType,
size: '*'
});
return floorResult.currency === currency && floorResult.floor ? floorResult.floor : 0;
return floorResult.currency === DEFAULT_CURRENCY && floorResult.floor ? floorResult.floor : 0;
}

/**
Expand Down Expand Up @@ -296,7 +295,6 @@ function generateBidParameters(bid, bidderRequest) {
const {params} = bid;
const mediaType = isBanner(bid) ? BANNER : VIDEO;
const sizesArray = getSizesArray(bid, mediaType);
const currency = params.currency || config.getConfig('currency.adServerCurrency') || DEFAULT_CURRENCY;
// fix floor price in case of NAN
if (isNaN(params.floorPrice)) {
params.floorPrice = 0;
Expand All @@ -306,8 +304,7 @@ function generateBidParameters(bid, bidderRequest) {
mediaType,
adUnitCode: getBidIdParameter('adUnitCode', bid),
sizes: sizesArray,
currency: currency,
floorPrice: Math.max(getFloor(bid, mediaType, currency), params.floorPrice),
floorPrice: Math.max(getFloor(bid, mediaType), params.floorPrice),
bidId: getBidIdParameter('bidId', bid),
bidderRequestId: getBidIdParameter('bidderRequestId', bid),
loop: getBidIdParameter('bidderRequestsCount', bid),
Expand Down
2 changes: 0 additions & 2 deletions modules/riseBidAdapter.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ The adapter supports Video(instream).
| `testMode` | optional | Boolean | This activates the test mode | false
| `rtbDomain` | optional | String | Sets the seller end point | "www.test.com"
| `is_wrapper` | private | Boolean | Please don't use unless your account manager asked you to | false
| `currency` | optional | String | 3 letters currency | "EUR"


# Test Parameters
```javascript
Expand Down
10 changes: 0 additions & 10 deletions test/spec/modules/riseBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -201,16 +201,6 @@ describe('riseAdapter', function () {
expect(request.data.bids[1].mediaType).to.equal(BANNER)
});

it('should send the correct currency in bid request', function () {
const bid = utils.deepClone(bidRequests[0]);
bid.params = {
'currency': 'EUR'
};
const expectedCurrency = bid.params.currency;
const request = spec.buildRequests([bid], bidderRequest);
expect(request.data.bids[0].currency).to.equal(expectedCurrency);
});

it('should respect syncEnabled option', function() {
config.setConfig({
userSync: {
Expand Down

0 comments on commit 0bb0ad3

Please sign in to comment.