-
Notifications
You must be signed in to change notification settings - Fork 720
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
AppNexus adapter - Accept placementId as int or string (#2617)
Authored by @gargcreation1992
- Loading branch information
1 parent
0a9a6f5
commit a1f48b5
Showing
8 changed files
with
372 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
151 changes: 151 additions & 0 deletions
151
adapters/appnexus/appnexustest/supplemental/placement-id-as-string-test.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,151 @@ | ||
{ | ||
"mockBidRequest": { | ||
"id": "some-req-id", | ||
"imp": [ | ||
{ | ||
"id": "some-imp-id", | ||
"native": { | ||
"request": "{\"ver\":\"1.1\",\"context\":1,\"contextsubtype\":11,\"plcmttype\":4,\"plcmtcnt\":1,\"assets\":[{\"id\":1,\"required\":1,\"title\":{\"len\":500}},{\"id\":2,\"required\":1,\"img\":{\"type\":3,\"wmin\":1,\"hmin\":1}},{\"id\":3,\"required\":0,\"data\":{\"type\":1,\"len\":200}},{\"id\":4,\"required\":0,\"data\":{\"type\":2,\"len\":15000}},{\"id\":5,\"required\":0,\"data\":{\"type\":6,\"len\":40}},{\"id\":6,\"required\":0,\"data\":{\"type\":500}}]}", | ||
"ver": "1.1" | ||
}, | ||
"ext": { | ||
"bidder": { | ||
"placement_id": "9880618" | ||
} | ||
} | ||
} | ||
], | ||
"site": { | ||
"domain": "prebid.org", | ||
"page": "prebid.org" | ||
}, | ||
"device": { | ||
"ip": "152.193.6.74" | ||
}, | ||
"user": { | ||
"id": "db089de9-a62e-4861-a881-0ff15e052516", | ||
"buyeruid": "8299345306627569435" | ||
}, | ||
"tmax": 500 | ||
}, | ||
"httpcalls": [ | ||
{ | ||
"expectedRequest": { | ||
"uri": "http://ib.adnxs.com/openrtb2", | ||
"body": { | ||
"id": "some-req-id", | ||
"imp": [ | ||
{ | ||
"id": "some-imp-id", | ||
"native": { | ||
"request": "{\"ver\":\"1.1\",\"context\":1,\"contextsubtype\":11,\"plcmttype\":4,\"plcmtcnt\":1,\"assets\":[{\"id\":1,\"required\":1,\"title\":{\"len\":500}},{\"id\":2,\"required\":1,\"img\":{\"type\":3,\"wmin\":1,\"hmin\":1}},{\"id\":3,\"required\":0,\"data\":{\"type\":1,\"len\":200}},{\"id\":4,\"required\":0,\"data\":{\"type\":2,\"len\":15000}},{\"id\":5,\"required\":0,\"data\":{\"type\":6,\"len\":40}},{\"id\":6,\"required\":0,\"data\":{\"type\":500}}]}", | ||
"ver": "1.1" | ||
}, | ||
"ext": { | ||
"appnexus": { | ||
"placement_id": 9880618 | ||
} | ||
} | ||
} | ||
], | ||
"ext": { | ||
"appnexus": { | ||
"hb_source": 5 | ||
}, | ||
"prebid": {} | ||
}, | ||
"site": { | ||
"domain": "prebid.org", | ||
"page": "prebid.org" | ||
}, | ||
"device": { | ||
"ip": "152.193.6.74" | ||
}, | ||
"user": { | ||
"id": "db089de9-a62e-4861-a881-0ff15e052516", | ||
"buyeruid": "8299345306627569435" | ||
}, | ||
"tmax": 500 | ||
} | ||
}, | ||
"mockResponse": { | ||
"status": 200, | ||
"body": { | ||
"id": "some-req-id", | ||
"seatbid": [ | ||
{ | ||
"bid": [ | ||
{ | ||
"id": "928185755156387460", | ||
"impid": "some-imp-id", | ||
"price": 1.000000, | ||
"adid": "69595837", | ||
"adm": "{}", | ||
"adomain": [ | ||
"appnexus.com" | ||
], | ||
"iurl": "http://nym1-ib.adnxs.com/cr?id=69595837", | ||
"cid": "958", | ||
"crid": "69595837", | ||
"cat": [ | ||
"IAB3-1" | ||
], | ||
"ext": { | ||
"appnexus": { | ||
"brand_id": 350, | ||
"brand_category_id": 350, | ||
"auction_id": 5607483846416358664, | ||
"bidder_id": 2, | ||
"bid_ad_type": 3, | ||
"deal_priority": 5 | ||
} | ||
} | ||
} | ||
], | ||
"seat": "958" | ||
} | ||
], | ||
"bidid": "8141327771600527856", | ||
"cur": "USD" | ||
} | ||
} | ||
} | ||
], | ||
"expectedBidResponses": [ | ||
{ | ||
"currency": "USD", | ||
"bids": [ | ||
{ | ||
"bid": { | ||
"id": "928185755156387460", | ||
"impid": "some-imp-id", | ||
"price": 1, | ||
"adm": "{}", | ||
"adid": "69595837", | ||
"adomain": [ | ||
"appnexus.com" | ||
], | ||
"iurl": "http://nym1-ib.adnxs.com/cr?id=69595837", | ||
"cid": "958", | ||
"crid": "69595837", | ||
"cat": [ | ||
"IAB3-1" | ||
], | ||
"ext": { | ||
"appnexus": { | ||
"brand_id": 350, | ||
"brand_category_id": 350, | ||
"auction_id": 5607483846416358664, | ||
"bidder_id": 2, | ||
"bid_ad_type": 3, | ||
"deal_priority": 5 | ||
} | ||
} | ||
}, | ||
"type": "native" | ||
} | ||
] | ||
} | ||
] | ||
} | ||
|
117 changes: 117 additions & 0 deletions
117
adapters/appnexus/appnexustest/supplemental/usePmtRule-test.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,117 @@ | ||
{ | ||
"mockBidRequest": { | ||
"id": "test-request-id", | ||
"imp": [ | ||
{ | ||
"id": "test-imp-id", | ||
"banner": { | ||
"format": [ | ||
{ | ||
"w": 300, | ||
"h": 250 | ||
}, | ||
{ | ||
"w": 300, | ||
"h": 600 | ||
} | ||
] | ||
}, | ||
"ext": { | ||
"bidder": { | ||
"member": "103", | ||
"inv_code": "abc", | ||
"reserve": 20, | ||
"position": "below", | ||
"use_payment_rule": true | ||
} | ||
} | ||
}, | ||
{ | ||
"id": "test-imp-id-2", | ||
"banner": { | ||
"format": [ | ||
{ | ||
"w": 300, | ||
"h": 250 | ||
}, | ||
{ | ||
"w": 300, | ||
"h": 600 | ||
} | ||
] | ||
}, | ||
"ext": { | ||
"bidder": { | ||
"member": "103", | ||
"inv_code": "abc", | ||
"reserve": 20, | ||
"position": "below", | ||
"use_pmt_rule": true, | ||
"use_payment_rule": false | ||
} | ||
} | ||
} | ||
] | ||
}, | ||
|
||
"httpCalls": [ | ||
{ | ||
"expectedRequest": { | ||
"uri": "http://ib.adnxs.com/openrtb2?member_id=103", | ||
"body": { | ||
"id": "test-request-id", | ||
"ext": { | ||
"appnexus": { | ||
"hb_source": 5 | ||
}, | ||
"prebid": {} | ||
}, | ||
"imp": [ | ||
{ | ||
"id":"test-imp-id", | ||
"banner": { | ||
"format": [ | ||
{"w":300,"h":250}, | ||
{"w":300,"h":600} | ||
], | ||
"w": 300, | ||
"h": 250, | ||
"pos": 3 | ||
}, | ||
"tagid": "abc", | ||
"bidfloor": 20, | ||
"ext": { | ||
"appnexus": { | ||
"use_pmt_rule": true | ||
} | ||
} | ||
}, | ||
{ | ||
"id":"test-imp-id-2", | ||
"banner": { | ||
"format": [ | ||
{"w":300,"h":250}, | ||
{"w":300,"h":600} | ||
], | ||
"w": 300, | ||
"h": 250, | ||
"pos": 3 | ||
}, | ||
"tagid": "abc", | ||
"bidfloor": 20, | ||
"ext": { | ||
"appnexus": { | ||
"use_pmt_rule": true | ||
} | ||
} | ||
} | ||
] | ||
} | ||
}, | ||
"mockResponse": { | ||
"status": 204 | ||
} | ||
} | ||
], | ||
"expectedBidResponses": [] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.