Skip to content

Commit

Permalink
Merge pull request #1 from KargoGlobal/use_currency_response
Browse files Browse the repository at this point in the history
Kargo Bid Adapter: Use currency from Bid Response
  • Loading branch information
jsadwith authored Mar 1, 2022
2 parents 00e0bb5 + b1cc757 commit d69377a
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
2 changes: 1 addition & 1 deletion modules/kargoBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ export const spec = {
creativeId: adUnit.id,
dealId: adUnit.targetingCustom,
netRevenue: true,
currency: bidRequest.currency,
currency: (adUnit.currency && adUnit.currency) || bidRequest.currency,
meta: meta
});
}
Expand Down
25 changes: 25 additions & 0 deletions test/spec/modules/kargoBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -493,6 +493,15 @@ describe('kargo adapter tests', function () {
adm: '<div id="2"></div>',
width: 300,
height: 250
},
4: {
id: 'bar',
cpm: 2.5,
adm: '<div id="4"></div>',
width: 300,
height: 250,
metadata: {},
currency: 'EUR'
}
}}, {
currency: 'USD',
Expand All @@ -511,6 +520,11 @@ describe('kargo adapter tests', function () {
params: {
placementId: 'bar'
}
}, {
bidId: 4,
params: {
placementId: 'bar'
}
}]
});
var expectation = [{
Expand Down Expand Up @@ -552,6 +566,17 @@ describe('kargo adapter tests', function () {
netRevenue: true,
currency: 'USD',
meta: undefined
}, {
requestId: '4',
cpm: 2.5,
width: 300,
height: 250,
ad: '<div id="4"></div>',
creativeId: 'bar',
dealId: undefined,
netRevenue: true,
currency: 'EUR',
meta: undefined
}];
expect(resp).to.deep.equal(expectation);
});
Expand Down

0 comments on commit d69377a

Please sign in to comment.