Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrating TrustX adapter to 1.0 #1709

Merged
merged 17 commits into from
Oct 26, 2017
Merged

Migrating TrustX adapter to 1.0 #1709

merged 17 commits into from
Oct 26, 2017

Conversation

PWyrembak
Copy link
Contributor

Type of change

  • Bugfix
  • Feature
  • New bidder adapter
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Other

Description of change

Migrating TrustX adapter to 1.0

Copy link
Collaborator

@jaiminpanchal27 jaiminpanchal27 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@PWyrembak Left some comments.
With your test params, I see a bid response but not able to see an ad.

* @return boolean True if this is a valid bid, and false otherwise.
*/
isBidRequestValid: function(bid) {
return !!(bid.params.uid && bid.adUnitCode);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bid.adUnitCode is not required here to validate bid reqeust. It is part of prebid-core and already tested there.

hasEmptySeatbidArray: 'Response has empty seatbid array',
hasNoArrayOfBids: 'Seatbid from response has no array of bid objects - '
};
const bidsRequestMap = {};
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No global variables. You can create the same in spec.buildRequests scope and add it to request object.
spec.interpretResponse has request object as second argument.

For reference, check rubiconBidAdapter

_responseProcessing(resp, auids, placementMap);
const payload = {
u: utils.getTopWindowUrl(),
pt: window.globalPrebidTrustxPriceType === 'gross' ? 'gross' : 'net',
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can pass window.globalPrebidTrustxPriceType via param. This is not allowed.

}
}
}
// const payloadString = JSON.stringify(payload);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove unwanted code.

@PWyrembak
Copy link
Contributor Author

@jaiminpanchal27 Thanks, we have updated the code and pulled the changes to the repo. Could you please review once more? Re: bid responses @ test params. Are you calling TX bidder in the browser? I should be definitely seeing bid responses coming from the bidder.

Copy link
Collaborator

@jaiminpanchal27 jaiminpanchal27 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes looks good except you need to udpate markdown file.
Also i am not able to validate bids or ad. Using this test page. https://jsfiddle.net/1ajrfpvs/


# Test Parameters
```
window.globalPrebidTrustxPriceType = 'gross'; // by default is 'net'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After update you don't need this in markdown. Update params as required.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure you're calling the right prebid location on the page example you've provided? On the page it is "../../build/dev/prebid.js". So I can't see any calls to TX bidder going at all.

@jaiminpanchal27
Copy link
Collaborator

@PWyrembak
Apologies for this, but #1742 got merged recently.

The first argument to interpretResponse now looks like this:

  body: responseBody,
  headers: {
    get: function(header) { /* returns a header from the HTTP response */ }
  }
}

You'll have to pull master and update the spec so that it looks digs into that object as well now.

@jaiminpanchal27 jaiminpanchal27 removed their assignment Oct 26, 2017
@dbemiller dbemiller merged commit 6a0c5ca into prebid:master Oct 26, 2017
Millerrok pushed a commit to Vertamedia/Prebid.js that referenced this pull request Oct 31, 2017
* 'master' of https://github.com/prebid/Prebid.js: (22 commits)
  Update GetIntent adapter to 1.0 version (prebid#1721)
  Add `usePaymentRule` param to AN bidders (prebid#1778)
  New hooks API (replaces monkey-patching for currency) (prebid#1683)
  Change prebidServer to call client user syncs if they exist (prebid#1734)
  Fix Centro adapter to allow requests of the same units (prebid#1746)
  add vastUrl + media type for video bids Prebid Server (prebid#1739)
  Update adxcg adapter for prebid 1.0 (prebid#1741)
  Update yieldmoBid adapter request url (prebid#1771)
  Upgrade Quantcast adapter for Prebid 1.0 (prebid#1753)
  Fidelity Media Adapter update. Prebid v1.0 (prebid#1719)
  Kargo Adapter for Prebid 1.0 (prebid#1729)
  updated for prebid 1.0 api (prebid#1722)
  Add AdOcean adapter (prebid#1735)
  Update Conversant adapter to Prebid 1.0 (prebid#1711)
  Fix test-coverage bug (prebid#1765)
  Migrating TrustX adapter to 1.0 (prebid#1709)
  Update Improve Digital adapter for Prebid 1.0 (prebid#1728)
  Fixed the argument type on getUserSyncs. (prebid#1767)
  nanointeractive bid adapter (prebid#1627)
  Validating bid response params (prebid#1738)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants