Skip to content

Moves promotions to new endpoint structure #6422

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

Merged
merged 1 commit into from
Aug 18, 2020
Merged

Conversation

NejcZdovc
Copy link
Contributor

@NejcZdovc NejcZdovc commented Aug 14, 2020

Resolves brave/brave-browser#11203

Submitter Checklist:

Test Plan:

Check this paths:

  • claim grant
  • claim tokens via uphold
  • send a tip via VG
  • do AC and monthly contribution via VG
  • do AC and monthly contribution via Uphold
  • restore wallet

Reviewer Checklist:

  • New files have MPL-2.0 license header.
  • Request a security/privacy review as needed.
  • Adequate test coverage exists to prevent regressions
  • Verify test plan is specified in PR before merging to source

After-merge Checklist:

  • The associated issue milestone is set to the smallest version that the
    changes has landed on.
  • All relevant documentation has been updated.

@NejcZdovc NejcZdovc added this to the 1.14.x - Nightly milestone Aug 14, 2020
@NejcZdovc NejcZdovc self-assigned this Aug 14, 2020
@NejcZdovc NejcZdovc force-pushed the promotion-server branch 5 times, most recently from 2af2dda to 0197c8a Compare August 17, 2020 08:26
@NejcZdovc NejcZdovc marked this pull request as ready for review August 17, 2020 12:12
@NejcZdovc NejcZdovc requested a review from zenparsing August 17, 2020 12:12
Copy link
Collaborator

@kylehickinson kylehickinson left a comment

Choose a reason for hiding this comment

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

iOS changes lgtm

ConfirmCallback callback);

std::unique_ptr<endpoint::PromotionServer> promotion_server_;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Just an observation, but I don't think these need to be unique_ptrs - I think you could just have endpoint::PromotionServer.

GetAvailable::~GetAvailable() = default;

std::string GetAvailable::GetUrl(const std::string& platform) {
const std::string payment_id = ledger_->state()->GetPaymentId();
Copy link
Collaborator

Choose a reason for hiding this comment

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

Just an observation: another option would be to take the payment ID as a parameter to Request. That would probably make these classes more testable, since there would be no need to mock out this payment ID in the ledger or ledger client level.

@NejcZdovc NejcZdovc force-pushed the promotion-server branch 2 times, most recently from 5264b09 to cec8ef4 Compare August 17, 2020 18:59
@NejcZdovc NejcZdovc requested a review from zenparsing August 17, 2020 18:59
Copy link
Collaborator

@zenparsing zenparsing left a comment

Choose a reason for hiding this comment

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

Looks good, and was clearly a lot of work. Given the amount of code, I wasn't able to look really closely at every line, but I think I covered most of it.

@NejcZdovc NejcZdovc merged commit 433a7b8 into master Aug 18, 2020
@NejcZdovc NejcZdovc deleted the promotion-server branch August 18, 2020 03:51
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.

[Desktop] Promotion server url handling
3 participants