Skip to content

Commit

Permalink
Use conventional currency location
Browse files Browse the repository at this point in the history
  • Loading branch information
bloodyowl committed Sep 3, 2021
1 parent 697abe0 commit a81d609
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion modules/beopBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ function buildTrackingParams(data, info, value) {

function beOpRequestSlotsMaker(bid) {
const bannerSizes = utils.deepAccess(bid, 'mediaTypes.banner.sizes');
const publisherCurrency = utils.getValue(bid.params, 'currency') || 'EUR';
const publisherCurrency = config.getConfig('currency.adServerCurrency') || utils.getValue(bid.params, 'currency') || 'EUR';
let floor;
if (typeof bid.getFloor === 'function') {
const floorInfo = bid.getFloor({currency: publisherCurrency, mediaType: 'banner', size: [1, 1]});
Expand Down
13 changes: 13 additions & 0 deletions test/spec/modules/beopBidAdapter_spec.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { expect } from 'chai';
import { spec } from 'modules/beopBidAdapter.js';
import { newBidder } from 'src/adapters/bidderFactory.js';
import { config } from 'src/config.js';
const utils = require('src/utils');

const ENDPOINT = 'https://hb.beop.io/bid';
Expand All @@ -16,6 +17,12 @@ let validBid = {
'sizes': [[1, 1]]
}
},
'getFloor': () => {
return {
currency: 'USD',
floor: 10,
}
},
'bidId': '30b31c1838de1e',
'bidderRequestId': '22edbae2733bf6',
'auctionId': '1d1a030790a475',
Expand All @@ -24,6 +31,10 @@ let validBid = {
};

describe('BeOp Bid Adapter tests', () => {
afterEach(function () {
config.setConfig({});
});

const adapter = newBidder(spec);

describe('inherited functions', () => {
Expand Down Expand Up @@ -81,6 +92,7 @@ describe('BeOp Bid Adapter tests', () => {
bidRequests.push(validBid);

it('should build the request', function () {
config.setConfig({'currency': {'adServerCurrency': 'USD'}});
const request = spec.buildRequests(bidRequests, {});
const payload = JSON.parse(request.data);
const url = request.url;
Expand All @@ -89,6 +101,7 @@ describe('BeOp Bid Adapter tests', () => {
expect(payload.pid).to.equal('5a8af500c9e77c00017e4cad');
expect(payload.slts[0].name).to.exist;
expect(payload.slts[0].name).to.equal('bellow-article');
expect(payload.slts[0].flr).to.equal(10);
});

it('should call the endpoint with GDPR consent and pageURL info if found', function () {
Expand Down

0 comments on commit a81d609

Please sign in to comment.