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

Single Result Objects for Public Methods #857

Closed
wants to merge 24 commits into from
Closed

Conversation

sarahkoop
Copy link
Contributor

Summary of changes

  • Update remaining public methods (American Express, Data Collector, Visa Checkout, Google Pay) to return single result objects to callbaks

Checklist

  • Added a changelog entry

Authors

@sarahkoop sarahkoop requested a review from a team as a code owner December 14, 2023 18:57
Copy link
Collaborator

@tdchow tdchow 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! just had a nullability question for one of the fields.

/**
* @param americanExpressResult the [AmericanExpressResult]
*/
fun onAmericanExpressResult(americanExpressResult: AmericanExpressResult?)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Does americanExpressResult need to be nullable? It might be easier to handle a non-null value here and wrap any situations where this result type is null into a Failure.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nope that was just an oversight - they should all be non-null results good catch!

Copy link
Contributor

@hollabaq86 hollabaq86 left a comment

Choose a reason for hiding this comment

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

This is a lot for one PR. There's 21 commits and 46 files changed...

Can we split this up into smaller PRs based on the payment method getting updated?

I know it may seem like more work up front, but it will be easier and faster for me and others to review a PR for each respected namespace (i.e. data collector, visacheckout, amex, etc).

Plus, if we need to revert a change during your major version work, the code is broken into smaller PRs.

@@ -114,6 +122,27 @@ public void getRewardsBalance_callsListenerWithRewardsBalanceWithErrorCode_OnIns
assertEquals("Insufficient points on card", rewardsBalance.getErrorMessage());
}

@Test
public void getRewardsBalance_callsBackFailure_OnHttpError() {
Copy link
Contributor

Choose a reason for hiding this comment

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

love that we're adding this test coverage. Question: do we have testing around analytic events being sent?

deviceData.put(CORRELATION_ID_KEY, correlationId);
}
} catch (JSONException ignored) {
braintreeClient.getConfiguration((configuration, error) -> {
Copy link
Contributor

Choose a reason for hiding this comment

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

does this work need to be in the CHANGELOG?

@sarahkoop
Copy link
Contributor Author

Closing this replaced by #858 #859 #861 #862

@sarahkoop sarahkoop closed this Dec 18, 2023
@jaxdesmarais jaxdesmarais deleted the single_result_objects branch August 1, 2024 12:59
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