Skip to content

Commit

Permalink
Merge branch 'prebid:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
patrickszeleczki authored Nov 11, 2024
2 parents 4be32f5 + 106f6e4 commit 5e74e5c
Show file tree
Hide file tree
Showing 5 changed files with 287 additions and 2 deletions.
4 changes: 3 additions & 1 deletion adapters/gumgum/gumgum.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,9 @@ func (g *adapter) MakeBids(internalRequest *openrtb2.BidRequest, externalRequest
})
}
}

if bidResp.Cur != "" {
bidResponse.Currency = bidResp.Cur
}
return bidResponse, errs
}

Expand Down
111 changes: 111 additions & 0 deletions adapters/gumgum/gumgumtest/supplemental/convert-currency.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
{
"mockBidRequest": {
"id": "test-request-id",
"imp": [
{
"id": "test-imp-id",
"banner": {
"format": [
{
"w": 300,
"h": 250
},
{
"w": 300,
"h": 300
}
],
"w": 300,
"h": 250
},
"ext": {
"bidder": {
"pubId": 12345678
}
}
}
],
"site": {
"publisher": {
"id": "12345678"
}
}
},

"httpCalls": [
{
"expectedRequest": {
"uri": "https://g2.gumgum.com/providers/prbds2s/bid",
"body":{
"id": "test-request-id",
"imp": [{
"id": "test-imp-id",
"banner": {
"format": [{
"w": 300,
"h": 250
}, {
"w": 300,
"h": 300
}],
"w": 300,
"h": 250
},
"ext": {
"bidder": {
"pubId": 12345678
}
}
}],
"site": {
"publisher": {
"id": "12345678"
}
}
},
"impIDs":["test-imp-id"]
},
"mockResponse": {
"status": 200,
"body": {
"cur": "EUR",
"seatbid": [
{
"bid": [
{
"crid": "2068416",
"adm": "some-test-ad",
"adid": "2068416",
"price": 5,
"id": "5736a50b-6b05-42a8-aa6d-b0a4649dcd05",
"impid": "test-imp-id",
"cid": "4747"
}
]
}
]
}
}
}
],

"expectedBidResponses": [
{
"currency": "EUR",
"bids": [
{
"bid": {
"crid": "2068416",
"adm": "some-test-ad",
"adid": "2068416",
"price": 5,
"id": "5736a50b-6b05-42a8-aa6d-b0a4649dcd05",
"impid": "test-imp-id",
"cid": "4747"
},
"type": "banner"
}
]
}
]
}
12 changes: 12 additions & 0 deletions adapters/pgamssp/pgamssp.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"encoding/json"
"fmt"
"net/http"
"strings"

"github.com/prebid/openrtb/v20/openrtb2"
"github.com/prebid/prebid-server/v3/adapters"
Expand Down Expand Up @@ -39,6 +40,17 @@ func (a *adapter) MakeRequests(request *openrtb2.BidRequest, reqInfo *adapters.E

reqCopy := *request
for _, imp := range request.Imp {

// Check if imp comes with bid floor amount defined in a foreign currency
if imp.BidFloor > 0 && imp.BidFloorCur != "" && strings.ToUpper(imp.BidFloorCur) != "USD" {
// Convert to US dollars
convertedValue, err := reqInfo.ConvertCurrency(imp.BidFloor, imp.BidFloorCur, "USD")
if err == nil {
imp.BidFloorCur = "USD"
imp.BidFloor = convertedValue
}
}

reqCopy.Imp = []openrtb2.Imp{imp}

var bidderExt adapters.ExtImpBidder
Expand Down
154 changes: 154 additions & 0 deletions adapters/pgamssp/pgamssptest/exemplary/convert_currency.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,154 @@
{
"mockBidRequest": {
"id": "test-request-id",
"device": {
"ip": "123.123.123.123",
"ua": "iPad"
},
"app": {
"id": "1",
"bundle": "com.wls.testwlsapplication"
},
"imp": [
{
"id": "test-imp-id",
"tagid": "test",
"bidfloor": 1,
"bidfloorcur": "GBP",
"banner": {
"format": [
{
"w": 300,
"h": 250
},
{
"w": 300,
"h": 600
}
]
},
"ext": {
"bidder": {
"placementId": "test"
}
}
}
],
"ext": {
"prebid": {
"currency": {
"rates": {
"GBP": {
"USD": 0.05
}
}
}
}
}
},
"httpCalls": [
{
"expectedRequest": {
"uri": "http://test.com/pserver",
"body": {
"id": "test-request-id",
"imp": [
{
"id": "test-imp-id",
"tagid": "test",
"bidfloor": 0.05,
"bidfloorcur": "USD",
"banner": {
"format": [
{
"w": 300,
"h": 250
},
{
"w": 300,
"h": 600
}
]
},
"ext": {
"bidder": {
"placementId": "test",
"type": "publisher"
}
}
}
],
"app": {
"id": "1",
"bundle": "com.wls.testwlsapplication"
},
"device": {
"ip": "123.123.123.123",
"ua": "iPad"
},
"ext": {
"prebid": {
"currency": {
"rates": {
"GBP": {
"USD": 0.05
}
}
}
}
}
},
"impIDs": [
"test-imp-id"
]
},
"mockResponse": {
"status": 200,
"body": {
"id": "test-request-id",
"seatbid": [
{
"bid": [
{
"id": "test_bid_id",
"impid": "test-imp-id",
"price": 0.27543,
"adm": "<iframe id=\"adm-banner-16\" width=\"300\" height=\"250\" frameborder=\"0\" marginheight=\"0\" marginwidth=\"0\" style=\"{overflow:hidden}\" src=\"http://test.com/pserver&k=882b2510ed6d6c94fa69c99aa522a708\"></iframe>",
"cid": "test_cid",
"crid": "test_crid",
"dealid": "test_dealid",
"w": 300,
"h": 250,
"mtype": 1
}
],
"seat": "pgamssp"
}
],
"cur": "USD"
}
}
}
],
"expectedBidResponses": [
{
"bids": [
{
"bid": {
"id": "test_bid_id",
"impid": "test-imp-id",
"price": 0.27543,
"adm": "<iframe id=\"adm-banner-16\" width=\"300\" height=\"250\" frameborder=\"0\" marginheight=\"0\" marginwidth=\"0\" style=\"{overflow:hidden}\" src=\"http://test.com/pserver&k=882b2510ed6d6c94fa69c99aa522a708\"></iframe>",
"cid": "test_cid",
"crid": "test_crid",
"dealid": "test_dealid",
"w": 300,
"h": 250,
"mtype": 1
},
"type": "banner"
}
]
}
]
}
8 changes: 7 additions & 1 deletion static/bidder-info/iqzone.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,10 @@ capabilities:
- banner
- video
- native

userSync:
redirect:
url: "https://cs.iqzone.com/pbserver?gdpr={{.GDPR}}&gdpr_consent={{.GDPRConsent}}&ccpa={{.USPrivacy}}&gpp={{.GPP}}&gpp_sid={{.GPPSID}}&redir={{.RedirectURL}}"
userMacro: "[UID]"
iframe:
url: "https://cs.iqzone.com/pbserverIframe?gdpr={{.GDPR}}&gdpr_consent={{.GDPRConsent}}&ccpa={{.USPrivacy}}&gpp={{.GPP}}&gpp_sid={{.GPPSID}}&pbserverUrl={{.RedirectURL}}"
userMacro: "[UID]"

0 comments on commit 5e74e5c

Please sign in to comment.