forked from bsm/openrtb
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request bsm#44 from mxmCherry/master
OpenRTB 2.5 Source object added (BidRequest.source)
- Loading branch information
Showing
4 changed files
with
40 additions
and
0 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
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,9 @@ | ||
package openrtb | ||
|
||
// Source object describes the nature and behavior of the entity that is the source of the bid request upstream from the exchange. | ||
type Source struct { | ||
FinalSaleDecision int `json:"fd,omitempty"` // Entity responsible for the final impression sale decision, where 0 = exchange, 1 = upstream source. | ||
TransactionID string `json:"tid,omitempty"` // Transaction ID that must be common across all participants in this bid request (e.g., potentially multiple exchanges). | ||
PaymentChain string `json:"pchain,omitempty"` // Payment ID chain string containing embedded syntax described in the TAG Payment ID Protocol v1.0. | ||
Ext Extension `json:"ext,omitempty"` // Placeholder for exchange-specific extensions to OpenRTB. | ||
} |
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,24 @@ | ||
package openrtb | ||
|
||
import ( | ||
. "github.com/onsi/ginkgo" | ||
. "github.com/onsi/gomega" | ||
) | ||
|
||
var _ = Describe("Source", func() { | ||
var subject *Source | ||
|
||
BeforeEach(func() { | ||
err := fixture("source", &subject) | ||
Expect(err).NotTo(HaveOccurred()) | ||
}) | ||
|
||
It("should parse correctly", func() { | ||
Expect(subject).To(Equal(&Source{ | ||
FinalSaleDecision: 1, | ||
TransactionID: "transaction-id", | ||
PaymentChain: "payment-chain", | ||
Ext: Extension("{}"), | ||
})) | ||
}) | ||
}) |
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,6 @@ | ||
{ | ||
"fd": 1, | ||
"tid": "transaction-id", | ||
"pchain": "payment-chain", | ||
"ext": {} | ||
} |