Skip to content

Commit

Permalink
Kargo Bid Adapter: Add currency support for bid response (#8134)
Browse files Browse the repository at this point in the history
* Kargo Bid Adapter: Use currency from Bid Response

* Kargo Bid Adapter: Fix failed test

Co-authored-by: Jeremy Sadwith <jeremy@kargo.com>
  • Loading branch information
wwongkargo and jsadwith authored Mar 3, 2022
1 parent 688d0b9 commit 5c69ca1
Show file tree
Hide file tree
Showing 2 changed files with 27 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
26 changes: 26 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,18 @@ 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>',
ttl: 300,
creativeId: 'bar',
dealId: undefined,
netRevenue: true,
currency: 'EUR',
meta: undefined
}];
expect(resp).to.deep.equal(expectation);
});
Expand Down

0 comments on commit 5c69ca1

Please sign in to comment.