Skip to content

Commit

Permalink
facebook adapter refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
Aadesh Patel committed Nov 11, 2019
1 parent 5599d8f commit 14a78cf
Show file tree
Hide file tree
Showing 17 changed files with 1,489 additions and 714 deletions.
140 changes: 140 additions & 0 deletions adapters/audienceNetwork/audienceNetworktest/exemplary/banner.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
{
"mockBidRequest": {
"id": "test-req-id",
"imp": [
{
"id": "test-imp-id",
"banner": {
"format": [
{
"w": 300,
"h": 250
}
],
"w": 300,
"h": 250
},
"ext": {
"bidder": {
"publisherid": "123",
"placementid": "456"
}
}
}
],
"site": {
"domain": "prebid.org",
"page": "prebid.org"
},
"device": {
"ip": "152.193.6.74"
},
"user": {
"id": "db089de9-a62e-4861-a881-0ff15e052516",
"buyeruid": "v4_bidder_token"
},
"tmax": 500
},
"httpcalls": [
{
"expectedRequest": {
"uri": "https://an.facebook.com/placementbid.ortb",
"headers": {
"Accept": [
"application/json"
],
"Auth-Token": [
"test-app-id|test-app-secret"
],
"Content-Type": [
"application/json;charset=utf-8"
],
"X-Fb-Pool-Routing-Token": [
"v4_bidder_token"
]
},
"body": {
"id": "test-req-id",
"imp": [
{
"id": "test-imp-id",
"banner": {
"w": -1,
"h": 250
},
"tagid": "123_456"
}
],
"ext": {
"appnexus": {
"hb_source": 5
},
"prebid": {}
},
"site": {
"domain": "prebid.org",
"page": "prebid.org",
"publisher": {
"id": "123"
}
},
"device": {
"ip": "152.193.6.74"
},
"user": {
"id": "db089de9-a62e-4861-a881-0ff15e052516",
"buyeruid": "v4_bidder_token"
},
"tmax": 500,
"ext": {
"platformid": "test-platform-id"
}
}
},
"mockResponse": {
"status": 200,
"body": {
"id": "test-req-id",
"seatbid": [
{
"bid": [
{
"id": "987",
"impid": "test-imp-id",
"price": 1.000000,
"adm": "{\"type\":\"ID\",\"bid_id\":\"987\",\"placement_id\":\"123_456\",\"resolved_placement_id\":\"123_456\",\"sdk_version\":\"5.5.0\",\"device_id\":\"abc\",\"template\":1,\"payload\":null,\"bid_time_token\":\"v4_bidder_token=\"}",
"nurl": "https://www.facebook.com/audiencenetwork/nurl/?partner=test-platform-id&app=def&placement=456&auction=123&impression=123&request=123478&bid=987&ortb_loss_code=0&clearing_price=${AUCTION_PRICE}&app_version=iOS-1.0",
"lurl": "https://www.facebook.com/audiencenetwork/nurl/?partner=test-platform-id&app=def&placement=456&auction=123&impression=123&request=123478&bid=987&ortb_loss_code=${AUCTION_LOSS}&clearing_price=${AUCTION_PRICE}&app_version=iOS-1.0",
"burl": "https://www.facebook.com/audiencenetwork/burl/?partner=test-platform-id&app=def&placement=456&auction=123&impression=123&request=123478&bid=987&clearing_price=${AUCTION_PRICE}"
}
]
}
],
"bidid": "654",
"cur": "USD"
}
}
}
],
"expectedBidResponses": [
{
"currency": "USD",
"bids": [
{
"bid": {
"id": "987",
"impid": "test-imp-id",
"price": 1,
"adm": "{\"type\":\"ID\",\"bid_id\":\"987\",\"placement_id\":\"123_456\",\"resolved_placement_id\":\"123_456\",\"sdk_version\":\"5.5.0\",\"device_id\":\"abc\",\"template\":1,\"payload\":null,\"bid_time_token\":\"v4_bidder_token=\"}",
"adid": "987",
"crid": "987",
"nurl": "https://www.facebook.com/audiencenetwork/nurl/?partner=test-platform-id&app=def&placement=456&auction=123&impression=123&request=123478&bid=987&ortb_loss_code=0&clearing_price=${AUCTION_PRICE}&app_version=iOS-1.0",
"lurl": "https://www.facebook.com/audiencenetwork/nurl/?partner=test-platform-id&app=def&placement=456&auction=123&impression=123&request=123478&bid=987&ortb_loss_code=${AUCTION_LOSS}&clearing_price=${AUCTION_PRICE}&app_version=iOS-1.0",
"burl": "https://www.facebook.com/audiencenetwork/burl/?partner=test-platform-id&app=def&placement=456&auction=123&impression=123&request=123478&bid=987&clearing_price=${AUCTION_PRICE}"
},
"type": "banner"
}
]
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
{
"mockBidRequest": {
"id": "test-req-id",
"imp": [
{
"id": "test-imp-id",
"banner": {
"format": [
{
"w": 1,
"h": 1
}
],
"w": 1,
"h": 1
},
"instl": 1,
"ext": {
"bidder": {
"publisherid": "123",
"placementid": "456"
}
}
}
],
"site": {
"domain": "prebid.org",
"page": "prebid.org"
},
"device": {
"ip": "152.193.6.74"
},
"user": {
"id": "db089de9-a62e-4861-a881-0ff15e052516",
"buyeruid": "v4_bidder_token"
},
"tmax": 500
},
"httpcalls": [
{
"expectedRequest": {
"uri": "https://an.facebook.com/placementbid.ortb",
"headers": {
"Accept": [
"application/json"
],
"Auth-Token": [
"test-app-id|test-app-secret"
],
"Content-Type": [
"application/json;charset=utf-8"
],
"X-Fb-Pool-Routing-Token": [
"v4_bidder_token"
]
},
"body": {
"id": "test-req-id",
"imp": [
{
"id": "test-imp-id",
"banner": {
"w": 0,
"h": 0
},
"instl": 1,
"tagid": "123_456"
}
],
"ext": {
"appnexus": {
"hb_source": 5
},
"prebid": {}
},
"site": {
"domain": "prebid.org",
"page": "prebid.org",
"publisher": {
"id": "123"
}
},
"device": {
"ip": "152.193.6.74"
},
"user": {
"id": "db089de9-a62e-4861-a881-0ff15e052516",
"buyeruid": "v4_bidder_token"
},
"tmax": 500,
"ext": {
"platformid": "test-platform-id"
}
}
},
"mockResponse": {
"status": 200,
"body": {
"id": "test-req-id",
"seatbid": [
{
"bid": [
{
"id": "987",
"impid": "test-imp-id",
"price": 1.000000,
"adm": "{\"type\":\"ID\",\"bid_id\":\"987\",\"placement_id\":\"123_456\",\"resolved_placement_id\":\"123_456\",\"sdk_version\":\"5.5.0\",\"device_id\":\"abc\",\"template\":1,\"payload\":null,\"bid_time_token\":\"v4_bidder_token=\"}",
"nurl": "https://www.facebook.com/audiencenetwork/nurl/?partner=test-platform-id&app=def&placement=456&auction=123&impression=123&request=123478&bid=987&ortb_loss_code=0&clearing_price=${AUCTION_PRICE}&app_version=iOS-1.0",
"lurl": "https://www.facebook.com/audiencenetwork/nurl/?partner=test-platform-id&app=def&placement=456&auction=123&impression=123&request=123478&bid=987&ortb_loss_code=${AUCTION_LOSS}&clearing_price=${AUCTION_PRICE}&app_version=iOS-1.0",
"burl": "https://www.facebook.com/audiencenetwork/burl/?partner=test-platform-id&app=def&placement=456&auction=123&impression=123&request=123478&bid=987&clearing_price=${AUCTION_PRICE}"
}
]
}
],
"bidid": "654",
"cur": "USD"
}
}
}
],
"expectedBidResponses": [
{
"currency": "USD",
"bids": [
{
"bid": {
"id": "987",
"impid": "test-imp-id",
"price": 1,
"adm": "{\"type\":\"ID\",\"bid_id\":\"987\",\"placement_id\":\"123_456\",\"resolved_placement_id\":\"123_456\",\"sdk_version\":\"5.5.0\",\"device_id\":\"abc\",\"template\":1,\"payload\":null,\"bid_time_token\":\"v4_bidder_token=\"}",
"adid": "987",
"crid": "987",
"nurl": "https://www.facebook.com/audiencenetwork/nurl/?partner=test-platform-id&app=def&placement=456&auction=123&impression=123&request=123478&bid=987&ortb_loss_code=0&clearing_price=${AUCTION_PRICE}&app_version=iOS-1.0",
"lurl": "https://www.facebook.com/audiencenetwork/nurl/?partner=test-platform-id&app=def&placement=456&auction=123&impression=123&request=123478&bid=987&ortb_loss_code=${AUCTION_LOSS}&clearing_price=${AUCTION_PRICE}&app_version=iOS-1.0",
"burl": "https://www.facebook.com/audiencenetwork/burl/?partner=test-platform-id&app=def&placement=456&auction=123&impression=123&request=123478&bid=987&clearing_price=${AUCTION_PRICE}"
},
"type": "banner"
}
]
}
]
}
Loading

0 comments on commit 14a78cf

Please sign in to comment.