From d119633153bc2b0a4d4f2bba83dc040cd77fe724 Mon Sep 17 00:00:00 2001 From: Till Hellmund Date: Thu, 9 May 2024 14:05:20 -0400 Subject: [PATCH] Move `consent_acquired` event emission after network call (#8377) * Move `consent_acquired` event emission after network call * Add note to changelog --- CHANGELOG.md | 7 +++++-- .../features/consent/ConsentViewModel.kt | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ef6a6a39ea6..98ee21a4957 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,9 @@ # CHANGELOG -## XX.XX.XX - 2023-XX-XX +## XX.XX.XX - 20XX-XX-XX + +### 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` @@ -28,7 +31,7 @@ Dependencies updated in [8381](https://github.com/stripe/stripe-android/pull/838 ## 20.40.4 - 2024-04-04 ### Financial Connections -[Fixed][8223](https://github.com/stripe/stripe-android/pull/8223) Fixed a crash that occurred when using Compose 1.6. +* [Fixed][8223](https://github.com/stripe/stripe-android/pull/8223) Fixed a crash that occurred when using Compose 1.6. ## 20.40.3 - 2024-04-01 diff --git a/financial-connections/src/main/java/com/stripe/android/financialconnections/features/consent/ConsentViewModel.kt b/financial-connections/src/main/java/com/stripe/android/financialconnections/features/consent/ConsentViewModel.kt index ed9d6111986..247a6733fd7 100644 --- a/financial-connections/src/main/java/com/stripe/android/financialconnections/features/consent/ConsentViewModel.kt +++ b/financial-connections/src/main/java/com/stripe/android/financialconnections/features/consent/ConsentViewModel.kt @@ -93,8 +93,8 @@ internal class ConsentViewModel @AssistedInject constructor( fun onContinueClick() { suspend { eventTracker.track(ConsentAgree) - FinancialConnections.emitEvent(Name.CONSENT_ACQUIRED) val updatedManifest: FinancialConnectionsSessionManifest = acceptConsent() + FinancialConnections.emitEvent(Name.CONSENT_ACQUIRED) navigationManager.tryNavigateTo(updatedManifest.nextPane.destination(referrer = Pane.CONSENT)) updatedManifest }.execute { copy(acceptConsent = it) }