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 keys to remember functions in FlowControllerCompose.kt and PaymentSheetCompose.kt #8480

Merged
merged 2 commits into from
May 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,13 @@
## XX.XX.XX - 20XX-XX-XX
* [ADDED][8466](https://github.com/stripe/stripe-android/pull/8466) Added support for [external payment methods](https://docs.stripe.com/payments/external-payment-methods?platform=android).

## 20.43.0 - 2024-05-13

### Financial Connections
* [Changed][8377](https://github.com/stripe/stripe-android/pull/8377) The `FinancialConnectionsEvent.Name.CONSENT_ACQUIRED` event is now emitted when the consent has been acquired _and_ successfully confirmed with the Stripe backend. Previously, the event was emitted before the confirmation, making it possible to receive multiple `CONSENT_ACQUIRED` events in a single session.

### PaymentSheet
* [ADDED][8430](https://github.com/stripe/stripe-android/pull/8430) Added support for using `Maestro` cards with `Google Pay`
* [ADDED][8433](https://github.com/stripe/stripe-android/pull/8433) Added support for Multibanco to PaymentSheet.
* [CHANGED][8340](https://github.com/stripe/stripe-android/pull/8480) Recreate PaymentSheet/FlowController in rememberPaymentSheet functions when an input callback changes.

### Payments
* [ADDED][8433](https://github.com/stripe/stripe-android/pull/8433) Added support for Multibanco to API bindings.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ private fun internalRememberPaymentSheetFlowController(
"PaymentSheet.FlowController must be created in the context of an Activity"
}

return remember {
return remember(paymentOptionCallback, paymentResultCallback) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

From #8466, @jaynewstrom-stripe you suggested including createIntentCallback, externalPaymentMethodConfirmHandler in here as well. Those are updated in their own LaunchedEffects which already should re-run when they change. I don't think we actually need to recreate PaymentSheet + FlowController as well. Lmk if I'm missing something though!

Copy link
Collaborator

Choose a reason for hiding this comment

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

Seems reasonable.

FlowControllerFactory(
viewModelStoreOwner = viewModelStoreOwner,
lifecycleOwner = lifecycleOwner,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ fun rememberPaymentSheet(
"PaymentSheet must be created in the context of an Activity"
}

return remember {
return remember(paymentResultCallback) {
val launcher = DefaultPaymentSheetLauncher(
activityResultLauncher = activityResultLauncher,
activity = activity,
Expand Down
Loading