-
Notifications
You must be signed in to change notification settings - Fork 663
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
Conversation
be443bd
to
b9d869e
Compare
removed checkbox per feedback from iOS team |
example/src/main/java/com/stripe/example/activity/CreateCardTokenActivity.kt
Outdated
Show resolved
Hide resolved
b7ba48f
to
e02c481
Compare
override fun onError(e: Exception) { | ||
viewModel.paymentIntentResultLiveData.value = Result.failure(e) | ||
} | ||
if (stripe.isPaymentResult(requestCode, data)) { |
There was a problem hiding this comment.
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 !!
?
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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)) { |
There was a problem hiding this comment.
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 !!
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
Summary
Add a check box to toggle using regular API and suspend API
Motivation
Demonstrate suspend APIs added in #3557 and #3568
Testing