-
Notifications
You must be signed in to change notification settings - Fork 284
RowSelectionBehaviorAPI #1978
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
base: master
Are you sure you want to change the base?
RowSelectionBehaviorAPI #1978
Conversation
displayMessage = "An unexpected error occurred", | ||
) | ||
} | ||
@Composable |
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.
Why was also this logic moved to Content
?
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.
We don't have the rowSelectionBehaviorType upon initialization, so by putting the builder in Content we can assure that that data is available and we can pass it to the native Android component
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 do a LaunchedEffect for rowSelectionBehaviorType in Content? Tagging in @tianzhao-stripe as he implemented this on native android, any thoughts here?
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.
Yea, we want to do a launchedEffect for the validation logic, with the key being the rowSelectionBehaviorType so that it doesn't run everytime we have a recomposition
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.
Latest status on this:
For clarification, it is not the validation logic that needs to run after EmbeddedPaymentElementView
is initialized (the validation is done in the javascript layer) but rather setting the rowSelectionBehavior
on the builder. Tian and I worked on this some but haven't reached an acceptable solution. Input from Android engineers on the best way to solve this would be appreciated.
…sibile/accessibility text
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.
nothing blocking (from the iOS/JS side)
const isImmediateAction = | ||
configuration.rowSelectionBehavior?.type === 'immediateAction'; | ||
const isFormSheetConfirm = configuration.formSheetAction?.type === 'confirm'; | ||
const isApplePayEnabled = !!configuration.applePay; | ||
const hasCustomerConfig = !!configuration.customerId; |
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 we not rely on the native code to error out here? I guess Android and iOS error at different times, but seems possible?
* - In the `default` case, the payment method option row enters a selected state. | ||
* - In the `immediateAction` case, `onSelectPaymentOption` is called. | ||
*/ | ||
export type EmbeddedRowSelectionBehavior = |
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.
Just double checking, RowSelectionBehavior was already implemented on the iOS bridge right?
@@ -152,6 +172,7 @@ class EmbeddedPaymentElementView( | |||
is Event.Confirm -> { | |||
embedded.confirm() | |||
} | |||
|
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.
Nit: Unneeded blank line
Summary
rowSelectionBehavior API - adds immediateAction option.
Added new example screen to showcase immediateAction option with modal.
Motivation
The rowSelectionBehavior API provides merchants with more flexibility, especially those who wish to use the Embedded Element as a selection sheet. This API exists on iOS and Android, and this PR brings React Native into alignment with them.
https://jira.corp.stripe.com/browse/MOBILESDK-3619
Testing
Documentation
Select one: