Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BeOp Bid adapter: use conventional currency location #7381

Merged
merged 1 commit into from
Sep 7, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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