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

Add stripe account param to authenticate source #2406

Merged
merged 15 commits into from
Apr 22, 2020

Conversation

smaskell-stripe
Copy link
Contributor

Summary

Motivation

Testing

Tested manually with klarna. Have not yet tested with a card because I'm not sure how to create a card that requires authentication

@@ -42,11 +42,20 @@ class KlarnaSourceActivity : AppCompatActivity() {
viewBinding.progressBar.visibility = View.VISIBLE
createKlarnaSource().observe(this, Observer { result ->
viewBinding.progressBar.visibility = View.INVISIBLE
val stripeAccount = viewBinding.stripeAccount.text
Copy link
Collaborator

Choose a reason for hiding this comment

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

can move this inside is SourceViewModel.SourceResult.Success -> { block

also you can make it a one-liner:

                            stripeAccountId = viewBinding.stripeAccount.text.toString().takeIf {
                                it.isNotBlank()
                            }

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ah I knew there must be a way to do this. Still kinda wish they just had an optional monad but I totally get why they do it this way

@smaskell-stripe
Copy link
Contributor Author

@mshafrir should I test this with the card auth activity as well? How do I get a card that needs authentication?

@smaskell-stripe smaskell-stripe changed the base branch from smaskell/ANDROID-247_confirm_setup to master April 22, 2020 16:49
@smaskell-stripe smaskell-stripe merged commit 094ad6b into master Apr 22, 2020
@smaskell-stripe smaskell-stripe deleted the smaskell/ANDROID-247_authenticate_source branch April 22, 2020 16:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants