-
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
Move LinkInlineSignup
to confirmation definitions
#9870
Conversation
private val _processingState = | ||
MutableSharedFlow<ProcessingState>(replay = 1, extraBufferCapacity = 5) | ||
val processingState: Flow<ProcessingState> = _processingState | ||
|
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.
🥳
Diffuse output:
APK
|
paymentsheet/src/main/java/com/stripe/android/paymentsheet/model/PaymentSelection.kt
Outdated
Show resolved
Hide resolved
paymentsheet/src/main/java/com/stripe/android/paymentsheet/LinkInlineHandler.kt
Outdated
Show resolved
Hide resolved
paymentsheet/src/main/java/com/stripe/android/paymentsheet/LinkHandler.kt
Show resolved
Hide resolved
paymentsheet/src/main/java/com/stripe/android/paymentsheet/FormHelper.kt
Outdated
Show resolved
Hide resolved
paymentsheet/src/main/java/com/stripe/android/paymentsheet/PaymentOptionsViewModel.kt
Show resolved
Hide resolved
paymentsheet/src/main/java/com/stripe/android/paymentsheet/PaymentSheetViewModel.kt
Show resolved
Hide resolved
I'm hoping this can be split into two PRs: one for the selection changes and other for just the definition but I don't think it'll be trivial. We would need some connecting code in between both PRs. I fear this PR though would be become too big with all the changes together. |
paymentsheet/src/main/java/com/stripe/android/paymentsheet/LinkHandler.kt
Show resolved
Hide resolved
paymentsheet/src/main/java/com/stripe/android/paymentsheet/FormHelper.kt
Outdated
Show resolved
Hide resolved
paymentsheet/src/main/java/com/stripe/android/paymentsheet/FormHelper.kt
Outdated
Show resolved
Hide resolved
paymentsheet/src/main/java/com/stripe/android/paymentsheet/LinkInlineHandler.kt
Outdated
Show resolved
Hide resolved
...n/java/com/stripe/android/paymentsheet/verticalmode/PaymentMethodVerticalLayoutInteractor.kt
Outdated
Show resolved
Hide resolved
...ipe/android/paymentelement/confirmation/linkinline/LinkInlineSignupConfirmationDefinition.kt
Show resolved
Hide resolved
6aed416
to
7e237c5
Compare
...ipe/android/paymentelement/confirmation/linkinline/LinkInlineSignupConfirmationDefinition.kt
Outdated
Show resolved
Hide resolved
...ipe/android/paymentelement/confirmation/linkinline/LinkInlineSignupConfirmationDefinition.kt
Show resolved
Hide resolved
...ipe/android/paymentelement/confirmation/linkinline/LinkInlineSignupConfirmationDefinition.kt
Show resolved
Hide resolved
.../stripe/android/paymentelement/confirmation/linkinline/LinkInlineSignupConfirmationModule.kt
Show resolved
Hide resolved
paymentsheet/src/main/java/com/stripe/android/paymentsheet/DefaultFormHelper.kt
Outdated
Show resolved
Hide resolved
paymentsheet/src/main/java/com/stripe/android/paymentsheet/model/PaymentSelection.kt
Outdated
Show resolved
Hide resolved
7e237c5
to
d89cdb5
Compare
d89cdb5
to
be28107
Compare
.../stripe/android/paymentelement/confirmation/linkinline/LinkInlineSignupConfirmationOption.kt
Show resolved
Hide resolved
paymentsheet/src/main/java/com/stripe/android/paymentsheet/PaymentSheetViewModel.kt
Show resolved
Hide resolved
@@ -372,16 +349,7 @@ internal class PaymentSheetViewModel @Inject internal constructor( | |||
) { | |||
this.checkoutIdentifier = identifier |
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.
I wonder if we can remove checkoutIdentifier entirely now, and have the UI know when to start it's animation because of when the button is clicked, and know when to stop it based on when processing is false.
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.
checkoutIdentifier
actually isn't used to show and hide processing. That right now is actually entirely managed in the collect
function in the init
block already. This is used to identify if we are processing from a button click of a wallet PM or the primary button click and switching between animations there.
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.
Optionally, we could switch between the animations if we maintain the original confirmation option in the loading state. Then we can always decide in the collect block what animation to use.
...test/java/com/stripe/android/paymentelement/confirmation/ConfirmationHandlerOptionKtxTest.kt
Show resolved
Hide resolved
...stripe/android/paymentelement/confirmation/ExtendedPaymentElementConfirmationTestActivity.kt
Show resolved
Hide resolved
paymentsheet/src/test/java/com/stripe/android/paymentsheet/PaymentSheetViewModelTest.kt
Show resolved
Hide resolved
paymentsheet/src/test/java/com/stripe/android/paymentsheet/analytics/PaymentSheetEventTest.kt
Show resolved
Hide resolved
be28107
to
5729503
Compare
LinkInlineSignup
to confirmation definitions
...tsheet/src/main/java/com/stripe/android/paymentsheet/flowcontroller/DefaultFlowController.kt
Outdated
Show resolved
Hide resolved
...ava/com/stripe/android/paymentelement/confirmation/PaymentElementConfirmationTestActivity.kt
Show resolved
Hide resolved
There is a major behavior change now with how signup is handled in What isn't in this PR is the restoration of the signup details when the user opens the sheet. I am planning on fast-following with that PR. |
1f2eed3
to
ae40994
Compare
paymentsheet/src/androidTest/java/com/stripe/android/paymentsheet/LinkTest.kt
Show resolved
Hide resolved
...heet/src/main/java/com/stripe/android/paymentsheet/flowcontroller/FlowControllerViewModel.kt
Outdated
Show resolved
Hide resolved
ae40994
to
749e238
Compare
749e238
to
dec1c34
Compare
linkAnalyticsHelper.onLinkPopupSkipped() | ||
|
||
return linkInlineSignupConfirmationOption.toNewOption() | ||
} |
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.
Forgot to add this use case from LinkHandler
. We should really just remove SignIn
as a type and only generate a UserInput
if the user has valid sign up values (complete and also unused email). Will be a follow-up task
dec1c34
to
f739a6b
Compare
f739a6b
to
d41d00d
Compare
name = "John Doe", | ||
consentAction = SignUpConsentAction.Checkbox, | ||
), | ||
) |
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.
Had to change these tests to use SignUp
instead of SignIn
since the shouldCompleteLinkInlineFlow
parameter is no longer supported since moving FlowController
sign up out of PaymentOptionsViewModel
.
d41d00d
to
b5ce0c7
Compare
Summary
This PR moves Link Inline Signup into confirmation definitions.
Motivation
This PR is the final element that was duplicated across
FlowController
andPaymentSheet
that is now shared completely throughConfirmationHandler
.Testing