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

use suspend fun in example app #3607

Merged
merged 8 commits into from
Apr 21, 2021
Merged

use suspend fun in example app #3607

merged 8 commits into from
Apr 21, 2021

Conversation

ccen-stripe
Copy link
Contributor

@ccen-stripe ccen-stripe commented Apr 15, 2021

Summary

Add a check box to toggle using regular API and suspend API

Motivation

Demonstrate suspend APIs added in #3557 and #3568

Testing

  • Added tests
  • Modified tests
  • Manually verified

@ccen-stripe ccen-stripe marked this pull request as ready for review April 15, 2021 20:31
@ccen-stripe
Copy link
Contributor Author

removed checkbox per feedback from iOS team

override fun onError(e: Exception) {
viewModel.paymentIntentResultLiveData.value = Result.failure(e)
}
if (stripe.isPaymentResult(requestCode, data)) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

can you add a null check for data so we don't need to use !!?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

stripe.isPaymentResult already checks nullability within, I think it's worth bring to the client's attention it does that. Added a comment here, wdty?

Copy link
Collaborator

Choose a reason for hiding this comment

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

This is fine, just thinking that there might be some future scenario where isPaymentResult stops checking for data's nullity and this crashes. Or maybe getPaymentIntentResult should just take a Intent??


override fun onError(e: Exception) {
viewModel.paymentIntentResultLiveData.value = Result.failure(e)
if (stripe.isPaymentResult(requestCode, data)) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

can you add a null check for data so we don't need to use !!?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ditto

@ccen-stripe ccen-stripe merged commit 13ac6d4 into master Apr 21, 2021
@ccen-stripe ccen-stripe deleted the suspendFunUsage branch April 21, 2021 20:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants