Skip to content

Commit

Permalink
ZetaGlobalSsp Bid Adapter: modify timeout object (prebid#11236)
Browse files Browse the repository at this point in the history
* ZetaGlobalSsp Adapter: modify onTimeout object

* -

* fix unit test

---------

Co-authored-by: Surovenko Alexey <[email protected]>
Co-authored-by: Alexey Surovenko <[email protected]>
  • Loading branch information
3 people authored Apr 15, 2024
1 parent 3dda9d2 commit ea8692c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
9 changes: 8 additions & 1 deletion modules/zeta_global_sspBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,14 @@ export const spec = {

onTimeout: function(timeoutData) {
if (timeoutData) {
ajax(TIMEOUT_URL, null, JSON.stringify(timeoutData), {
const payload = timeoutData.map(d => ({
bidder: d?.bidder,
shortname: d?.params?.map(p => p?.tags?.shortname).find(p => p),
sid: d?.params?.map(p => p?.sid).find(p => p),
country: d?.ortb2?.device?.geo?.country,
devicetype: d?.ortb2?.device?.devicetype
}));
ajax(TIMEOUT_URL, null, JSON.stringify(payload), {
method: 'POST',
options: {
withCredentials: false,
Expand Down
2 changes: 1 addition & 1 deletion test/spec/modules/zeta_global_sspBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -544,7 +544,7 @@ describe('Zeta Ssp Bid Adapter', function () {

it('Timeout should exists and be a function', function () {
expect(spec.onTimeout).to.exist.and.to.be.a('function');
expect(spec.onTimeout({ timeout: 1000 })).to.be.undefined;
expect(spec.onTimeout([{bidder: '1'}])).to.be.undefined;
});

it('Test schain provided', function () {
Expand Down

0 comments on commit ea8692c

Please sign in to comment.