From 893299a5927b1e91633835eff0db67f0615a74ef Mon Sep 17 00:00:00 2001 From: faithnh Date: Thu, 7 Oct 2021 02:58:27 +0900 Subject: [PATCH] Unicorn Bid Adapter: fix bid_request cur and site.publisher.id to comply with OpenRTB 2.5 (#7545) * fix bid_request cur and site.publisher.id to comply with OpenRTB 2.5 * increment version --- modules/unicornBidAdapter.js | 6 +++--- test/spec/modules/unicornBidAdapter_spec.js | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/modules/unicornBidAdapter.js b/modules/unicornBidAdapter.js index d89866ef379..0209c808979 100644 --- a/modules/unicornBidAdapter.js +++ b/modules/unicornBidAdapter.js @@ -8,7 +8,7 @@ const BIDDER_CODE = 'unicorn'; const UNICORN_ENDPOINT = 'https://ds.uncn.jp/pb/0/bid.json'; const UNICORN_DEFAULT_CURRENCY = 'JPY'; const UNICORN_PB_COOKIE_KEY = '__pb_unicorn_aud'; -const UNICORN_PB_VERSION = '1.0'; +const UNICORN_PB_VERSION = '1.1'; /** * Placement ID and Account ID are required. @@ -58,11 +58,11 @@ function buildOpenRtbBidRequestPayload(validBidRequests, bidderRequest) { id: bidderRequest.auctionId, at: 1, imp, - cur: UNICORN_DEFAULT_CURRENCY, + cur: [UNICORN_DEFAULT_CURRENCY], site: { id: deepAccess(validBidRequests[0], 'params.mediaId') || '', publisher: { - id: deepAccess(validBidRequests[0], 'params.publisherId') || 0 + id: String(deepAccess(validBidRequests[0], 'params.publisherId') || 0) }, domain: window.location.hostname, page: window.location.href, diff --git a/test/spec/modules/unicornBidAdapter_spec.js b/test/spec/modules/unicornBidAdapter_spec.js index 615eac2ecf2..1ab428d58b6 100644 --- a/test/spec/modules/unicornBidAdapter_spec.js +++ b/test/spec/modules/unicornBidAdapter_spec.js @@ -332,14 +332,14 @@ const openRTBRequest = { tagid: 'rectangle-ad-2' } ], - cur: 'JPY', + cur: ['JPY'], ext: { accountId: 12345 }, site: { id: 'example', publisher: { - id: 99999 + id: '99999' }, domain: 'uni-corn.net', page: 'https://uni-corn.net/', @@ -357,7 +357,7 @@ const openRTBRequest = { ext: { stype: 'prebid_uncn', bidder: 'unicorn', - prebid_version: '1.0' + prebid_version: '1.1' } } }; @@ -444,7 +444,7 @@ const serverResponse = { const request = { method: 'POST', url: 'https://ds.uncn.jp/pb/0/bid.json', - data: '{"id":"5ebea288-f13a-4754-be6d-4ade66c68877","at":1,"imp":[{"id":"216255f234b602","banner":{"w":300,"h":250},"format":[{"w":300,"h":250},{"w":336,"h":280}],"secure":1,"bidfloor":0,"tagid":"/19968336/header-bid-tag-0"},{"id":"31e2b28ced2475","banner":{"w":"300","h":"250"},"format":[{"w":"300","h":"250"}],"secure":1,"bidfloor":0"tagid":"/19968336/header-bid-tag-1"},{"id":"40a333e047a9bd","banner":{"w":300,"h":250},"format":[{"w":300,"h":250}],"secure":1,"bidfloor":0,"tagid":"/19968336/header-bid-tag-2"}],"cur":"JPY","site":{"id":"uni-corn.net","publisher":{"id":12345},"domain":"uni-corn.net","page":"https://uni-corn.net/","ref":"https://uni-corn.net/"},"device":{"language":"ja","ua":"Mozilla/5.0 (Linux; Android 8.0.0; ONEPLUS A5000) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.93 Mobile Safari/537.36"},"user":{"id":"69d9e1c2-801e-4901-a665-fad467550fec"},"bcat":[],"source":{"ext":{"stype":"prebid_uncn","bidder":"unicorn","prebid_version":"1.0"}}}' + data: '{"id":"5ebea288-f13a-4754-be6d-4ade66c68877","at":1,"imp":[{"id":"216255f234b602","banner":{"w":300,"h":250},"format":[{"w":300,"h":250},{"w":336,"h":280}],"secure":1,"bidfloor":0,"tagid":"/19968336/header-bid-tag-0"},{"id":"31e2b28ced2475","banner":{"w":"300","h":"250"},"format":[{"w":"300","h":"250"}],"secure":1,"bidfloor":0"tagid":"/19968336/header-bid-tag-1"},{"id":"40a333e047a9bd","banner":{"w":300,"h":250},"format":[{"w":300,"h":250}],"secure":1,"bidfloor":0,"tagid":"/19968336/header-bid-tag-2"}],"cur":"JPY","site":{"id":"uni-corn.net","publisher":{"id":12345},"domain":"uni-corn.net","page":"https://uni-corn.net/","ref":"https://uni-corn.net/"},"device":{"language":"ja","ua":"Mozilla/5.0 (Linux; Android 8.0.0; ONEPLUS A5000) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.93 Mobile Safari/537.36"},"user":{"id":"69d9e1c2-801e-4901-a665-fad467550fec"},"bcat":[],"source":{"ext":{"stype":"prebid_uncn","bidder":"unicorn","prebid_version":"1.1"}}}' }; const interpretedBids = [