From b42ba1e06776c6cfb588b6c461963e4d5c5c001f Mon Sep 17 00:00:00 2001 From: Carlos Munoz Date: Mon, 25 Apr 2022 10:43:41 -0700 Subject: [PATCH 01/12] Renames LinkAccountSession to FinancialConnectionsSession. --- .../FinancialConnectionsExampleViewModel.kt | 2 +- .../FinancialConnectionsSheetContract.kt | 6 +- ...FinancialConnectionsSheetForTokenResult.kt | 6 +- .../FinancialConnectionsSheetResult.kt | 6 +- .../FinancialConnectionsSheetState.kt | 4 +- .../FinancialConnectionsSheetViewModel.kt | 12 +-- .../domain/FetchLinkAccountSession.kt | 6 +- .../domain/FetchLinkAccountSessionForToken.kt | 8 +- .../GenerateLinkAccountSessionManifest.kt | 6 +- ...efaultFinancialConnectionsSheetLauncher.kt | 2 +- ...nancialConnectionsSheetForTokenLauncher.kt | 2 +- ...sion.kt => FinancialConnectionsSession.kt} | 2 +- ...=> FinancialConnectionsSessionManifest.kt} | 2 +- .../FinancialConnectionsRepository.kt | 8 +- ...ancialFinancialConnectionsApiRepository.kt | 12 +-- .../financialconnections/ApiKeyFixtures.kt | 4 +- ...lFinancialConnectionsSheetViewModelTest.kt | 8 +- .../DefaultConnectionsEventReportTest.kt | 6 +- ...inancialConnectionsSessionForTokenTest.kt} | 12 +-- ...> FetchFinancialConnectionsSessionTest.kt} | 34 ++++---- ...ltFinancialConnectionsSheetLauncherTest.kt | 6 +- ...ialConnectionsSheetForTokenLauncherTest.kt | 6 +- .../FakeFinancialConnectionsRepository.kt | 16 ++-- .../financialconnections/testmodels.kt | 6 +- ...reateFinancialConnectionsSessionParams.kt} | 2 +- ...sion.kt => FinancialConnectionsSession.kt} | 2 +- ... FinancialConnectionsSessionJsonParser.kt} | 10 +-- .../android/networking/StripeApiRepository.kt | 60 +++++++------- .../android/networking/StripeRepository.kt | 24 +++--- ...t => AttachFinancialConnectionsSession.kt} | 10 +-- ...t => CreateFinancialConnectionsSession.kt} | 22 ++--- .../navigation/CollectBankAccountResult.kt | 4 +- .../ui/CollectBankAccountViewModel.kt | 38 ++++----- .../FinancialConnectionsPaymentsProxy.kt | 8 +- .../networking/AbsFakeStripeRepository.kt | 24 +++--- .../networking/StripeApiRepositoryTest.kt | 20 ++--- ... AttachFinancialConnectionsSessionTest.kt} | 48 +++++------ ... CreateFinancialConnectionsSessionTest.kt} | 80 +++++++++---------- .../ui/CollectBankAccountViewModelTest.kt | 74 ++++++++--------- .../FinancialConnectionsPaymentsProxyTest.kt | 2 +- 40 files changed, 305 insertions(+), 305 deletions(-) rename financial-connections/src/main/java/com/stripe/android/financialconnections/model/{LinkAccountSession.kt => FinancialConnectionsSession.kt} (95%) rename financial-connections/src/main/java/com/stripe/android/financialconnections/model/{LinkAccountSessionManifest.kt => FinancialConnectionsSessionManifest.kt} (87%) rename financial-connections/src/test/java/com/stripe/android/financialconnections/domain/{FetchLinkAccountSessionForTokenTest.kt => FetchFinancialConnectionsSessionForTokenTest.kt} (81%) rename financial-connections/src/test/java/com/stripe/android/financialconnections/domain/{FetchLinkAccountSessionTest.kt => FetchFinancialConnectionsSessionTest.kt} (69%) rename payments-core/src/main/java/com/stripe/android/model/{CreateLinkAccountSessionParams.kt => CreateFinancialConnectionsSessionParams.kt} (92%) rename payments-core/src/main/java/com/stripe/android/model/{BankConnectionsLinkedAccountSession.kt => FinancialConnectionsSession.kt} (77%) rename payments-core/src/main/java/com/stripe/android/model/parsers/{BankConnectionsLinkAccountSessionJsonParser.kt => FinancialConnectionsSessionJsonParser.kt} (60%) rename payments-core/src/main/java/com/stripe/android/payments/bankaccount/domain/{AttachLinkAccountSession.kt => AttachFinancialConnectionsSession.kt} (83%) rename payments-core/src/main/java/com/stripe/android/payments/bankaccount/domain/{CreateLinkAccountSession.kt => CreateFinancialConnectionsSession.kt} (66%) rename payments-core/src/test/java/com/stripe/android/payments/bankaccount/domain/{AttachLinkAccountSessionTest.kt => AttachFinancialConnectionsSessionTest.kt} (78%) rename payments-core/src/test/java/com/stripe/android/payments/bankaccount/domain/{CreateLinkAccountSessionTest.kt => CreateFinancialConnectionsSessionTest.kt} (74%) diff --git a/financial-connections-example/src/main/java/com/stripe/android/financialconnections/example/FinancialConnectionsExampleViewModel.kt b/financial-connections-example/src/main/java/com/stripe/android/financialconnections/example/FinancialConnectionsExampleViewModel.kt index 279ab124e60..8a493138fdb 100644 --- a/financial-connections-example/src/main/java/com/stripe/android/financialconnections/example/FinancialConnectionsExampleViewModel.kt +++ b/financial-connections-example/src/main/java/com/stripe/android/financialconnections/example/FinancialConnectionsExampleViewModel.kt @@ -66,7 +66,7 @@ class FinancialConnectionsExampleViewModel : ViewModel() { fun onFinancialConnectionsSheetResult(result: FinancialConnectionsSheetResult) { val statusText = when (result) { is Completed -> { - val linkedAccountList = result.linkAccountSession.linkedAccounts + val linkedAccountList = result.financialConnectionsSession.linkedAccounts linkedAccountList.linkedAccounts.joinToString("\n") { "${it.institutionName} - ${it.displayName} - ${it.last4} - ${it.category}/${it.subcategory}" } diff --git a/financial-connections/src/main/java/com/stripe/android/financialconnections/FinancialConnectionsSheetContract.kt b/financial-connections/src/main/java/com/stripe/android/financialconnections/FinancialConnectionsSheetContract.kt index 91ca844a170..279e313d7fd 100644 --- a/financial-connections/src/main/java/com/stripe/android/financialconnections/FinancialConnectionsSheetContract.kt +++ b/financial-connections/src/main/java/com/stripe/android/financialconnections/FinancialConnectionsSheetContract.kt @@ -6,7 +6,7 @@ import android.os.Bundle import android.os.Parcelable import androidx.activity.result.contract.ActivityResultContract import androidx.core.os.bundleOf -import com.stripe.android.financialconnections.model.LinkAccountSession +import com.stripe.android.financialconnections.model.FinancialConnectionsSession import com.stripe.android.model.Token import kotlinx.parcelize.Parcelize import java.security.InvalidParameterException @@ -70,11 +70,11 @@ internal class FinancialConnectionsSheetContract : internal sealed class Result : Parcelable { /** * The customer completed the connections session. - * @param linkAccountSession The link account session connected + * @param financialConnectionsSession The link account session connected */ @Parcelize data class Completed( - val linkAccountSession: LinkAccountSession, + val financialConnectionsSession: FinancialConnectionsSession, val token: Token? = null ) : Result() diff --git a/financial-connections/src/main/java/com/stripe/android/financialconnections/FinancialConnectionsSheetForTokenResult.kt b/financial-connections/src/main/java/com/stripe/android/financialconnections/FinancialConnectionsSheetForTokenResult.kt index fc83a407213..91a457934f7 100644 --- a/financial-connections/src/main/java/com/stripe/android/financialconnections/FinancialConnectionsSheetForTokenResult.kt +++ b/financial-connections/src/main/java/com/stripe/android/financialconnections/FinancialConnectionsSheetForTokenResult.kt @@ -1,7 +1,7 @@ package com.stripe.android.connections import android.os.Parcelable -import com.stripe.android.financialconnections.model.LinkAccountSession +import com.stripe.android.financialconnections.model.FinancialConnectionsSession import com.stripe.android.model.Token import kotlinx.parcelize.Parcelize @@ -11,11 +11,11 @@ import kotlinx.parcelize.Parcelize sealed class FinancialConnectionsSheetForTokenResult : Parcelable { /** * The customer completed the connections session. - * @param linkAccountSession The link account session connected + * @param financialConnectionsSession The link account session connected */ @Parcelize data class Completed( - val linkAccountSession: LinkAccountSession, + val financialConnectionsSession: FinancialConnectionsSession, val token: Token ) : FinancialConnectionsSheetForTokenResult() diff --git a/financial-connections/src/main/java/com/stripe/android/financialconnections/FinancialConnectionsSheetResult.kt b/financial-connections/src/main/java/com/stripe/android/financialconnections/FinancialConnectionsSheetResult.kt index 7b85dc320a6..e3760255a7f 100644 --- a/financial-connections/src/main/java/com/stripe/android/financialconnections/FinancialConnectionsSheetResult.kt +++ b/financial-connections/src/main/java/com/stripe/android/financialconnections/FinancialConnectionsSheetResult.kt @@ -1,7 +1,7 @@ package com.stripe.android.financialconnections import android.os.Parcelable -import com.stripe.android.financialconnections.model.LinkAccountSession +import com.stripe.android.financialconnections.model.FinancialConnectionsSession import kotlinx.parcelize.Parcelize /** @@ -10,11 +10,11 @@ import kotlinx.parcelize.Parcelize sealed class FinancialConnectionsSheetResult : Parcelable { /** * The customer completed the connections session. - * @param linkAccountSession The link account session connected + * @param financialConnectionsSession The link account session connected */ @Parcelize data class Completed( - val linkAccountSession: LinkAccountSession + val financialConnectionsSession: FinancialConnectionsSession ) : FinancialConnectionsSheetResult() /** diff --git a/financial-connections/src/main/java/com/stripe/android/financialconnections/FinancialConnectionsSheetState.kt b/financial-connections/src/main/java/com/stripe/android/financialconnections/FinancialConnectionsSheetState.kt index 61731cfdd5d..1609b5b9101 100644 --- a/financial-connections/src/main/java/com/stripe/android/financialconnections/FinancialConnectionsSheetState.kt +++ b/financial-connections/src/main/java/com/stripe/android/financialconnections/FinancialConnectionsSheetState.kt @@ -1,14 +1,14 @@ package com.stripe.android.financialconnections import androidx.lifecycle.SavedStateHandle -import com.stripe.android.financialconnections.model.LinkAccountSessionManifest +import com.stripe.android.financialconnections.model.FinancialConnectionsSessionManifest /** * Class containing all of the data needed to represent the screen. */ internal data class FinancialConnectionsSheetState( val activityRecreated: Boolean = false, - val manifest: LinkAccountSessionManifest? = null, + val manifest: FinancialConnectionsSessionManifest? = null, val authFlowActive: Boolean = false ) { diff --git a/financial-connections/src/main/java/com/stripe/android/financialconnections/FinancialConnectionsSheetViewModel.kt b/financial-connections/src/main/java/com/stripe/android/financialconnections/FinancialConnectionsSheetViewModel.kt index 83e088b0772..7702aaa8968 100644 --- a/financial-connections/src/main/java/com/stripe/android/financialconnections/FinancialConnectionsSheetViewModel.kt +++ b/financial-connections/src/main/java/com/stripe/android/financialconnections/FinancialConnectionsSheetViewModel.kt @@ -19,8 +19,8 @@ import com.stripe.android.financialconnections.di.APPLICATION_ID import com.stripe.android.financialconnections.di.DaggerFinancialConnectionsSheetComponent import com.stripe.android.financialconnections.domain.FetchLinkAccountSession import com.stripe.android.financialconnections.domain.GenerateLinkAccountSessionManifest -import com.stripe.android.financialconnections.model.LinkAccountSession -import com.stripe.android.financialconnections.model.LinkAccountSessionManifest +import com.stripe.android.financialconnections.model.FinancialConnectionsSession +import com.stripe.android.financialconnections.model.FinancialConnectionsSessionManifest import kotlinx.coroutines.flow.MutableSharedFlow import kotlinx.coroutines.flow.MutableStateFlow import kotlinx.coroutines.flow.SharedFlow @@ -57,7 +57,7 @@ internal class FinancialConnectionsSheetViewModel @Inject constructor( } /** - * Fetches the [LinkAccountSessionManifest] from the Stripe API to get the hosted auth flow URL + * Fetches the [FinancialConnectionsSessionManifest] from the Stripe API to get the hosted auth flow URL * as well as the success and cancel callback URLs to verify. */ private fun fetchManifest() { @@ -81,7 +81,7 @@ internal class FinancialConnectionsSheetViewModel @Inject constructor( * @param manifest the manifest containing the hosted auth flow URL to launch * */ - private suspend fun openAuthFlow(manifest: LinkAccountSessionManifest) { + private suspend fun openAuthFlow(manifest: FinancialConnectionsSessionManifest) { // stores manifest in state for future references. _state.updateAndPersist { it.copy( @@ -142,7 +142,7 @@ internal class FinancialConnectionsSheetViewModel @Inject constructor( * For regular connections flows requesting a link account session: * * On successfully completing the hosted auth flow and receiving the success callback intent, - * fetch the updated [LinkAccountSession] model from the API + * fetch the updated [FinancialConnectionsSession] model from the API * and return it back as a [Completed] result. */ private fun fetchLinkAccountSession() { @@ -163,7 +163,7 @@ internal class FinancialConnectionsSheetViewModel @Inject constructor( * For connections flows requesting an account [com.stripe.android.model.Token]: * * On successfully completing the hosted auth flow and receiving the success callback intent, - * fetch the updated [LinkAccountSession] and the generated [com.stripe.android.model.Token] + * fetch the updated [FinancialConnectionsSession] and the generated [com.stripe.android.model.Token] * and return it back as a [Completed] result. */ private fun fetchLinkAccountSessionForToken() { diff --git a/financial-connections/src/main/java/com/stripe/android/financialconnections/domain/FetchLinkAccountSession.kt b/financial-connections/src/main/java/com/stripe/android/financialconnections/domain/FetchLinkAccountSession.kt index 76d7d3f532c..be55d83749a 100644 --- a/financial-connections/src/main/java/com/stripe/android/financialconnections/domain/FetchLinkAccountSession.kt +++ b/financial-connections/src/main/java/com/stripe/android/financialconnections/domain/FetchLinkAccountSession.kt @@ -1,7 +1,7 @@ package com.stripe.android.financialconnections.domain import com.stripe.android.financialconnections.FinancialConnectionsSheetViewModel -import com.stripe.android.financialconnections.model.LinkAccountSession +import com.stripe.android.financialconnections.model.FinancialConnectionsSession import com.stripe.android.financialconnections.model.LinkedAccount import com.stripe.android.financialconnections.model.LinkedAccountList import com.stripe.android.financialconnections.model.ListLinkedAccountParams @@ -19,7 +19,7 @@ internal class FetchLinkAccountSession @Inject constructor( * * @return LinkAccountSession with all linked accounts */ - suspend operator fun invoke(clientSecret: String): LinkAccountSession { + suspend operator fun invoke(clientSecret: String): FinancialConnectionsSession { val linkAccountSession = financialConnectionsRepository.getLinkAccountSession(clientSecret) if (linkAccountSession.linkedAccounts.hasMore) { val accounts = mutableListOf() @@ -37,7 +37,7 @@ internal class FetchLinkAccountSession @Inject constructor( accounts.addAll(nextLinkedAccountList.linkedAccounts) } - return LinkAccountSession( + return FinancialConnectionsSession( id = linkAccountSession.id, clientSecret = linkAccountSession.clientSecret, linkedAccounts = LinkedAccountList( diff --git a/financial-connections/src/main/java/com/stripe/android/financialconnections/domain/FetchLinkAccountSessionForToken.kt b/financial-connections/src/main/java/com/stripe/android/financialconnections/domain/FetchLinkAccountSessionForToken.kt index d9f7d883256..9c6c030f106 100644 --- a/financial-connections/src/main/java/com/stripe/android/financialconnections/domain/FetchLinkAccountSessionForToken.kt +++ b/financial-connections/src/main/java/com/stripe/android/financialconnections/domain/FetchLinkAccountSessionForToken.kt @@ -1,6 +1,6 @@ package com.stripe.android.connections.domain -import com.stripe.android.financialconnections.model.LinkAccountSession +import com.stripe.android.financialconnections.model.FinancialConnectionsSession import com.stripe.android.financialconnections.repository.FinancialConnectionsRepository import com.stripe.android.model.Token import com.stripe.android.model.parsers.TokenJsonParser @@ -12,13 +12,13 @@ internal class FetchLinkAccountSessionForToken @Inject constructor( ) { /** - * Fetches the [LinkAccountSession] and its nested [Token]. + * Fetches the [FinancialConnectionsSession] and its nested [Token]. * * @param clientSecret the link account session client secret * - * @return pair of [LinkAccountSession] and [Token] + * @return pair of [FinancialConnectionsSession] and [Token] */ - suspend operator fun invoke(clientSecret: String): Pair { + suspend operator fun invoke(clientSecret: String): Pair { val linkAccountSession = connectionsRepository.getLinkAccountSession(clientSecret) val parsedToken = linkAccountSession.bankAccountToken?.let { TokenJsonParser().parse(JSONObject(it)) } diff --git a/financial-connections/src/main/java/com/stripe/android/financialconnections/domain/GenerateLinkAccountSessionManifest.kt b/financial-connections/src/main/java/com/stripe/android/financialconnections/domain/GenerateLinkAccountSessionManifest.kt index 861c3689139..b32e08c7eb7 100644 --- a/financial-connections/src/main/java/com/stripe/android/financialconnections/domain/GenerateLinkAccountSessionManifest.kt +++ b/financial-connections/src/main/java/com/stripe/android/financialconnections/domain/GenerateLinkAccountSessionManifest.kt @@ -1,11 +1,11 @@ package com.stripe.android.financialconnections.domain -import com.stripe.android.financialconnections.model.LinkAccountSessionManifest +import com.stripe.android.financialconnections.model.FinancialConnectionsSessionManifest import com.stripe.android.financialconnections.repository.FinancialConnectionsRepository import javax.inject.Inject /** - * Fetches the [LinkAccountSessionManifest] from the Stripe API to get the hosted auth flow URL + * Fetches the [FinancialConnectionsSessionManifest] from the Stripe API to get the hosted auth flow URL * as well as the success and cancel callback URLs to verify. */ internal class GenerateLinkAccountSessionManifest @Inject constructor( @@ -15,7 +15,7 @@ internal class GenerateLinkAccountSessionManifest @Inject constructor( suspend operator fun invoke( clientSecret: String, applicationId: String - ): LinkAccountSessionManifest { + ): FinancialConnectionsSessionManifest { return financialConnectionsRepository.generateLinkAccountSessionManifest( clientSecret = clientSecret, applicationId = applicationId diff --git a/financial-connections/src/main/java/com/stripe/android/financialconnections/launcher/DefaultFinancialConnectionsSheetLauncher.kt b/financial-connections/src/main/java/com/stripe/android/financialconnections/launcher/DefaultFinancialConnectionsSheetLauncher.kt index 8ec6460a01e..69ed7332b5d 100644 --- a/financial-connections/src/main/java/com/stripe/android/financialconnections/launcher/DefaultFinancialConnectionsSheetLauncher.kt +++ b/financial-connections/src/main/java/com/stripe/android/financialconnections/launcher/DefaultFinancialConnectionsSheetLauncher.kt @@ -64,6 +64,6 @@ private fun FinancialConnectionsSheetContract.Result.toExposedResult(): Financia is FinancialConnectionsSheetContract.Result.Canceled -> FinancialConnectionsSheetResult.Canceled is FinancialConnectionsSheetContract.Result.Failed -> FinancialConnectionsSheetResult.Failed(error) is FinancialConnectionsSheetContract.Result.Completed -> FinancialConnectionsSheetResult.Completed( - linkAccountSession = linkAccountSession, + financialConnectionsSession = financialConnectionsSession, ) } diff --git a/financial-connections/src/main/java/com/stripe/android/financialconnections/launcher/FinancialConnectionsSheetForTokenLauncher.kt b/financial-connections/src/main/java/com/stripe/android/financialconnections/launcher/FinancialConnectionsSheetForTokenLauncher.kt index ad2f830cabe..95864913bf6 100644 --- a/financial-connections/src/main/java/com/stripe/android/financialconnections/launcher/FinancialConnectionsSheetForTokenLauncher.kt +++ b/financial-connections/src/main/java/com/stripe/android/financialconnections/launcher/FinancialConnectionsSheetForTokenLauncher.kt @@ -66,7 +66,7 @@ private fun Result.toExposedResult(): FinancialConnectionsSheetForTokenResult = is Canceled -> FinancialConnectionsSheetForTokenResult.Canceled is Failed -> FinancialConnectionsSheetForTokenResult.Failed(error) is Completed -> FinancialConnectionsSheetForTokenResult.Completed( - linkAccountSession = linkAccountSession, + financialConnectionsSession = financialConnectionsSession, token = requireNotNull(token) ) } diff --git a/financial-connections/src/main/java/com/stripe/android/financialconnections/model/LinkAccountSession.kt b/financial-connections/src/main/java/com/stripe/android/financialconnections/model/FinancialConnectionsSession.kt similarity index 95% rename from financial-connections/src/main/java/com/stripe/android/financialconnections/model/LinkAccountSession.kt rename to financial-connections/src/main/java/com/stripe/android/financialconnections/model/FinancialConnectionsSession.kt index 12d0a7f6aa2..83fd186083d 100644 --- a/financial-connections/src/main/java/com/stripe/android/financialconnections/model/LinkAccountSession.kt +++ b/financial-connections/src/main/java/com/stripe/android/financialconnections/model/FinancialConnectionsSession.kt @@ -21,7 +21,7 @@ import kotlinx.serialization.Serializable */ @Parcelize @Serializable -data class LinkAccountSession internal constructor( +data class FinancialConnectionsSession internal constructor( @SerialName("client_secret") val clientSecret: String, diff --git a/financial-connections/src/main/java/com/stripe/android/financialconnections/model/LinkAccountSessionManifest.kt b/financial-connections/src/main/java/com/stripe/android/financialconnections/model/FinancialConnectionsSessionManifest.kt similarity index 87% rename from financial-connections/src/main/java/com/stripe/android/financialconnections/model/LinkAccountSessionManifest.kt rename to financial-connections/src/main/java/com/stripe/android/financialconnections/model/FinancialConnectionsSessionManifest.kt index a4bb36563f8..ba2f913e755 100644 --- a/financial-connections/src/main/java/com/stripe/android/financialconnections/model/LinkAccountSessionManifest.kt +++ b/financial-connections/src/main/java/com/stripe/android/financialconnections/model/FinancialConnectionsSessionManifest.kt @@ -7,7 +7,7 @@ import kotlinx.serialization.Serializable @Serializable @Parcelize -internal data class LinkAccountSessionManifest( +internal data class FinancialConnectionsSessionManifest( @SerialName("hosted_auth_url") val hostedAuthUrl: String, @SerialName("success_url") val successUrl: String, @SerialName("cancel_url") val cancelUrl: String diff --git a/financial-connections/src/main/java/com/stripe/android/financialconnections/repository/FinancialConnectionsRepository.kt b/financial-connections/src/main/java/com/stripe/android/financialconnections/repository/FinancialConnectionsRepository.kt index 1411bc69cdb..87549ee1ba3 100644 --- a/financial-connections/src/main/java/com/stripe/android/financialconnections/repository/FinancialConnectionsRepository.kt +++ b/financial-connections/src/main/java/com/stripe/android/financialconnections/repository/FinancialConnectionsRepository.kt @@ -4,8 +4,8 @@ import com.stripe.android.core.exception.APIConnectionException import com.stripe.android.core.exception.APIException import com.stripe.android.core.exception.AuthenticationException import com.stripe.android.core.exception.InvalidRequestException -import com.stripe.android.financialconnections.model.LinkAccountSession -import com.stripe.android.financialconnections.model.LinkAccountSessionManifest +import com.stripe.android.financialconnections.model.FinancialConnectionsSession +import com.stripe.android.financialconnections.model.FinancialConnectionsSessionManifest import com.stripe.android.financialconnections.model.LinkedAccountList import com.stripe.android.financialconnections.model.ListLinkedAccountParams @@ -28,7 +28,7 @@ internal interface FinancialConnectionsRepository { ) suspend fun getLinkAccountSession( clientSecret: String - ): LinkAccountSession + ): FinancialConnectionsSession @Throws( AuthenticationException::class, @@ -39,5 +39,5 @@ internal interface FinancialConnectionsRepository { suspend fun generateLinkAccountSessionManifest( clientSecret: String, applicationId: String - ): LinkAccountSessionManifest + ): FinancialConnectionsSessionManifest } diff --git a/financial-connections/src/main/java/com/stripe/android/financialconnections/repository/FinancialFinancialConnectionsApiRepository.kt b/financial-connections/src/main/java/com/stripe/android/financialconnections/repository/FinancialFinancialConnectionsApiRepository.kt index 4dcfafa462f..dd5d929bd6d 100644 --- a/financial-connections/src/main/java/com/stripe/android/financialconnections/repository/FinancialFinancialConnectionsApiRepository.kt +++ b/financial-connections/src/main/java/com/stripe/android/financialconnections/repository/FinancialFinancialConnectionsApiRepository.kt @@ -15,8 +15,8 @@ import com.stripe.android.core.networking.StripeRequest import com.stripe.android.core.networking.StripeResponse import com.stripe.android.core.networking.responseJson import com.stripe.android.financialconnections.di.PUBLISHABLE_KEY -import com.stripe.android.financialconnections.model.LinkAccountSession -import com.stripe.android.financialconnections.model.LinkAccountSessionManifest +import com.stripe.android.financialconnections.model.FinancialConnectionsSession +import com.stripe.android.financialconnections.model.FinancialConnectionsSessionManifest import com.stripe.android.financialconnections.model.LinkedAccountList import com.stripe.android.financialconnections.model.ListLinkedAccountParams import kotlinx.serialization.KSerializer @@ -56,7 +56,7 @@ internal class FinancialFinancialConnectionsApiRepository @Inject constructor( override suspend fun getLinkAccountSession( clientSecret: String - ): LinkAccountSession { + ): FinancialConnectionsSession { val financialConnectionsRequest = apiRequestFactory.createGet( url = sessionReceiptUrl, options = options, @@ -64,13 +64,13 @@ internal class FinancialFinancialConnectionsApiRepository @Inject constructor( PARAMS_CLIENT_SECRET to clientSecret ), ) - return executeRequest(financialConnectionsRequest, LinkAccountSession.serializer()) + return executeRequest(financialConnectionsRequest, FinancialConnectionsSession.serializer()) } override suspend fun generateLinkAccountSessionManifest( clientSecret: String, applicationId: String - ): LinkAccountSessionManifest { + ): FinancialConnectionsSessionManifest { val financialConnectionsRequest = apiRequestFactory.createPost( url = generateHostedUrl, options = options, @@ -79,7 +79,7 @@ internal class FinancialFinancialConnectionsApiRepository @Inject constructor( PARAMS_APPLICATION_ID to applicationId ), ) - return executeRequest(financialConnectionsRequest, LinkAccountSessionManifest.serializer()) + return executeRequest(financialConnectionsRequest, FinancialConnectionsSessionManifest.serializer()) } private suspend fun executeRequest( diff --git a/financial-connections/src/test/java/com/stripe/android/financialconnections/ApiKeyFixtures.kt b/financial-connections/src/test/java/com/stripe/android/financialconnections/ApiKeyFixtures.kt index 3b8374c079c..365855bbb2f 100644 --- a/financial-connections/src/test/java/com/stripe/android/financialconnections/ApiKeyFixtures.kt +++ b/financial-connections/src/test/java/com/stripe/android/financialconnections/ApiKeyFixtures.kt @@ -1,6 +1,6 @@ package com.stripe.android.financialconnections -import com.stripe.android.financialconnections.model.LinkAccountSessionManifest +import com.stripe.android.financialconnections.model.FinancialConnectionsSessionManifest internal object ApiKeyFixtures { const val DEFAULT_PUBLISHABLE_KEY = "pk_test_vOo1umqsYxSrP5UXfOeL3ecm" @@ -9,5 +9,5 @@ internal object ApiKeyFixtures { const val HOSTED_AUTH_URL = "https://stripe.com/auth/flow/start" const val SUCCESS_URL = "stripe-auth://link-accounts/success" const val CANCEL_URL = "stripe-auth://link-accounts/cancel" - val MANIFEST = LinkAccountSessionManifest(HOSTED_AUTH_URL, SUCCESS_URL, CANCEL_URL) + val MANIFEST = FinancialConnectionsSessionManifest(HOSTED_AUTH_URL, SUCCESS_URL, CANCEL_URL) } diff --git a/financial-connections/src/test/java/com/stripe/android/financialconnections/FinancialFinancialConnectionsSheetViewModelTest.kt b/financial-connections/src/test/java/com/stripe/android/financialconnections/FinancialFinancialConnectionsSheetViewModelTest.kt index c7005332af9..113ccb8e08f 100644 --- a/financial-connections/src/test/java/com/stripe/android/financialconnections/FinancialFinancialConnectionsSheetViewModelTest.kt +++ b/financial-connections/src/test/java/com/stripe/android/financialconnections/FinancialFinancialConnectionsSheetViewModelTest.kt @@ -12,8 +12,8 @@ import com.stripe.android.financialconnections.FinancialConnectionsSheetViewEffe import com.stripe.android.financialconnections.analytics.FinancialConnectionsEventReporter import com.stripe.android.financialconnections.domain.FetchLinkAccountSession import com.stripe.android.financialconnections.domain.GenerateLinkAccountSessionManifest -import com.stripe.android.financialconnections.model.LinkAccountSession -import com.stripe.android.financialconnections.model.LinkAccountSessionManifest +import com.stripe.android.financialconnections.model.FinancialConnectionsSession +import com.stripe.android.financialconnections.model.FinancialConnectionsSessionManifest import com.stripe.android.financialconnections.model.LinkedAccountFixtures import com.stripe.android.financialconnections.model.LinkedAccountList import kotlinx.coroutines.ExperimentalCoroutinesApi @@ -36,7 +36,7 @@ class FinancialFinancialConnectionsSheetViewModelTest { ApiKeyFixtures.DEFAULT_LINK_ACCOUNT_SESSION_SECRET, ApiKeyFixtures.DEFAULT_PUBLISHABLE_KEY ) - private val manifest = LinkAccountSessionManifest( + private val manifest = FinancialConnectionsSessionManifest( ApiKeyFixtures.HOSTED_AUTH_URL, ApiKeyFixtures.SUCCESS_URL, ApiKeyFixtures.CANCEL_URL @@ -272,7 +272,7 @@ class FinancialFinancialConnectionsSheetViewModelTest { it.data = Uri.parse(ApiKeyFixtures.CANCEL_URL) } - private fun linkAccountSession() = LinkAccountSession( + private fun linkAccountSession() = FinancialConnectionsSession( id = "las_no_more", clientSecret = configuration.linkAccountSessionClientSecret, livemode = true, diff --git a/financial-connections/src/test/java/com/stripe/android/financialconnections/analytics/DefaultConnectionsEventReportTest.kt b/financial-connections/src/test/java/com/stripe/android/financialconnections/analytics/DefaultConnectionsEventReportTest.kt index 9fdb9c8b1f3..4a5a22f2e74 100644 --- a/financial-connections/src/test/java/com/stripe/android/financialconnections/analytics/DefaultConnectionsEventReportTest.kt +++ b/financial-connections/src/test/java/com/stripe/android/financialconnections/analytics/DefaultConnectionsEventReportTest.kt @@ -7,7 +7,7 @@ import com.stripe.android.core.networking.AnalyticsRequestFactory import com.stripe.android.financialconnections.ApiKeyFixtures import com.stripe.android.financialconnections.FinancialConnectionsSheet import com.stripe.android.financialconnections.FinancialConnectionsSheetContract -import com.stripe.android.financialconnections.model.LinkAccountSession +import com.stripe.android.financialconnections.model.FinancialConnectionsSession import com.stripe.android.financialconnections.model.LinkedAccountList import kotlinx.coroutines.ExperimentalCoroutinesApi import kotlinx.coroutines.test.UnconfinedTestDispatcher @@ -43,7 +43,7 @@ class DefaultConnectionsEventReportTest { ApiKeyFixtures.DEFAULT_PUBLISHABLE_KEY ) - private val linkAccountSession = LinkAccountSession( + private val financialConnectionsSession = FinancialConnectionsSession( "las_1234567890", ApiKeyFixtures.DEFAULT_LINK_ACCOUNT_SESSION_SECRET, LinkedAccountList( @@ -70,7 +70,7 @@ class DefaultConnectionsEventReportTest { fun `onResult() should fire analytics request with expected event value for success`() { eventReporter.onResult( configuration, - FinancialConnectionsSheetContract.Result.Completed(linkAccountSession) + FinancialConnectionsSheetContract.Result.Completed(financialConnectionsSession) ) verify(analyticsRequestExecutor).executeAsync( argWhere { req -> diff --git a/financial-connections/src/test/java/com/stripe/android/financialconnections/domain/FetchLinkAccountSessionForTokenTest.kt b/financial-connections/src/test/java/com/stripe/android/financialconnections/domain/FetchFinancialConnectionsSessionForTokenTest.kt similarity index 81% rename from financial-connections/src/test/java/com/stripe/android/financialconnections/domain/FetchLinkAccountSessionForTokenTest.kt rename to financial-connections/src/test/java/com/stripe/android/financialconnections/domain/FetchFinancialConnectionsSessionForTokenTest.kt index 47496f206e5..c43504a29fc 100644 --- a/financial-connections/src/test/java/com/stripe/android/financialconnections/domain/FetchLinkAccountSessionForTokenTest.kt +++ b/financial-connections/src/test/java/com/stripe/android/financialconnections/domain/FetchFinancialConnectionsSessionForTokenTest.kt @@ -3,7 +3,7 @@ package com.stripe.android.connections.domain import com.google.common.truth.Truth.assertThat import com.stripe.android.connections.test.readResourceAsString import com.stripe.android.financialconnections.ApiKeyFixtures -import com.stripe.android.financialconnections.model.LinkAccountSession +import com.stripe.android.financialconnections.model.FinancialConnectionsSession import com.stripe.android.financialconnections.networking.FakeFinancialConnectionsRepository import kotlinx.coroutines.ExperimentalCoroutinesApi import kotlinx.coroutines.test.runTest @@ -12,7 +12,7 @@ import org.junit.Test import kotlin.test.assertFailsWith @ExperimentalCoroutinesApi -class FetchLinkAccountSessionForTokenTest { +class FetchFinancialConnectionsSessionForTokenTest { private val repository = FakeFinancialConnectionsRepository(ApiKeyFixtures.MANIFEST) private val getLinkAccountSession = FetchLinkAccountSessionForToken(repository) @@ -25,9 +25,9 @@ class FetchLinkAccountSessionForTokenTest { runTest { // Given val clientSecret = "clientSecret" - repository.getLinkAccountSessionResultProvider = { + repository.getFinancialConnectionsSessionResultProvider = { json.decodeFromString( - LinkAccountSession.serializer(), + FinancialConnectionsSession.serializer(), readResourceAsString("json/linked_account_session_with_token.json") ) } @@ -44,9 +44,9 @@ class FetchLinkAccountSessionForTokenTest { runTest { // Given val clientSecret = "clientSecret" - repository.getLinkAccountSessionResultProvider = { + repository.getFinancialConnectionsSessionResultProvider = { json.decodeFromString( - LinkAccountSession.serializer(), + FinancialConnectionsSession.serializer(), readResourceAsString("json/linked_account_session_payment_account_as_bank_account.json") ) } diff --git a/financial-connections/src/test/java/com/stripe/android/financialconnections/domain/FetchLinkAccountSessionTest.kt b/financial-connections/src/test/java/com/stripe/android/financialconnections/domain/FetchFinancialConnectionsSessionTest.kt similarity index 69% rename from financial-connections/src/test/java/com/stripe/android/financialconnections/domain/FetchLinkAccountSessionTest.kt rename to financial-connections/src/test/java/com/stripe/android/financialconnections/domain/FetchFinancialConnectionsSessionTest.kt index dd418171f38..a5c68c65600 100644 --- a/financial-connections/src/test/java/com/stripe/android/financialconnections/domain/FetchLinkAccountSessionTest.kt +++ b/financial-connections/src/test/java/com/stripe/android/financialconnections/domain/FetchFinancialConnectionsSessionTest.kt @@ -4,9 +4,9 @@ import androidx.test.ext.junit.runners.AndroidJUnit4 import com.google.common.truth.Truth.assertThat import com.stripe.android.core.exception.APIException import com.stripe.android.financialconnections.ApiKeyFixtures -import com.stripe.android.financialconnections.linkAccountSessionWithMoreAccounts -import com.stripe.android.financialconnections.linkAccountSessionWithNoMoreAccounts -import com.stripe.android.financialconnections.model.LinkAccountSession +import com.stripe.android.financialconnections.financialConnectionsSessionWithMoreAccounts +import com.stripe.android.financialconnections.financialConnectionsSessionWithNoMoreAccounts +import com.stripe.android.financialconnections.model.FinancialConnectionsSession import com.stripe.android.financialconnections.model.LinkedAccountList import com.stripe.android.financialconnections.moreLinkedAccountList import com.stripe.android.financialconnections.networking.FakeFinancialConnectionsRepository @@ -18,7 +18,7 @@ import kotlin.test.assertFailsWith @ExperimentalCoroutinesApi @RunWith(AndroidJUnit4::class) -class FetchLinkAccountSessionTest { +class FetchFinancialConnectionsSessionTest { private val repository = FakeFinancialConnectionsRepository(ApiKeyFixtures.MANIFEST) private val getLinkAccountSession = FetchLinkAccountSession(repository) @@ -28,14 +28,14 @@ class FetchLinkAccountSessionTest { runTest { // Given val clientSecret = "clientSecret" - repository.getLinkAccountSessionResultProvider = - { linkAccountSessionWithNoMoreAccounts } + repository.getFinancialConnectionsSessionResultProvider = + { financialConnectionsSessionWithNoMoreAccounts } // When - val result: LinkAccountSession = getLinkAccountSession(clientSecret) + val result: FinancialConnectionsSession = getLinkAccountSession(clientSecret) // Then - assertThat(result).isEqualTo(linkAccountSessionWithNoMoreAccounts) + assertThat(result).isEqualTo(financialConnectionsSessionWithNoMoreAccounts) } @Test @@ -43,22 +43,22 @@ class FetchLinkAccountSessionTest { runTest { // Given val clientSecret = "clientSecret" - repository.getLinkAccountSessionResultProvider = { linkAccountSessionWithMoreAccounts } + repository.getFinancialConnectionsSessionResultProvider = { financialConnectionsSessionWithMoreAccounts } repository.getLinkedAccountsResultProvider = { moreLinkedAccountList } // When - val result: LinkAccountSession = getLinkAccountSession(clientSecret) + val result: FinancialConnectionsSession = getLinkAccountSession(clientSecret) // Then val combinedAccounts = listOf( // Original account list with hasMore == true - linkAccountSessionWithMoreAccounts.linkedAccounts.linkedAccounts, + financialConnectionsSessionWithMoreAccounts.linkedAccounts.linkedAccounts, // Next and last linked accounts page. moreLinkedAccountList.linkedAccounts ).flatten() assertThat(result).isEqualTo( - linkAccountSessionWithMoreAccounts.copy( + financialConnectionsSessionWithMoreAccounts.copy( linkedAccounts = LinkedAccountList( linkedAccounts = combinedAccounts, hasMore = false, @@ -75,23 +75,23 @@ class FetchLinkAccountSessionTest { // Given assertFailsWith { val clientSecret = "clientSecret" - repository.getLinkAccountSessionResultProvider = - { linkAccountSessionWithMoreAccounts } + repository.getFinancialConnectionsSessionResultProvider = + { financialConnectionsSessionWithMoreAccounts } repository.getLinkedAccountsResultProvider = { throw APIException() } // When - val result: LinkAccountSession = getLinkAccountSession(clientSecret) + val result: FinancialConnectionsSession = getLinkAccountSession(clientSecret) // Then val combinedAccounts = listOf( // Original account list with hasMore == true - linkAccountSessionWithMoreAccounts.linkedAccounts.linkedAccounts, + financialConnectionsSessionWithMoreAccounts.linkedAccounts.linkedAccounts, // Next and last linked accounts page. moreLinkedAccountList.linkedAccounts ).flatten() assertThat(result).isEqualTo( - linkAccountSessionWithMoreAccounts.copy( + financialConnectionsSessionWithMoreAccounts.copy( linkedAccounts = LinkedAccountList( linkedAccounts = combinedAccounts, hasMore = false, diff --git a/financial-connections/src/test/java/com/stripe/android/financialconnections/launcher/DefaultFinancialConnectionsSheetLauncherTest.kt b/financial-connections/src/test/java/com/stripe/android/financialconnections/launcher/DefaultFinancialConnectionsSheetLauncherTest.kt index 673c774854a..b5e4e9db21a 100644 --- a/financial-connections/src/test/java/com/stripe/android/financialconnections/launcher/DefaultFinancialConnectionsSheetLauncherTest.kt +++ b/financial-connections/src/test/java/com/stripe/android/financialconnections/launcher/DefaultFinancialConnectionsSheetLauncherTest.kt @@ -7,7 +7,7 @@ import com.stripe.android.financialconnections.FinancialConnectionsSheet import com.stripe.android.financialconnections.FinancialConnectionsSheetContract import com.stripe.android.financialconnections.FinancialConnectionsSheetResult import com.stripe.android.financialconnections.launcher.DefaultFinancialConnectionsSheetLauncher -import com.stripe.android.financialconnections.linkAccountSessionWithNoMoreAccounts +import com.stripe.android.financialconnections.financialConnectionsSessionWithNoMoreAccounts import com.stripe.android.financialconnections.utils.FakeActivityResultRegistry import com.stripe.android.financialconnections.utils.TestFragment import org.junit.Test @@ -23,7 +23,7 @@ class DefaultFinancialConnectionsSheetLauncherTest { fun `create and present should return expected ConnectionsSheetResult#Completed`() { val testRegistry = FakeActivityResultRegistry( FinancialConnectionsSheetContract.Result.Completed( - linkAccountSession = linkAccountSessionWithNoMoreAccounts, + financialConnectionsSession = financialConnectionsSessionWithNoMoreAccounts, token = null ) ) @@ -45,7 +45,7 @@ class DefaultFinancialConnectionsSheetLauncherTest { assertThat(results) .containsExactly( FinancialConnectionsSheetResult.Completed( - linkAccountSessionWithNoMoreAccounts + financialConnectionsSessionWithNoMoreAccounts ) ) } diff --git a/financial-connections/src/test/java/com/stripe/android/financialconnections/launcher/FinancialConnectionsSheetForTokenLauncherTest.kt b/financial-connections/src/test/java/com/stripe/android/financialconnections/launcher/FinancialConnectionsSheetForTokenLauncherTest.kt index 80587fe0b70..c11163d1fc7 100644 --- a/financial-connections/src/test/java/com/stripe/android/financialconnections/launcher/FinancialConnectionsSheetForTokenLauncherTest.kt +++ b/financial-connections/src/test/java/com/stripe/android/financialconnections/launcher/FinancialConnectionsSheetForTokenLauncherTest.kt @@ -8,7 +8,7 @@ import com.stripe.android.financialconnections.FinancialConnectionsSheet import com.stripe.android.financialconnections.FinancialConnectionsSheetContract import com.stripe.android.financialconnections.bankAccountToken import com.stripe.android.financialconnections.launcher.FinancialConnectionsSheetForTokenLauncher -import com.stripe.android.financialconnections.linkAccountSessionWithNoMoreAccounts +import com.stripe.android.financialconnections.financialConnectionsSessionWithNoMoreAccounts import com.stripe.android.financialconnections.utils.FakeActivityResultRegistry import com.stripe.android.financialconnections.utils.TestFragment import org.junit.Test @@ -24,7 +24,7 @@ class FinancialConnectionsSheetForTokenLauncherTest { fun `create and present should return expected ConnectionsSheetForTokenResult#Completed`() { val testRegistry = FakeActivityResultRegistry( FinancialConnectionsSheetContract.Result.Completed( - linkAccountSession = linkAccountSessionWithNoMoreAccounts, + financialConnectionsSession = financialConnectionsSessionWithNoMoreAccounts, token = bankAccountToken ) ) @@ -46,7 +46,7 @@ class FinancialConnectionsSheetForTokenLauncherTest { assertThat(results) .containsExactly( FinancialConnectionsSheetForTokenResult.Completed( - linkAccountSessionWithNoMoreAccounts, + financialConnectionsSessionWithNoMoreAccounts, bankAccountToken ) ) diff --git a/financial-connections/src/test/java/com/stripe/android/financialconnections/networking/FakeFinancialConnectionsRepository.kt b/financial-connections/src/test/java/com/stripe/android/financialconnections/networking/FakeFinancialConnectionsRepository.kt index c8bc4733fbd..12915d5a2f6 100644 --- a/financial-connections/src/test/java/com/stripe/android/financialconnections/networking/FakeFinancialConnectionsRepository.kt +++ b/financial-connections/src/test/java/com/stripe/android/financialconnections/networking/FakeFinancialConnectionsRepository.kt @@ -1,19 +1,19 @@ package com.stripe.android.financialconnections.networking -import com.stripe.android.financialconnections.linkAccountSessionWithNoMoreAccounts -import com.stripe.android.financialconnections.model.LinkAccountSession -import com.stripe.android.financialconnections.model.LinkAccountSessionManifest +import com.stripe.android.financialconnections.financialConnectionsSessionWithNoMoreAccounts +import com.stripe.android.financialconnections.model.FinancialConnectionsSession +import com.stripe.android.financialconnections.model.FinancialConnectionsSessionManifest import com.stripe.android.financialconnections.model.LinkedAccountList import com.stripe.android.financialconnections.model.ListLinkedAccountParams import com.stripe.android.financialconnections.moreLinkedAccountList import com.stripe.android.financialconnections.repository.FinancialConnectionsRepository internal class FakeFinancialConnectionsRepository( - private val manifest: LinkAccountSessionManifest, + private val manifest: FinancialConnectionsSessionManifest, ) : FinancialConnectionsRepository { - var getLinkAccountSessionResultProvider: () -> LinkAccountSession = - { linkAccountSessionWithNoMoreAccounts } + var getFinancialConnectionsSessionResultProvider: () -> FinancialConnectionsSession = + { financialConnectionsSessionWithNoMoreAccounts } var getLinkedAccountsResultProvider: () -> LinkedAccountList = { moreLinkedAccountList } override suspend fun getLinkedAccounts( @@ -22,10 +22,10 @@ internal class FakeFinancialConnectionsRepository( override suspend fun getLinkAccountSession( clientSecret: String - ): LinkAccountSession = getLinkAccountSessionResultProvider() + ): FinancialConnectionsSession = getFinancialConnectionsSessionResultProvider() override suspend fun generateLinkAccountSessionManifest( clientSecret: String, applicationId: String - ): LinkAccountSessionManifest = manifest + ): FinancialConnectionsSessionManifest = manifest } diff --git a/financial-connections/src/test/java/com/stripe/android/financialconnections/testmodels.kt b/financial-connections/src/test/java/com/stripe/android/financialconnections/testmodels.kt index f4569b1eea4..a56b40c46ff 100644 --- a/financial-connections/src/test/java/com/stripe/android/financialconnections/testmodels.kt +++ b/financial-connections/src/test/java/com/stripe/android/financialconnections/testmodels.kt @@ -1,13 +1,13 @@ package com.stripe.android.financialconnections -import com.stripe.android.financialconnections.model.LinkAccountSession +import com.stripe.android.financialconnections.model.FinancialConnectionsSession import com.stripe.android.financialconnections.model.LinkedAccountFixtures import com.stripe.android.financialconnections.model.LinkedAccountList import com.stripe.android.model.BankAccount import com.stripe.android.model.Token import java.util.Date -val linkAccountSessionWithNoMoreAccounts = LinkAccountSession( +val financialConnectionsSessionWithNoMoreAccounts = FinancialConnectionsSession( id = "las_no_more", clientSecret = ApiKeyFixtures.DEFAULT_LINK_ACCOUNT_SESSION_SECRET, linkedAccounts = LinkedAccountList( @@ -22,7 +22,7 @@ val linkAccountSessionWithNoMoreAccounts = LinkAccountSession( livemode = true ) -val linkAccountSessionWithMoreAccounts = LinkAccountSession( +val financialConnectionsSessionWithMoreAccounts = FinancialConnectionsSession( id = "las_has_more", clientSecret = ApiKeyFixtures.DEFAULT_LINK_ACCOUNT_SESSION_SECRET, linkedAccounts = LinkedAccountList( diff --git a/payments-core/src/main/java/com/stripe/android/model/CreateLinkAccountSessionParams.kt b/payments-core/src/main/java/com/stripe/android/model/CreateFinancialConnectionsSessionParams.kt similarity index 92% rename from payments-core/src/main/java/com/stripe/android/model/CreateLinkAccountSessionParams.kt rename to payments-core/src/main/java/com/stripe/android/model/CreateFinancialConnectionsSessionParams.kt index 8041a7da448..a0f0e0f4ea0 100644 --- a/payments-core/src/main/java/com/stripe/android/model/CreateLinkAccountSessionParams.kt +++ b/payments-core/src/main/java/com/stripe/android/model/CreateFinancialConnectionsSessionParams.kt @@ -1,6 +1,6 @@ package com.stripe.android.model -internal data class CreateLinkAccountSessionParams( +internal data class CreateFinancialConnectionsSessionParams( val clientSecret: String, val customerName: String, val customerEmailAddress: String?, diff --git a/payments-core/src/main/java/com/stripe/android/model/BankConnectionsLinkedAccountSession.kt b/payments-core/src/main/java/com/stripe/android/model/FinancialConnectionsSession.kt similarity index 77% rename from payments-core/src/main/java/com/stripe/android/model/BankConnectionsLinkedAccountSession.kt rename to payments-core/src/main/java/com/stripe/android/model/FinancialConnectionsSession.kt index 63f674c7a54..e679f200912 100644 --- a/payments-core/src/main/java/com/stripe/android/model/BankConnectionsLinkedAccountSession.kt +++ b/payments-core/src/main/java/com/stripe/android/model/FinancialConnectionsSession.kt @@ -4,7 +4,7 @@ import com.stripe.android.core.model.StripeModel import kotlinx.parcelize.Parcelize @Parcelize -internal data class BankConnectionsLinkedAccountSession( +internal data class FinancialConnectionsSession( val clientSecret: String?, val id: String?, ) : StripeModel diff --git a/payments-core/src/main/java/com/stripe/android/model/parsers/BankConnectionsLinkAccountSessionJsonParser.kt b/payments-core/src/main/java/com/stripe/android/model/parsers/FinancialConnectionsSessionJsonParser.kt similarity index 60% rename from payments-core/src/main/java/com/stripe/android/model/parsers/BankConnectionsLinkAccountSessionJsonParser.kt rename to payments-core/src/main/java/com/stripe/android/model/parsers/FinancialConnectionsSessionJsonParser.kt index 1555a796a65..3ce43d31a98 100644 --- a/payments-core/src/main/java/com/stripe/android/model/parsers/BankConnectionsLinkAccountSessionJsonParser.kt +++ b/payments-core/src/main/java/com/stripe/android/model/parsers/FinancialConnectionsSessionJsonParser.kt @@ -2,13 +2,13 @@ package com.stripe.android.model.parsers import com.stripe.android.core.model.StripeJsonUtils import com.stripe.android.core.model.parsers.ModelJsonParser -import com.stripe.android.model.BankConnectionsLinkedAccountSession +import com.stripe.android.model.FinancialConnectionsSession import org.json.JSONObject -internal class BankConnectionsLinkAccountSessionJsonParser : - ModelJsonParser { - override fun parse(json: JSONObject): BankConnectionsLinkedAccountSession { - return BankConnectionsLinkedAccountSession( +internal class FinancialConnectionsSessionJsonParser : + ModelJsonParser { + override fun parse(json: JSONObject): FinancialConnectionsSession { + return FinancialConnectionsSession( clientSecret = StripeJsonUtils.optString(json, FIELD_CLIENT_SECRET), id = StripeJsonUtils.optString(json, FIELD_ID) ) diff --git a/payments-core/src/main/java/com/stripe/android/networking/StripeApiRepository.kt b/payments-core/src/main/java/com/stripe/android/networking/StripeApiRepository.kt index e681feb7a96..2fa40e39848 100644 --- a/payments-core/src/main/java/com/stripe/android/networking/StripeApiRepository.kt +++ b/payments-core/src/main/java/com/stripe/android/networking/StripeApiRepository.kt @@ -38,7 +38,7 @@ import com.stripe.android.core.networking.StripeResponse import com.stripe.android.core.networking.responseJson import com.stripe.android.core.version.StripeSdkVersion import com.stripe.android.exception.CardException -import com.stripe.android.model.BankConnectionsLinkedAccountSession +import com.stripe.android.model.FinancialConnectionsSession import com.stripe.android.model.BankStatuses import com.stripe.android.model.CardMetadata import com.stripe.android.model.ConfirmPaymentIntentParams @@ -48,7 +48,7 @@ import com.stripe.android.model.ConfirmStripeIntentParams.Companion.PARAM_CLIENT import com.stripe.android.model.ConsumerPaymentDetails import com.stripe.android.model.ConsumerSession import com.stripe.android.model.ConsumerSessionLookup -import com.stripe.android.model.CreateLinkAccountSessionParams +import com.stripe.android.model.CreateFinancialConnectionsSessionParams import com.stripe.android.model.Customer import com.stripe.android.model.ListPaymentMethodsParams import com.stripe.android.model.PaymentIntent @@ -64,7 +64,7 @@ import com.stripe.android.model.Stripe3ds2AuthResult import com.stripe.android.model.StripeIntent import com.stripe.android.model.Token import com.stripe.android.model.TokenParams -import com.stripe.android.model.parsers.BankConnectionsLinkAccountSessionJsonParser +import com.stripe.android.model.parsers.FinancialConnectionsSessionJsonParser import com.stripe.android.model.parsers.CardMetadataJsonParser import com.stripe.android.model.parsers.ConsumerPaymentDetailsJsonParser import com.stripe.android.model.parsers.ConsumerSessionJsonParser @@ -1341,35 +1341,35 @@ internal class StripeApiRepository @JvmOverloads internal constructor( } } - override suspend fun createPaymentIntentLinkAccountSession( + override suspend fun createPaymentIntentFinancialConnectionsSession( paymentIntentId: String, - params: CreateLinkAccountSessionParams, + params: CreateFinancialConnectionsSessionParams, requestOptions: ApiRequest.Options - ): BankConnectionsLinkedAccountSession? { + ): FinancialConnectionsSession? { return fetchStripeModel( apiRequestFactory.createPost( - url = getPaymentIntentLinkAccountSessionUrl(paymentIntentId), + url = getPaymentIntentFinancialConnectionsSessionUrl(paymentIntentId), options = requestOptions, params = params.toMap() ), - BankConnectionsLinkAccountSessionJsonParser(), + FinancialConnectionsSessionJsonParser(), ) { // no-op } } - override suspend fun createSetupIntentLinkAccountSession( + override suspend fun createSetupIntentFinancialConnectionsSession( setupIntentId: String, - params: CreateLinkAccountSessionParams, + params: CreateFinancialConnectionsSessionParams, requestOptions: ApiRequest.Options - ): BankConnectionsLinkedAccountSession? { + ): FinancialConnectionsSession? { return fetchStripeModel( apiRequestFactory.createPost( - url = getSetupIntentLinkAccountSessionUrl(setupIntentId), + url = getSetupIntentFinancialConnectionsSessionUrl(setupIntentId), options = requestOptions, params = params.toMap() ), - BankConnectionsLinkAccountSessionJsonParser(), + FinancialConnectionsSessionJsonParser(), ) { // no-op } @@ -1380,7 +1380,7 @@ internal class StripeApiRepository @JvmOverloads internal constructor( */ @VisibleForTesting @JvmSynthetic - internal fun getPaymentIntentLinkAccountSessionUrl(paymentIntentId: String): String { + internal fun getPaymentIntentFinancialConnectionsSessionUrl(paymentIntentId: String): String { return getApiUrl("payment_intents/%s/link_account_sessions", paymentIntentId) } @@ -1389,24 +1389,24 @@ internal class StripeApiRepository @JvmOverloads internal constructor( */ @VisibleForTesting @JvmSynthetic - internal fun getSetupIntentLinkAccountSessionUrl(setupIntentId: String): String { + internal fun getSetupIntentFinancialConnectionsSessionUrl(setupIntentId: String): String { return getApiUrl("setup_intents/%s/link_account_sessions", setupIntentId) } /** * Attaches the Link Account Session to the Payment Intent */ - override suspend fun attachLinkAccountSessionToPaymentIntent( + override suspend fun attachFinancialConnectionsSessionToPaymentIntent( clientSecret: String, paymentIntentId: String, - linkAccountSessionId: String, + financialConnectionsSessionId: String, requestOptions: ApiRequest.Options ): PaymentIntent? { return fetchStripeModel( apiRequestFactory.createPost( - getAttachLinkAccountSessionToPaymentIntentUrl( + getAttachFinancialConnectionsSessionToPaymentIntentUrl( paymentIntentId, - linkAccountSessionId + financialConnectionsSessionId ), requestOptions, mapOf( @@ -1422,15 +1422,15 @@ internal class StripeApiRepository @JvmOverloads internal constructor( /** * Attaches the Link Account Session to the Setup Intent */ - override suspend fun attachLinkAccountSessionToSetupIntent( + override suspend fun attachFinancialConnectionsSessionToSetupIntent( clientSecret: String, setupIntentId: String, - linkAccountSessionId: String, + financialConnectionsSessionId: String, requestOptions: ApiRequest.Options ): SetupIntent? { return fetchStripeModel( apiRequestFactory.createPost( - getAttachLinkAccountSessionToSetupIntentUrl(setupIntentId, linkAccountSessionId), + getAttachFinancialConnectionsSessionToSetupIntentUrl(setupIntentId, financialConnectionsSessionId), requestOptions, mapOf( "client_secret" to clientSecret @@ -1993,35 +1993,35 @@ internal class StripeApiRepository @JvmOverloads internal constructor( /** * @return `https://api.stripe.com/v1/payment_intents/:paymentIntentId/ - * link_account_sessions/:linkAccountSessionId/attach` + * link_account_sessions/:financialConnectionsSessionId/attach` */ @VisibleForTesting @JvmSynthetic - internal fun getAttachLinkAccountSessionToPaymentIntentUrl( + internal fun getAttachFinancialConnectionsSessionToPaymentIntentUrl( paymentIntentId: String, - linkAccountSessionId: String + financialConnectionsSessionId: String ): String { return getApiUrl( "payment_intents/%s/link_account_sessions/%s/attach", paymentIntentId, - linkAccountSessionId + financialConnectionsSessionId ) } /** * @return `https://api.stripe.com/v1/setup_intents/:setupIntentId/ - * link_account_sessions/:linkAccountSessionId/attach` + * link_account_sessions/:financialConnectionsSessionId/attach` */ @VisibleForTesting @JvmSynthetic - internal fun getAttachLinkAccountSessionToSetupIntentUrl( + internal fun getAttachFinancialConnectionsSessionToSetupIntentUrl( setupIntentId: String, - linkAccountSessionId: String + financialConnectionsSessionId: String ): String { return getApiUrl( "setup_intents/%s/link_account_sessions/%s/attach", setupIntentId, - linkAccountSessionId + financialConnectionsSessionId ) } diff --git a/payments-core/src/main/java/com/stripe/android/networking/StripeRepository.kt b/payments-core/src/main/java/com/stripe/android/networking/StripeRepository.kt index 99bf7ebbe8c..7d84db1a54e 100644 --- a/payments-core/src/main/java/com/stripe/android/networking/StripeRepository.kt +++ b/payments-core/src/main/java/com/stripe/android/networking/StripeRepository.kt @@ -11,7 +11,7 @@ import com.stripe.android.core.model.StripeFile import com.stripe.android.core.model.StripeFileParams import com.stripe.android.core.networking.ApiRequest import com.stripe.android.exception.CardException -import com.stripe.android.model.BankConnectionsLinkedAccountSession +import com.stripe.android.model.FinancialConnectionsSession import com.stripe.android.model.BankStatuses import com.stripe.android.model.CardMetadata import com.stripe.android.model.ConfirmPaymentIntentParams @@ -19,7 +19,7 @@ import com.stripe.android.model.ConfirmSetupIntentParams import com.stripe.android.model.ConsumerPaymentDetails import com.stripe.android.model.ConsumerSession import com.stripe.android.model.ConsumerSessionLookup -import com.stripe.android.model.CreateLinkAccountSessionParams +import com.stripe.android.model.CreateFinancialConnectionsSessionParams import com.stripe.android.model.Customer import com.stripe.android.model.ListPaymentMethodsParams import com.stripe.android.model.PaymentIntent @@ -441,31 +441,31 @@ abstract class StripeRepository { requestOptions: ApiRequest.Options ): ConsumerPaymentDetails? - internal abstract suspend fun createPaymentIntentLinkAccountSession( + internal abstract suspend fun createPaymentIntentFinancialConnectionsSession( paymentIntentId: String, - params: CreateLinkAccountSessionParams, + params: CreateFinancialConnectionsSessionParams, requestOptions: ApiRequest.Options - ): BankConnectionsLinkedAccountSession? + ): FinancialConnectionsSession? - internal abstract suspend fun createSetupIntentLinkAccountSession( + internal abstract suspend fun createSetupIntentFinancialConnectionsSession( setupIntentId: String, - params: CreateLinkAccountSessionParams, + params: CreateFinancialConnectionsSessionParams, requestOptions: ApiRequest.Options - ): BankConnectionsLinkedAccountSession? + ): FinancialConnectionsSession? @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP) - abstract suspend fun attachLinkAccountSessionToPaymentIntent( + abstract suspend fun attachFinancialConnectionsSessionToPaymentIntent( clientSecret: String, paymentIntentId: String, - linkAccountSessionId: String, + financialConnectionsSessionId: String, requestOptions: ApiRequest.Options ): PaymentIntent? @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP) - abstract suspend fun attachLinkAccountSessionToSetupIntent( + abstract suspend fun attachFinancialConnectionsSessionToSetupIntent( clientSecret: String, setupIntentId: String, - linkAccountSessionId: String, + financialConnectionsSessionId: String, requestOptions: ApiRequest.Options ): SetupIntent? diff --git a/payments-core/src/main/java/com/stripe/android/payments/bankaccount/domain/AttachLinkAccountSession.kt b/payments-core/src/main/java/com/stripe/android/payments/bankaccount/domain/AttachFinancialConnectionsSession.kt similarity index 83% rename from payments-core/src/main/java/com/stripe/android/payments/bankaccount/domain/AttachLinkAccountSession.kt rename to payments-core/src/main/java/com/stripe/android/payments/bankaccount/domain/AttachFinancialConnectionsSession.kt index 45a3fff691c..5c203e6cfce 100644 --- a/payments-core/src/main/java/com/stripe/android/payments/bankaccount/domain/AttachLinkAccountSession.kt +++ b/payments-core/src/main/java/com/stripe/android/payments/bankaccount/domain/AttachFinancialConnectionsSession.kt @@ -6,7 +6,7 @@ import com.stripe.android.model.SetupIntent import com.stripe.android.networking.StripeRepository import javax.inject.Inject -internal class AttachLinkAccountSession @Inject constructor( +internal class AttachFinancialConnectionsSession @Inject constructor( private val stripeRepository: StripeRepository ) { @@ -21,8 +21,8 @@ internal class AttachLinkAccountSession @Inject constructor( linkedAccountSessionId: String, clientSecret: String, ): Result = kotlin.runCatching { - stripeRepository.attachLinkAccountSessionToPaymentIntent( - linkAccountSessionId = linkedAccountSessionId, + stripeRepository.attachFinancialConnectionsSessionToPaymentIntent( + financialConnectionsSessionId = linkedAccountSessionId, clientSecret = clientSecret, paymentIntentId = PaymentIntent.ClientSecret(clientSecret).paymentIntentId, requestOptions = ApiRequest.Options(publishableKey) @@ -40,8 +40,8 @@ internal class AttachLinkAccountSession @Inject constructor( linkedAccountSessionId: String, clientSecret: String, ): Result = kotlin.runCatching { - stripeRepository.attachLinkAccountSessionToSetupIntent( - linkAccountSessionId = linkedAccountSessionId, + stripeRepository.attachFinancialConnectionsSessionToSetupIntent( + financialConnectionsSessionId = linkedAccountSessionId, clientSecret = clientSecret, setupIntentId = SetupIntent.ClientSecret(clientSecret).setupIntentId, requestOptions = ApiRequest.Options(publishableKey) diff --git a/payments-core/src/main/java/com/stripe/android/payments/bankaccount/domain/CreateLinkAccountSession.kt b/payments-core/src/main/java/com/stripe/android/payments/bankaccount/domain/CreateFinancialConnectionsSession.kt similarity index 66% rename from payments-core/src/main/java/com/stripe/android/payments/bankaccount/domain/CreateLinkAccountSession.kt rename to payments-core/src/main/java/com/stripe/android/payments/bankaccount/domain/CreateFinancialConnectionsSession.kt index 6de58969b69..164466d9d28 100644 --- a/payments-core/src/main/java/com/stripe/android/payments/bankaccount/domain/CreateLinkAccountSession.kt +++ b/payments-core/src/main/java/com/stripe/android/payments/bankaccount/domain/CreateFinancialConnectionsSession.kt @@ -1,29 +1,29 @@ package com.stripe.android.payments.bankaccount.domain import com.stripe.android.core.networking.ApiRequest -import com.stripe.android.model.BankConnectionsLinkedAccountSession -import com.stripe.android.model.CreateLinkAccountSessionParams +import com.stripe.android.model.FinancialConnectionsSession +import com.stripe.android.model.CreateFinancialConnectionsSessionParams import com.stripe.android.model.PaymentIntent import com.stripe.android.model.SetupIntent import com.stripe.android.networking.StripeRepository import javax.inject.Inject -internal class CreateLinkAccountSession @Inject constructor( +internal class CreateFinancialConnectionsSession @Inject constructor( private val stripeRepository: StripeRepository ) { /** - * Creates a LinkAccountSession for the given [PaymentIntent] secret. + * Creates a [FinancialConnectionsSession] for the given [PaymentIntent] secret. */ suspend fun forPaymentIntent( publishableKey: String, clientSecret: String, customerName: String, customerEmail: String?, - ): Result = kotlin.runCatching { - stripeRepository.createPaymentIntentLinkAccountSession( + ): Result = kotlin.runCatching { + stripeRepository.createPaymentIntentFinancialConnectionsSession( paymentIntentId = PaymentIntent.ClientSecret(clientSecret).paymentIntentId, - params = CreateLinkAccountSessionParams( + params = CreateFinancialConnectionsSessionParams( clientSecret = clientSecret, customerName = customerName, customerEmailAddress = customerEmail @@ -33,17 +33,17 @@ internal class CreateLinkAccountSession @Inject constructor( }.mapCatching { it ?: throw InternalError("Error creating session for PaymentIntent") } /** - * Creates a LinkAccountSession for the given [SetupIntent] secret. + * Creates a [FinancialConnectionsSession] for the given [SetupIntent] secret. */ suspend fun forSetupIntent( publishableKey: String, clientSecret: String, customerName: String, customerEmail: String?, - ): Result = kotlin.runCatching { - stripeRepository.createSetupIntentLinkAccountSession( + ): Result = kotlin.runCatching { + stripeRepository.createSetupIntentFinancialConnectionsSession( setupIntentId = SetupIntent.ClientSecret(clientSecret).setupIntentId, - params = CreateLinkAccountSessionParams( + params = CreateFinancialConnectionsSessionParams( clientSecret = clientSecret, customerName = customerName, customerEmailAddress = customerEmail diff --git a/payments-core/src/main/java/com/stripe/android/payments/bankaccount/navigation/CollectBankAccountResult.kt b/payments-core/src/main/java/com/stripe/android/payments/bankaccount/navigation/CollectBankAccountResult.kt index d44f3dd1045..e0cda895f85 100644 --- a/payments-core/src/main/java/com/stripe/android/payments/bankaccount/navigation/CollectBankAccountResult.kt +++ b/payments-core/src/main/java/com/stripe/android/payments/bankaccount/navigation/CollectBankAccountResult.kt @@ -2,7 +2,7 @@ package com.stripe.android.payments.bankaccount.navigation import android.os.Parcelable import com.stripe.android.core.model.StripeModel -import com.stripe.android.financialconnections.model.LinkAccountSession +import com.stripe.android.financialconnections.model.FinancialConnectionsSession import com.stripe.android.model.StripeIntent import kotlinx.parcelize.Parcelize @@ -28,5 +28,5 @@ sealed class CollectBankAccountResult : Parcelable { @Parcelize data class CollectBankAccountResponse( val intent: StripeIntent, - val linkAccountSession: LinkAccountSession + val financialConnectionsSession: FinancialConnectionsSession ) : StripeModel diff --git a/payments-core/src/main/java/com/stripe/android/payments/bankaccount/ui/CollectBankAccountViewModel.kt b/payments-core/src/main/java/com/stripe/android/payments/bankaccount/ui/CollectBankAccountViewModel.kt index 0e7bd4f2586..e3d127f19c5 100644 --- a/payments-core/src/main/java/com/stripe/android/payments/bankaccount/ui/CollectBankAccountViewModel.kt +++ b/payments-core/src/main/java/com/stripe/android/payments/bankaccount/ui/CollectBankAccountViewModel.kt @@ -9,11 +9,11 @@ import androidx.lifecycle.viewModelScope import androidx.savedstate.SavedStateRegistryOwner import com.stripe.android.core.Logger import com.stripe.android.financialconnections.FinancialConnectionsSheetResult -import com.stripe.android.financialconnections.model.LinkAccountSession +import com.stripe.android.financialconnections.model.FinancialConnectionsSession import com.stripe.android.payments.bankaccount.CollectBankAccountConfiguration import com.stripe.android.payments.bankaccount.di.DaggerCollectBankAccountComponent -import com.stripe.android.payments.bankaccount.domain.AttachLinkAccountSession -import com.stripe.android.payments.bankaccount.domain.CreateLinkAccountSession +import com.stripe.android.payments.bankaccount.domain.AttachFinancialConnectionsSession +import com.stripe.android.payments.bankaccount.domain.CreateFinancialConnectionsSession import com.stripe.android.payments.bankaccount.domain.RetrieveStripeIntent import com.stripe.android.payments.bankaccount.navigation.CollectBankAccountContract import com.stripe.android.payments.bankaccount.navigation.CollectBankAccountContract.Args.ForPaymentIntent @@ -34,8 +34,8 @@ internal class CollectBankAccountViewModel @Inject constructor( private val args: CollectBankAccountContract.Args, private val _viewEffect: MutableSharedFlow, // injected instances - private val createLinkAccountSession: CreateLinkAccountSession, - private val attachLinkAccountSession: AttachLinkAccountSession, + private val createFinancialConnectionsSession: CreateFinancialConnectionsSession, + private val attachFinancialConnectionsSession: AttachFinancialConnectionsSession, private val retrieveStripeIntent: RetrieveStripeIntent, private val logger: Logger ) : ViewModel() { @@ -44,20 +44,20 @@ internal class CollectBankAccountViewModel @Inject constructor( init { viewModelScope.launch { - createLinkAccountSession() + createFinancialConnectionsSession() } } - private suspend fun createLinkAccountSession() { + private suspend fun createFinancialConnectionsSession() { when (val configuration = args.configuration) { is CollectBankAccountConfiguration.USBankAccount -> when (args) { - is ForPaymentIntent -> createLinkAccountSession.forPaymentIntent( + is ForPaymentIntent -> createFinancialConnectionsSession.forPaymentIntent( publishableKey = args.publishableKey, clientSecret = args.clientSecret, customerName = configuration.name, customerEmail = configuration.email ) - is ForSetupIntent -> createLinkAccountSession.forSetupIntent( + is ForSetupIntent -> createFinancialConnectionsSession.forSetupIntent( publishableKey = args.publishableKey, clientSecret = args.clientSecret, customerName = configuration.name, @@ -87,9 +87,9 @@ internal class CollectBankAccountViewModel @Inject constructor( finishWithError(result.error) is FinancialConnectionsSheetResult.Completed -> if (args.attachToIntent) { - attachLinkAccountSessionToIntent(result.linkAccountSession) + attachFinancialConnectionsSessionToIntent(result.financialConnectionsSession) } else { - finishWithLinkAccountSession(result.linkAccountSession) + finishWithFinancialConnectionsSession(result.financialConnectionsSession) } } } @@ -99,7 +99,7 @@ internal class CollectBankAccountViewModel @Inject constructor( _viewEffect.emit(CollectBankAccountViewEffect.FinishWithResult(result)) } - private fun finishWithLinkAccountSession(linkAccountSession: LinkAccountSession) { + private fun finishWithFinancialConnectionsSession(financialConnectionsSession: FinancialConnectionsSession) { viewModelScope.launch { retrieveStripeIntent( args.publishableKey, @@ -109,7 +109,7 @@ internal class CollectBankAccountViewModel @Inject constructor( Completed( CollectBankAccountResponse( intent = stripeIntent, - linkAccountSession = linkAccountSession + financialConnectionsSession = financialConnectionsSession ) ) ) @@ -119,21 +119,21 @@ internal class CollectBankAccountViewModel @Inject constructor( } } - private fun attachLinkAccountSessionToIntent(linkAccountSession: LinkAccountSession) { + private fun attachFinancialConnectionsSessionToIntent(financialConnectionsSession: FinancialConnectionsSession) { viewModelScope.launch { when (args) { - is ForPaymentIntent -> attachLinkAccountSession.forPaymentIntent( + is ForPaymentIntent -> attachFinancialConnectionsSession.forPaymentIntent( publishableKey = args.publishableKey, clientSecret = args.clientSecret, - linkedAccountSessionId = linkAccountSession.id + linkedAccountSessionId = financialConnectionsSession.id ) - is ForSetupIntent -> attachLinkAccountSession.forSetupIntent( + is ForSetupIntent -> attachFinancialConnectionsSession.forSetupIntent( publishableKey = args.publishableKey, clientSecret = args.clientSecret, - linkedAccountSessionId = linkAccountSession.id + linkedAccountSessionId = financialConnectionsSession.id ) } - .mapCatching { Completed(CollectBankAccountResponse(it, linkAccountSession)) } + .mapCatching { Completed(CollectBankAccountResponse(it, financialConnectionsSession)) } .onSuccess { result: Completed -> logger.debug("Bank account session attached to intent!!") finishWithResult(result) diff --git a/payments-core/src/main/java/com/stripe/android/payments/financialconnections/FinancialConnectionsPaymentsProxy.kt b/payments-core/src/main/java/com/stripe/android/payments/financialconnections/FinancialConnectionsPaymentsProxy.kt index 60b5d047530..144748833c2 100644 --- a/payments-core/src/main/java/com/stripe/android/payments/financialconnections/FinancialConnectionsPaymentsProxy.kt +++ b/payments-core/src/main/java/com/stripe/android/payments/financialconnections/FinancialConnectionsPaymentsProxy.kt @@ -12,7 +12,7 @@ import com.stripe.android.financialconnections.FinancialConnectionsSheetResult */ internal interface FinancialConnectionsPaymentsProxy { fun present( - linkAccountSessionClientSecret: String, + financialConnectionsSessionClientSecret: String, publishableKey: String ) @@ -63,12 +63,12 @@ internal class DefaultFinancialConnectionsPaymentsProxy( private val financialConnectionsSheet: FinancialConnectionsSheet ) : FinancialConnectionsPaymentsProxy { override fun present( - linkAccountSessionClientSecret: String, + financialConnectionsSessionClientSecret: String, publishableKey: String ) { financialConnectionsSheet.present( FinancialConnectionsSheet.Configuration( - linkAccountSessionClientSecret, + financialConnectionsSessionClientSecret, publishableKey ) ) @@ -76,7 +76,7 @@ internal class DefaultFinancialConnectionsPaymentsProxy( } internal class UnsupportedFinancialConnectionsPaymentsProxy : FinancialConnectionsPaymentsProxy { - override fun present(linkAccountSessionClientSecret: String, publishableKey: String) { + override fun present(financialConnectionsSessionClientSecret: String, publishableKey: String) { if (BuildConfig.DEBUG) { throw IllegalStateException( "Missing financial-connections dependency, please add it to your apps build.gradle" diff --git a/payments-core/src/test/java/com/stripe/android/networking/AbsFakeStripeRepository.kt b/payments-core/src/test/java/com/stripe/android/networking/AbsFakeStripeRepository.kt index a98bc29eb9c..86a87dcef26 100644 --- a/payments-core/src/test/java/com/stripe/android/networking/AbsFakeStripeRepository.kt +++ b/payments-core/src/test/java/com/stripe/android/networking/AbsFakeStripeRepository.kt @@ -5,7 +5,7 @@ import com.stripe.android.core.exception.APIException import com.stripe.android.core.model.StripeFile import com.stripe.android.core.model.StripeFileParams import com.stripe.android.core.networking.ApiRequest -import com.stripe.android.model.BankConnectionsLinkedAccountSession +import com.stripe.android.model.FinancialConnectionsSession import com.stripe.android.model.BankStatuses import com.stripe.android.model.BinFixtures import com.stripe.android.model.CardMetadata @@ -14,7 +14,7 @@ import com.stripe.android.model.ConfirmSetupIntentParams import com.stripe.android.model.ConsumerPaymentDetails import com.stripe.android.model.ConsumerSession import com.stripe.android.model.ConsumerSessionLookup -import com.stripe.android.model.CreateLinkAccountSessionParams +import com.stripe.android.model.CreateFinancialConnectionsSessionParams import com.stripe.android.model.Customer import com.stripe.android.model.ListPaymentMethodsParams import com.stripe.android.model.PaymentIntent @@ -333,37 +333,37 @@ internal abstract class AbsFakeStripeRepository : StripeRepository() { return null } - override suspend fun attachLinkAccountSessionToPaymentIntent( + override suspend fun attachFinancialConnectionsSessionToPaymentIntent( clientSecret: String, paymentIntentId: String, - linkAccountSessionId: String, + financialConnectionsSessionId: String, requestOptions: ApiRequest.Options ): PaymentIntent? { return null } - override suspend fun attachLinkAccountSessionToSetupIntent( + override suspend fun attachFinancialConnectionsSessionToSetupIntent( clientSecret: String, setupIntentId: String, - linkAccountSessionId: String, + financialConnectionsSessionId: String, requestOptions: ApiRequest.Options ): SetupIntent? { return null } - override suspend fun createPaymentIntentLinkAccountSession( + override suspend fun createPaymentIntentFinancialConnectionsSession( paymentIntentId: String, - params: CreateLinkAccountSessionParams, + params: CreateFinancialConnectionsSessionParams, requestOptions: ApiRequest.Options - ): BankConnectionsLinkedAccountSession? { + ): FinancialConnectionsSession? { return null } - override suspend fun createSetupIntentLinkAccountSession( + override suspend fun createSetupIntentFinancialConnectionsSession( setupIntentId: String, - params: CreateLinkAccountSessionParams, + params: CreateFinancialConnectionsSessionParams, requestOptions: ApiRequest.Options - ): BankConnectionsLinkedAccountSession? { + ): FinancialConnectionsSession? { return null } diff --git a/payments-core/src/test/java/com/stripe/android/networking/StripeApiRepositoryTest.kt b/payments-core/src/test/java/com/stripe/android/networking/StripeApiRepositoryTest.kt index f5b86e3688d..37219f800ca 100644 --- a/payments-core/src/test/java/com/stripe/android/networking/StripeApiRepositoryTest.kt +++ b/payments-core/src/test/java/com/stripe/android/networking/StripeApiRepositoryTest.kt @@ -30,7 +30,7 @@ import com.stripe.android.model.ConfirmPaymentIntentParams import com.stripe.android.model.ConfirmSetupIntentParams import com.stripe.android.model.ConfirmStripeIntentParams import com.stripe.android.model.ConsumerFixtures -import com.stripe.android.model.CreateLinkAccountSessionParams +import com.stripe.android.model.CreateFinancialConnectionsSessionParams import com.stripe.android.model.ListPaymentMethodsParams import com.stripe.android.model.PaymentIntent import com.stripe.android.model.PaymentIntentFixtures @@ -1815,7 +1815,7 @@ internal class StripeApiRepositoryTest { .thenReturn(stripeResponse) val clientSecret = "pi_client_secret_123" - val response = create().attachLinkAccountSessionToPaymentIntent( + val response = create().attachFinancialConnectionsSessionToPaymentIntent( clientSecret, "pi_12345", "las_123456", @@ -1832,7 +1832,7 @@ internal class StripeApiRepositoryTest { } @Test - fun `attachLinkAccountSessionToSetupIntent attaches LAS to SI`() = + fun `attachFinancialConnectionsSessionToSetupIntent attaches LAS to SI`() = runTest { val stripeResponse = StripeResponse( 200, @@ -1866,7 +1866,7 @@ internal class StripeApiRepositoryTest { .thenReturn(stripeResponse) val clientSecret = "si_client_secret_123" - val response = create().attachLinkAccountSessionToSetupIntent( + val response = create().attachFinancialConnectionsSessionToSetupIntent( clientSecret, "si_12345", "las_123456", @@ -1883,7 +1883,7 @@ internal class StripeApiRepositoryTest { } @Test - fun `paymentIntentsLinkAccountSession() sends all parameters`() = runTest { + fun `paymentIntentsFinancialConnectionsSession() sends all parameters`() = runTest { val stripeResponse = StripeResponse( 200, PaymentIntentFixtures.PI_LINK_ACCOUNT_SESSION_JSON.toString(), @@ -1896,9 +1896,9 @@ internal class StripeApiRepositoryTest { val id = "pi_1234" val customerName = "John Doe" val customerEmailAddress = "johndoe@gmail.com" - create().createPaymentIntentLinkAccountSession( + create().createPaymentIntentFinancialConnectionsSession( paymentIntentId = id, - params = CreateLinkAccountSessionParams( + params = CreateFinancialConnectionsSessionParams( clientSecret = clientSecret, customerName = customerName, customerEmailAddress = customerEmailAddress @@ -1926,7 +1926,7 @@ internal class StripeApiRepositoryTest { } @Test - fun `setupIntentsLinkAccountSession() sends all parameters`() = runTest { + fun `setupIntentsFinancialConnectionsSession() sends all parameters`() = runTest { val stripeResponse = StripeResponse( 200, PaymentIntentFixtures.SI_LINK_ACCOUNT_SESSION_JSON.toString(), @@ -1939,9 +1939,9 @@ internal class StripeApiRepositoryTest { val id = "seti_1234" val customerName = "John Doe" val customerEmailAddress = "johndoe@gmail.com" - create().createSetupIntentLinkAccountSession( + create().createSetupIntentFinancialConnectionsSession( setupIntentId = id, - params = CreateLinkAccountSessionParams( + params = CreateFinancialConnectionsSessionParams( clientSecret = clientSecret, customerName = customerName, customerEmailAddress = customerEmailAddress diff --git a/payments-core/src/test/java/com/stripe/android/payments/bankaccount/domain/AttachLinkAccountSessionTest.kt b/payments-core/src/test/java/com/stripe/android/payments/bankaccount/domain/AttachFinancialConnectionsSessionTest.kt similarity index 78% rename from payments-core/src/test/java/com/stripe/android/payments/bankaccount/domain/AttachLinkAccountSessionTest.kt rename to payments-core/src/test/java/com/stripe/android/payments/bankaccount/domain/AttachFinancialConnectionsSessionTest.kt index 85a7776df7a..5a8d77dd35a 100644 --- a/payments-core/src/test/java/com/stripe/android/payments/bankaccount/domain/AttachLinkAccountSessionTest.kt +++ b/payments-core/src/test/java/com/stripe/android/payments/bankaccount/domain/AttachFinancialConnectionsSessionTest.kt @@ -17,10 +17,10 @@ import org.mockito.kotlin.whenever import kotlin.test.assertTrue @ExperimentalCoroutinesApi -class AttachLinkAccountSessionTest { +class AttachFinancialConnectionsSessionTest { private val stripeRepository = mock() - private val attachLinkAccountSession = AttachLinkAccountSession(stripeRepository) + private val attachFinancialConnectionsSession = AttachFinancialConnectionsSession(stripeRepository) @Test fun `forPaymentIntent - given repository succeeds, linkedSession attached and paymentIntent returned`() { @@ -35,17 +35,17 @@ class AttachLinkAccountSessionTest { givenAttachPaymentIntentReturns { paymentIntent } // When - val result: Result = attachLinkAccountSession.forPaymentIntent( + val result: Result = attachFinancialConnectionsSession.forPaymentIntent( publishableKey, linkedAccountSessionId, clientSecret ) // Then - verify(stripeRepository).attachLinkAccountSessionToPaymentIntent( + verify(stripeRepository).attachFinancialConnectionsSessionToPaymentIntent( clientSecret = clientSecret, paymentIntentId = "pi_1234", - linkAccountSessionId = linkedAccountSessionId, + financialConnectionsSessionId = linkedAccountSessionId, requestOptions = ApiRequest.Options(publishableKey) ) assertThat((result)).isEqualTo(Result.success(paymentIntent)) @@ -62,17 +62,17 @@ class AttachLinkAccountSessionTest { givenAttachPaymentIntentReturns { null } // When - val result: Result = attachLinkAccountSession.forPaymentIntent( + val result: Result = attachFinancialConnectionsSession.forPaymentIntent( publishableKey, linkedAccountSessionId, clientSecret ) // Then - verify(stripeRepository).attachLinkAccountSessionToPaymentIntent( + verify(stripeRepository).attachFinancialConnectionsSessionToPaymentIntent( clientSecret = clientSecret, paymentIntentId = "pi_1234", - linkAccountSessionId = linkedAccountSessionId, + financialConnectionsSessionId = linkedAccountSessionId, requestOptions = ApiRequest.Options(publishableKey) ) assertThat(result.exceptionOrNull()!!).isInstanceOf(InternalError::class.java) @@ -90,17 +90,17 @@ class AttachLinkAccountSessionTest { givenAttachPaymentIntentReturns { throw expectedException } // When - val result: Result = attachLinkAccountSession.forPaymentIntent( + val result: Result = attachFinancialConnectionsSession.forPaymentIntent( publishableKey, linkedAccountSessionId, clientSecret ) // Then - verify(stripeRepository).attachLinkAccountSessionToPaymentIntent( + verify(stripeRepository).attachFinancialConnectionsSessionToPaymentIntent( clientSecret = clientSecret, paymentIntentId = "pi_1234", - linkAccountSessionId = linkedAccountSessionId, + financialConnectionsSessionId = linkedAccountSessionId, requestOptions = ApiRequest.Options(publishableKey) ) assertThat(result.exceptionOrNull()!!).isEqualTo(expectedException) @@ -118,7 +118,7 @@ class AttachLinkAccountSessionTest { givenAttachPaymentIntentReturns { paymentIntent } // When - val result: Result = attachLinkAccountSession.forPaymentIntent( + val result: Result = attachFinancialConnectionsSession.forPaymentIntent( publishableKey, linkedAccountSessionId, clientSecret @@ -142,17 +142,17 @@ class AttachLinkAccountSessionTest { givenAttachSetupIntentReturns { setupIntent } // When - val result: Result = attachLinkAccountSession.forSetupIntent( + val result: Result = attachFinancialConnectionsSession.forSetupIntent( publishableKey, linkedAccountSessionId, clientSecret ) // Then - verify(stripeRepository).attachLinkAccountSessionToSetupIntent( + verify(stripeRepository).attachFinancialConnectionsSessionToSetupIntent( clientSecret = clientSecret, setupIntentId = "seti_1234", - linkAccountSessionId = linkedAccountSessionId, + financialConnectionsSessionId = linkedAccountSessionId, requestOptions = ApiRequest.Options(publishableKey) ) assertThat((result)).isEqualTo(Result.success(setupIntent)) @@ -169,17 +169,17 @@ class AttachLinkAccountSessionTest { givenAttachSetupIntentReturns { null } // When - val setupIntent: Result = attachLinkAccountSession.forSetupIntent( + val setupIntent: Result = attachFinancialConnectionsSession.forSetupIntent( publishableKey, linkedAccountSessionId, clientSecret ) // Then - verify(stripeRepository).attachLinkAccountSessionToSetupIntent( + verify(stripeRepository).attachFinancialConnectionsSessionToSetupIntent( clientSecret = clientSecret, setupIntentId = "seti_1234", - linkAccountSessionId = linkedAccountSessionId, + financialConnectionsSessionId = linkedAccountSessionId, requestOptions = ApiRequest.Options(publishableKey) ) assertThat(setupIntent.exceptionOrNull()!!).isInstanceOf(InternalError::class.java) @@ -197,17 +197,17 @@ class AttachLinkAccountSessionTest { givenAttachSetupIntentReturns { throw expectedException } // When - val setupIntent: Result = attachLinkAccountSession.forSetupIntent( + val setupIntent: Result = attachFinancialConnectionsSession.forSetupIntent( publishableKey, linkedAccountSessionId, clientSecret ) // Then - verify(stripeRepository).attachLinkAccountSessionToSetupIntent( + verify(stripeRepository).attachFinancialConnectionsSessionToSetupIntent( clientSecret = clientSecret, setupIntentId = "seti_1234", - linkAccountSessionId = linkedAccountSessionId, + financialConnectionsSessionId = linkedAccountSessionId, requestOptions = ApiRequest.Options(publishableKey) ) assertThat(setupIntent.exceptionOrNull()!!).isEqualTo(expectedException) @@ -225,7 +225,7 @@ class AttachLinkAccountSessionTest { givenAttachSetupIntentReturns { resultSetupIntent } // When - val setupIntent: Result = attachLinkAccountSession.forSetupIntent( + val setupIntent: Result = attachFinancialConnectionsSession.forSetupIntent( publishableKey, linkedAccountSessionId, clientSecret @@ -238,7 +238,7 @@ class AttachLinkAccountSessionTest { private suspend fun givenAttachPaymentIntentReturns(paymentIntent: () -> PaymentIntent?) { whenever( - stripeRepository.attachLinkAccountSessionToPaymentIntent( + stripeRepository.attachFinancialConnectionsSessionToPaymentIntent( any(), any(), any(), @@ -249,7 +249,7 @@ class AttachLinkAccountSessionTest { private suspend fun givenAttachSetupIntentReturns(setupIntent: () -> SetupIntent?) { whenever( - stripeRepository.attachLinkAccountSessionToSetupIntent( + stripeRepository.attachFinancialConnectionsSessionToSetupIntent( any(), any(), any(), diff --git a/payments-core/src/test/java/com/stripe/android/payments/bankaccount/domain/CreateLinkAccountSessionTest.kt b/payments-core/src/test/java/com/stripe/android/payments/bankaccount/domain/CreateFinancialConnectionsSessionTest.kt similarity index 74% rename from payments-core/src/test/java/com/stripe/android/payments/bankaccount/domain/CreateLinkAccountSessionTest.kt rename to payments-core/src/test/java/com/stripe/android/payments/bankaccount/domain/CreateFinancialConnectionsSessionTest.kt index 4a8103c94a9..5d7de95ba00 100644 --- a/payments-core/src/test/java/com/stripe/android/payments/bankaccount/domain/CreateLinkAccountSessionTest.kt +++ b/payments-core/src/test/java/com/stripe/android/payments/bankaccount/domain/CreateFinancialConnectionsSessionTest.kt @@ -3,8 +3,8 @@ package com.stripe.android.payments.bankaccount.domain import com.google.common.truth.Truth.assertThat import com.stripe.android.core.exception.APIException import com.stripe.android.core.networking.ApiRequest -import com.stripe.android.model.BankConnectionsLinkedAccountSession -import com.stripe.android.model.CreateLinkAccountSessionParams +import com.stripe.android.model.FinancialConnectionsSession +import com.stripe.android.model.CreateFinancialConnectionsSessionParams import com.stripe.android.networking.StripeRepository import kotlinx.coroutines.ExperimentalCoroutinesApi import kotlinx.coroutines.test.runTest @@ -16,13 +16,13 @@ import org.mockito.kotlin.whenever import kotlin.test.assertTrue @ExperimentalCoroutinesApi -class CreateLinkAccountSessionTest { +class CreateFinancialConnectionsSessionTest { private val stripeRepository = mock() - private val createLinkAccountSession = CreateLinkAccountSession(stripeRepository) + private val createFinancialConnectionsSession = CreateFinancialConnectionsSession(stripeRepository) private val customerName = "name" - private val linkedAccountSession = BankConnectionsLinkedAccountSession( + private val linkedAccountSession = FinancialConnectionsSession( "session_secret", "session_id" ) @@ -36,8 +36,8 @@ class CreateLinkAccountSessionTest { givenCreateSessionWithPaymentIntentReturns { linkedAccountSession } // When - val paymentIntent: Result = - createLinkAccountSession.forPaymentIntent( + val paymentIntent: Result = + createFinancialConnectionsSession.forPaymentIntent( publishableKey = publishableKey, clientSecret = clientSecret, customerName = customerName, @@ -45,9 +45,9 @@ class CreateLinkAccountSessionTest { ) // Then - verify(stripeRepository).createPaymentIntentLinkAccountSession( + verify(stripeRepository).createPaymentIntentFinancialConnectionsSession( paymentIntentId = "pi_1234", - params = CreateLinkAccountSessionParams( + params = CreateFinancialConnectionsSessionParams( clientSecret, customerName, null @@ -67,8 +67,8 @@ class CreateLinkAccountSessionTest { givenCreateSessionWithPaymentIntentReturns { null } // When - val paymentIntent: Result = - createLinkAccountSession.forPaymentIntent( + val paymentIntent: Result = + createFinancialConnectionsSession.forPaymentIntent( publishableKey = publishableKey, clientSecret = clientSecret, customerName = customerName, @@ -76,9 +76,9 @@ class CreateLinkAccountSessionTest { ) // Then - verify(stripeRepository).createPaymentIntentLinkAccountSession( + verify(stripeRepository).createPaymentIntentFinancialConnectionsSession( paymentIntentId = "pi_1234", - params = CreateLinkAccountSessionParams( + params = CreateFinancialConnectionsSessionParams( clientSecret, customerName, null @@ -101,8 +101,8 @@ class CreateLinkAccountSessionTest { givenCreateSessionWithPaymentIntentReturns { throw expectedException } // When - val paymentIntent: Result = - createLinkAccountSession.forPaymentIntent( + val paymentIntent: Result = + createFinancialConnectionsSession.forPaymentIntent( publishableKey = publishableKey, clientSecret = clientSecret, customerName = customerName, @@ -110,12 +110,12 @@ class CreateLinkAccountSessionTest { ) // Then - verify(stripeRepository).createPaymentIntentLinkAccountSession( + verify(stripeRepository).createPaymentIntentFinancialConnectionsSession( paymentIntentId = "pi_1234", - params = CreateLinkAccountSessionParams( - clientSecret, - customerName, - null + params = CreateFinancialConnectionsSessionParams( + clientSecret = clientSecret, + customerName = customerName, + customerEmailAddress = null ), requestOptions = ApiRequest.Options(publishableKey) ) @@ -132,8 +132,8 @@ class CreateLinkAccountSessionTest { givenCreateSessionWithPaymentIntentReturns { linkedAccountSession } // When - val paymentIntent: Result = - createLinkAccountSession.forPaymentIntent( + val paymentIntent: Result = + createFinancialConnectionsSession.forPaymentIntent( publishableKey = publishableKey, clientSecret = clientSecret, customerName = customerName, @@ -154,8 +154,8 @@ class CreateLinkAccountSessionTest { givenCreateSessionWithSetupIntentReturns { linkedAccountSession } // When - val paymentIntent: Result = - createLinkAccountSession.forSetupIntent( + val paymentIntent: Result = + createFinancialConnectionsSession.forSetupIntent( publishableKey = publishableKey, clientSecret = clientSecret, customerName = customerName, @@ -163,9 +163,9 @@ class CreateLinkAccountSessionTest { ) // Then - verify(stripeRepository).createSetupIntentLinkAccountSession( + verify(stripeRepository).createSetupIntentFinancialConnectionsSession( setupIntentId = "seti_1234", - params = CreateLinkAccountSessionParams( + params = CreateFinancialConnectionsSessionParams( clientSecret, customerName, null @@ -185,8 +185,8 @@ class CreateLinkAccountSessionTest { givenCreateSessionWithSetupIntentReturns { null } // When - val paymentIntent: Result = - createLinkAccountSession.forSetupIntent( + val paymentIntent: Result = + createFinancialConnectionsSession.forSetupIntent( publishableKey = publishableKey, clientSecret = clientSecret, customerName = customerName, @@ -194,9 +194,9 @@ class CreateLinkAccountSessionTest { ) // Then - verify(stripeRepository).createSetupIntentLinkAccountSession( + verify(stripeRepository).createSetupIntentFinancialConnectionsSession( setupIntentId = "seti_1234", - params = CreateLinkAccountSessionParams( + params = CreateFinancialConnectionsSessionParams( clientSecret, customerName, null @@ -218,8 +218,8 @@ class CreateLinkAccountSessionTest { givenCreateSessionWithSetupIntentReturns { throw expectedException } // When - val paymentIntent: Result = - createLinkAccountSession.forSetupIntent( + val paymentIntent: Result = + createFinancialConnectionsSession.forSetupIntent( publishableKey = publishableKey, clientSecret = clientSecret, customerName = customerName, @@ -227,9 +227,9 @@ class CreateLinkAccountSessionTest { ) // Then - verify(stripeRepository).createSetupIntentLinkAccountSession( + verify(stripeRepository).createSetupIntentFinancialConnectionsSession( setupIntentId = "seti_1234", - params = CreateLinkAccountSessionParams( + params = CreateFinancialConnectionsSessionParams( clientSecret, customerName, null @@ -249,8 +249,8 @@ class CreateLinkAccountSessionTest { givenCreateSessionWithSetupIntentReturns { linkedAccountSession } // When - val paymentIntent: Result = - createLinkAccountSession.forSetupIntent( + val paymentIntent: Result = + createFinancialConnectionsSession.forSetupIntent( publishableKey = publishableKey, clientSecret = clientSecret, customerName = customerName, @@ -263,10 +263,10 @@ class CreateLinkAccountSessionTest { } private suspend fun givenCreateSessionWithPaymentIntentReturns( - session: () -> BankConnectionsLinkedAccountSession? + session: () -> FinancialConnectionsSession? ) { whenever( - stripeRepository.createPaymentIntentLinkAccountSession( + stripeRepository.createPaymentIntentFinancialConnectionsSession( any(), any(), any(), @@ -275,10 +275,10 @@ class CreateLinkAccountSessionTest { } private suspend fun givenCreateSessionWithSetupIntentReturns( - session: () -> BankConnectionsLinkedAccountSession? + session: () -> FinancialConnectionsSession? ) { whenever( - stripeRepository.createSetupIntentLinkAccountSession( + stripeRepository.createSetupIntentFinancialConnectionsSession( any(), any(), any(), diff --git a/payments-core/src/test/java/com/stripe/android/payments/bankaccount/ui/CollectBankAccountViewModelTest.kt b/payments-core/src/test/java/com/stripe/android/payments/bankaccount/ui/CollectBankAccountViewModelTest.kt index 34b20168793..07595348e6a 100644 --- a/payments-core/src/test/java/com/stripe/android/payments/bankaccount/ui/CollectBankAccountViewModelTest.kt +++ b/payments-core/src/test/java/com/stripe/android/payments/bankaccount/ui/CollectBankAccountViewModelTest.kt @@ -4,14 +4,14 @@ import app.cash.turbine.test import com.google.common.truth.Truth.assertThat import com.stripe.android.core.Logger import com.stripe.android.financialconnections.FinancialConnectionsSheetResult -import com.stripe.android.financialconnections.model.LinkAccountSession -import com.stripe.android.model.BankConnectionsLinkedAccountSession +import com.stripe.android.financialconnections.model.FinancialConnectionsSession as PaymentsFinancialConnectionsSession +import com.stripe.android.model.FinancialConnectionsSession import com.stripe.android.model.PaymentIntent import com.stripe.android.model.SetupIntent import com.stripe.android.model.StripeIntent import com.stripe.android.payments.bankaccount.CollectBankAccountConfiguration -import com.stripe.android.payments.bankaccount.domain.AttachLinkAccountSession -import com.stripe.android.payments.bankaccount.domain.CreateLinkAccountSession +import com.stripe.android.payments.bankaccount.domain.AttachFinancialConnectionsSession +import com.stripe.android.payments.bankaccount.domain.CreateFinancialConnectionsSession import com.stripe.android.payments.bankaccount.domain.RetrieveStripeIntent import com.stripe.android.payments.bankaccount.navigation.CollectBankAccountContract import com.stripe.android.payments.bankaccount.navigation.CollectBankAccountContract.Args.ForPaymentIntent @@ -38,8 +38,8 @@ import org.robolectric.RobolectricTestRunner @RunWith(RobolectricTestRunner::class) class CollectBankAccountViewModelTest { - private val createLinkAccountSession: CreateLinkAccountSession = mock() - private val attachLinkAccountSession: AttachLinkAccountSession = mock() + private val createFinancialConnectionsSession: CreateFinancialConnectionsSession = mock() + private val attachFinancialConnectionsSession: AttachFinancialConnectionsSession = mock() private val retrieveStripeIntent: RetrieveStripeIntent = mock() private val publishableKey = "publishable_key" @@ -48,22 +48,22 @@ class CollectBankAccountViewModelTest { private val email = "email" private val linkedAccountSessionId = "las_id" private val linkedAccountSessionClientSecret = "las_client_secret" - private val linkedAccountSession = BankConnectionsLinkedAccountSession( + private val financialConnectionsSession = FinancialConnectionsSession( clientSecret = linkedAccountSessionClientSecret, id = linkedAccountSessionId ) - private val linkAccountSession = mock { + private val paymentsFinancialConnectionsSession = mock { on { this.clientSecret } doReturn "client_secret" on { this.id } doReturn linkedAccountSessionId } @Test - fun `init - when createLinkAccountSession succeeds for PI, opens connection flow`() = runTest { + fun `init - when createFinancialConnectionsSession succeeds for PI, opens connection flow`() = runTest { val viewEffect = MutableSharedFlow() viewEffect.test { // Given - givenCreateAccountSessionForPaymentIntentReturns(Result.success(linkedAccountSession)) + givenCreateAccountSessionForPaymentIntentReturns(Result.success(financialConnectionsSession)) // When buildViewModel(viewEffect, paymentIntentConfiguration()) @@ -72,18 +72,18 @@ class CollectBankAccountViewModelTest { assertThat(awaitItem()).isEqualTo( OpenConnectionsFlow( publishableKey, - linkedAccountSession.clientSecret!! + financialConnectionsSession.clientSecret!! ) ) } } @Test - fun `init - when createLinkAccountSession succeeds for SI, opens connection flow`() = runTest { + fun `init - when createFinancialConnectionsSession succeeds for SI, opens connection flow`() = runTest { val viewEffect = MutableSharedFlow() viewEffect.test { // Given - givenCreateAccountSessionForSetupIntentReturns(Result.success(linkedAccountSession)) + givenCreateAccountSessionForSetupIntentReturns(Result.success(financialConnectionsSession)) // When buildViewModel(viewEffect, setupIntentConfiguration()) @@ -92,7 +92,7 @@ class CollectBankAccountViewModelTest { assertThat(awaitItem()).isEqualTo( OpenConnectionsFlow( publishableKey, - linkedAccountSession.clientSecret!! + financialConnectionsSession.clientSecret!! ) ) } @@ -103,18 +103,18 @@ class CollectBankAccountViewModelTest { val viewEffect = MutableSharedFlow() viewEffect.test { // Given - givenCreateAccountSessionForPaymentIntentReturns(Result.success(linkedAccountSession)) + givenCreateAccountSessionForPaymentIntentReturns(Result.success(financialConnectionsSession)) givenRetrieveStripeIntentReturns(Result.success(mock())) // When val viewModel = buildViewModel(viewEffect, paymentIntentConfiguration(attachToIntent = false)) viewModel.onConnectionsResult( - FinancialConnectionsSheetResult.Completed(linkAccountSession) + FinancialConnectionsSheetResult.Completed(paymentsFinancialConnectionsSession) ) // Then cancelAndConsumeRemainingEvents() - verify(attachLinkAccountSession, never()).forPaymentIntent(any(), any(), any()) + verify(attachFinancialConnectionsSession, never()).forPaymentIntent(any(), any(), any()) } } @@ -123,23 +123,23 @@ class CollectBankAccountViewModelTest { val viewEffect = MutableSharedFlow() viewEffect.test { // Given - givenCreateAccountSessionForSetupIntentReturns(Result.success(linkedAccountSession)) + givenCreateAccountSessionForSetupIntentReturns(Result.success(financialConnectionsSession)) givenRetrieveStripeIntentReturns(Result.success(mock())) // When val viewModel = buildViewModel(viewEffect, setupIntentConfiguration(attachToIntent = false)) viewModel.onConnectionsResult( - FinancialConnectionsSheetResult.Completed(linkAccountSession) + FinancialConnectionsSheetResult.Completed(paymentsFinancialConnectionsSession) ) // Then cancelAndConsumeRemainingEvents() - verify(attachLinkAccountSession, never()).forSetupIntent(any(), any(), any()) + verify(attachFinancialConnectionsSession, never()).forSetupIntent(any(), any(), any()) } } @Test - fun `init - when createLinkAccountSession fails, finish with error`() = runTest { + fun `init - when createFinancialConnectionsSession fails, finish with error`() = runTest { val viewEffect = MutableSharedFlow() viewEffect.test { // Given @@ -164,20 +164,20 @@ class CollectBankAccountViewModelTest { viewEffect.test { // Given val paymentIntent = mock() - givenCreateAccountSessionForPaymentIntentReturns(Result.success(linkedAccountSession)) + givenCreateAccountSessionForPaymentIntentReturns(Result.success(financialConnectionsSession)) givenAttachAccountSessionForPaymentIntentReturns(Result.success(paymentIntent)) // When val viewModel = buildViewModel(viewEffect, paymentIntentConfiguration()) viewModel.onConnectionsResult( - FinancialConnectionsSheetResult.Completed(linkAccountSession) + FinancialConnectionsSheetResult.Completed(paymentsFinancialConnectionsSession) ) // Then assertThat(expectMostRecentItem()).isEqualTo( FinishWithResult( - Completed(CollectBankAccountResponse(paymentIntent, linkAccountSession)) + Completed(CollectBankAccountResponse(paymentIntent, paymentsFinancialConnectionsSession)) ) ) } @@ -189,19 +189,19 @@ class CollectBankAccountViewModelTest { viewEffect.test { // Given val setupIntent = mock() - givenCreateAccountSessionForSetupIntentReturns(Result.success(linkedAccountSession)) + givenCreateAccountSessionForSetupIntentReturns(Result.success(financialConnectionsSession)) givenAttachAccountSessionForSetupIntentReturns(Result.success(setupIntent)) // When val viewModel = buildViewModel(viewEffect, setupIntentConfiguration()) viewModel.onConnectionsResult( - FinancialConnectionsSheetResult.Completed(linkAccountSession) + FinancialConnectionsSheetResult.Completed(paymentsFinancialConnectionsSession) ) // Then assertThat(expectMostRecentItem()).isEqualTo( FinishWithResult( - Completed(CollectBankAccountResponse(setupIntent, linkAccountSession)) + Completed(CollectBankAccountResponse(setupIntent, paymentsFinancialConnectionsSession)) ) ) } @@ -213,13 +213,13 @@ class CollectBankAccountViewModelTest { viewEffect.test { // Given val expectedException = Exception("Random error") - givenCreateAccountSessionForSetupIntentReturns(Result.success(linkedAccountSession)) + givenCreateAccountSessionForSetupIntentReturns(Result.success(financialConnectionsSession)) givenAttachAccountSessionForSetupIntentReturns(Result.failure(expectedException)) // When val viewModel = buildViewModel(viewEffect, setupIntentConfiguration()) viewModel.onConnectionsResult( - FinancialConnectionsSheetResult.Completed(linkAccountSession) + FinancialConnectionsSheetResult.Completed(paymentsFinancialConnectionsSession) ) // Then @@ -232,9 +232,9 @@ class CollectBankAccountViewModelTest { } private fun givenCreateAccountSessionForPaymentIntentReturns( - result: Result + result: Result ) { - createLinkAccountSession.stub { + createFinancialConnectionsSession.stub { onBlocking { forPaymentIntent( publishableKey = publishableKey, @@ -249,7 +249,7 @@ class CollectBankAccountViewModelTest { private fun givenAttachAccountSessionForPaymentIntentReturns( result: Result ) { - attachLinkAccountSession.stub { + attachFinancialConnectionsSession.stub { onBlocking { forPaymentIntent( publishableKey = publishableKey, @@ -263,7 +263,7 @@ class CollectBankAccountViewModelTest { private fun givenAttachAccountSessionForSetupIntentReturns( result: Result ) { - attachLinkAccountSession.stub { + attachFinancialConnectionsSession.stub { onBlocking { forSetupIntent( publishableKey = publishableKey, @@ -275,9 +275,9 @@ class CollectBankAccountViewModelTest { } private fun givenCreateAccountSessionForSetupIntentReturns( - result: Result + result: Result ) { - createLinkAccountSession.stub { + createFinancialConnectionsSession.stub { onBlocking { forSetupIntent( publishableKey = publishableKey, @@ -307,8 +307,8 @@ class CollectBankAccountViewModelTest { configuration: CollectBankAccountContract.Args ) = CollectBankAccountViewModel( args = configuration, - createLinkAccountSession = createLinkAccountSession, - attachLinkAccountSession = attachLinkAccountSession, + createFinancialConnectionsSession = createFinancialConnectionsSession, + attachFinancialConnectionsSession = attachFinancialConnectionsSession, retrieveStripeIntent = retrieveStripeIntent, logger = Logger.noop(), _viewEffect = viewEffect diff --git a/payments-core/src/test/java/com/stripe/android/payments/financialconnections/FinancialConnectionsPaymentsProxyTest.kt b/payments-core/src/test/java/com/stripe/android/payments/financialconnections/FinancialConnectionsPaymentsProxyTest.kt index 57c3862f7d6..ee8c15ef625 100644 --- a/payments-core/src/test/java/com/stripe/android/payments/financialconnections/FinancialConnectionsPaymentsProxyTest.kt +++ b/payments-core/src/test/java/com/stripe/android/payments/financialconnections/FinancialConnectionsPaymentsProxyTest.kt @@ -21,7 +21,7 @@ class FinancialConnectionsPaymentsProxyTest { private val mockActivity: AppCompatActivity = mock() private class FakeProxy : FinancialConnectionsPaymentsProxy { - override fun present(linkAccountSessionClientSecret: String, publishableKey: String) { + override fun present(financialConnectionsSessionClientSecret: String, publishableKey: String) { // noop } } From 0dd49878b42dee80cce461c0f56d8fdd3bc45fc2 Mon Sep 17 00:00:00 2001 From: Carlos Munoz Date: Mon, 25 Apr 2022 11:13:01 -0700 Subject: [PATCH 02/12] Renames endpoints (WIP) --- ...ancialFinancialConnectionsApiRepository.kt | 29 +++++++------------ 1 file changed, 10 insertions(+), 19 deletions(-) diff --git a/financial-connections/src/main/java/com/stripe/android/financialconnections/repository/FinancialFinancialConnectionsApiRepository.kt b/financial-connections/src/main/java/com/stripe/android/financialconnections/repository/FinancialFinancialConnectionsApiRepository.kt index dd5d929bd6d..26060003310 100644 --- a/financial-connections/src/main/java/com/stripe/android/financialconnections/repository/FinancialFinancialConnectionsApiRepository.kt +++ b/financial-connections/src/main/java/com/stripe/android/financialconnections/repository/FinancialFinancialConnectionsApiRepository.kt @@ -79,7 +79,10 @@ internal class FinancialFinancialConnectionsApiRepository @Inject constructor( PARAMS_APPLICATION_ID to applicationId ), ) - return executeRequest(financialConnectionsRequest, FinancialConnectionsSessionManifest.serializer()) + return executeRequest( + financialConnectionsRequest, + FinancialConnectionsSessionManifest.serializer() + ) } private suspend fun executeRequest( @@ -137,26 +140,14 @@ internal class FinancialFinancialConnectionsApiRepository @Inject constructor( internal const val PARAMS_CLIENT_SECRET = "client_secret" internal const val PARAMS_APPLICATION_ID = "application_id" - /** - * @return `https://api.stripe.com/v1/link_account_sessions/list_accounts` - */ - internal val listAccountsUrl: String - @JvmSynthetic - get() = getApiUrl("list_accounts") + internal const val listAccountsUrl: String = + "$API_HOST/v1/financial_connections/list_accounts" - /** - * @return `https://api.stripe.com/v1/link_account_sessions/generate_hosted_url` - */ - internal val generateHostedUrl: String - @JvmSynthetic - get() = getApiUrl("generate_hosted_url") + internal const val generateHostedUrl: String = + "$API_HOST/v1/financial_connections/generate_hosted_url" - internal val sessionReceiptUrl: String - @JvmSynthetic - get() = getApiUrl("session_receipt") + internal const val sessionReceiptUrl: String = + "$API_HOST/v1/financial_connections/session_receipt" - private fun getApiUrl(path: String): String { - return "$API_HOST/v1/link_account_sessions/$path" - } } } From 926e4de91bc7f0eaad5c75c31f84e3807211095b Mon Sep 17 00:00:00 2001 From: Carlos Munoz Date: Tue, 26 Apr 2022 11:59:05 -0700 Subject: [PATCH 03/12] Style fixes. --- .../repository/FinancialFinancialConnectionsApiRepository.kt | 1 - .../launcher/DefaultFinancialConnectionsSheetLauncherTest.kt | 2 +- .../launcher/FinancialConnectionsSheetForTokenLauncherTest.kt | 2 +- .../java/com/stripe/android/networking/StripeApiRepository.kt | 4 ++-- .../java/com/stripe/android/networking/StripeRepository.kt | 2 +- .../bankaccount/domain/CreateFinancialConnectionsSession.kt | 2 +- .../com/stripe/android/networking/AbsFakeStripeRepository.kt | 2 +- .../domain/CreateFinancialConnectionsSessionTest.kt | 2 +- .../bankaccount/ui/CollectBankAccountViewModelTest.kt | 2 +- 9 files changed, 9 insertions(+), 10 deletions(-) diff --git a/financial-connections/src/main/java/com/stripe/android/financialconnections/repository/FinancialFinancialConnectionsApiRepository.kt b/financial-connections/src/main/java/com/stripe/android/financialconnections/repository/FinancialFinancialConnectionsApiRepository.kt index 26060003310..9ade34d0d92 100644 --- a/financial-connections/src/main/java/com/stripe/android/financialconnections/repository/FinancialFinancialConnectionsApiRepository.kt +++ b/financial-connections/src/main/java/com/stripe/android/financialconnections/repository/FinancialFinancialConnectionsApiRepository.kt @@ -148,6 +148,5 @@ internal class FinancialFinancialConnectionsApiRepository @Inject constructor( internal const val sessionReceiptUrl: String = "$API_HOST/v1/financial_connections/session_receipt" - } } diff --git a/financial-connections/src/test/java/com/stripe/android/financialconnections/launcher/DefaultFinancialConnectionsSheetLauncherTest.kt b/financial-connections/src/test/java/com/stripe/android/financialconnections/launcher/DefaultFinancialConnectionsSheetLauncherTest.kt index b5e4e9db21a..d1a9394734f 100644 --- a/financial-connections/src/test/java/com/stripe/android/financialconnections/launcher/DefaultFinancialConnectionsSheetLauncherTest.kt +++ b/financial-connections/src/test/java/com/stripe/android/financialconnections/launcher/DefaultFinancialConnectionsSheetLauncherTest.kt @@ -6,8 +6,8 @@ import com.google.common.truth.Truth.assertThat import com.stripe.android.financialconnections.FinancialConnectionsSheet import com.stripe.android.financialconnections.FinancialConnectionsSheetContract import com.stripe.android.financialconnections.FinancialConnectionsSheetResult -import com.stripe.android.financialconnections.launcher.DefaultFinancialConnectionsSheetLauncher import com.stripe.android.financialconnections.financialConnectionsSessionWithNoMoreAccounts +import com.stripe.android.financialconnections.launcher.DefaultFinancialConnectionsSheetLauncher import com.stripe.android.financialconnections.utils.FakeActivityResultRegistry import com.stripe.android.financialconnections.utils.TestFragment import org.junit.Test diff --git a/financial-connections/src/test/java/com/stripe/android/financialconnections/launcher/FinancialConnectionsSheetForTokenLauncherTest.kt b/financial-connections/src/test/java/com/stripe/android/financialconnections/launcher/FinancialConnectionsSheetForTokenLauncherTest.kt index c11163d1fc7..017be8ea7ed 100644 --- a/financial-connections/src/test/java/com/stripe/android/financialconnections/launcher/FinancialConnectionsSheetForTokenLauncherTest.kt +++ b/financial-connections/src/test/java/com/stripe/android/financialconnections/launcher/FinancialConnectionsSheetForTokenLauncherTest.kt @@ -7,8 +7,8 @@ import com.stripe.android.connections.FinancialConnectionsSheetForTokenResult import com.stripe.android.financialconnections.FinancialConnectionsSheet import com.stripe.android.financialconnections.FinancialConnectionsSheetContract import com.stripe.android.financialconnections.bankAccountToken -import com.stripe.android.financialconnections.launcher.FinancialConnectionsSheetForTokenLauncher import com.stripe.android.financialconnections.financialConnectionsSessionWithNoMoreAccounts +import com.stripe.android.financialconnections.launcher.FinancialConnectionsSheetForTokenLauncher import com.stripe.android.financialconnections.utils.FakeActivityResultRegistry import com.stripe.android.financialconnections.utils.TestFragment import org.junit.Test diff --git a/payments-core/src/main/java/com/stripe/android/networking/StripeApiRepository.kt b/payments-core/src/main/java/com/stripe/android/networking/StripeApiRepository.kt index 2fa40e39848..a7635d25f2c 100644 --- a/payments-core/src/main/java/com/stripe/android/networking/StripeApiRepository.kt +++ b/payments-core/src/main/java/com/stripe/android/networking/StripeApiRepository.kt @@ -38,7 +38,6 @@ import com.stripe.android.core.networking.StripeResponse import com.stripe.android.core.networking.responseJson import com.stripe.android.core.version.StripeSdkVersion import com.stripe.android.exception.CardException -import com.stripe.android.model.FinancialConnectionsSession import com.stripe.android.model.BankStatuses import com.stripe.android.model.CardMetadata import com.stripe.android.model.ConfirmPaymentIntentParams @@ -50,6 +49,7 @@ import com.stripe.android.model.ConsumerSession import com.stripe.android.model.ConsumerSessionLookup import com.stripe.android.model.CreateFinancialConnectionsSessionParams import com.stripe.android.model.Customer +import com.stripe.android.model.FinancialConnectionsSession import com.stripe.android.model.ListPaymentMethodsParams import com.stripe.android.model.PaymentIntent import com.stripe.android.model.PaymentMethod @@ -64,12 +64,12 @@ import com.stripe.android.model.Stripe3ds2AuthResult import com.stripe.android.model.StripeIntent import com.stripe.android.model.Token import com.stripe.android.model.TokenParams -import com.stripe.android.model.parsers.FinancialConnectionsSessionJsonParser import com.stripe.android.model.parsers.CardMetadataJsonParser import com.stripe.android.model.parsers.ConsumerPaymentDetailsJsonParser import com.stripe.android.model.parsers.ConsumerSessionJsonParser import com.stripe.android.model.parsers.ConsumerSessionLookupJsonParser import com.stripe.android.model.parsers.CustomerJsonParser +import com.stripe.android.model.parsers.FinancialConnectionsSessionJsonParser import com.stripe.android.model.parsers.FpxBankStatusesJsonParser import com.stripe.android.model.parsers.IssuingCardPinJsonParser import com.stripe.android.model.parsers.PaymentIntentJsonParser diff --git a/payments-core/src/main/java/com/stripe/android/networking/StripeRepository.kt b/payments-core/src/main/java/com/stripe/android/networking/StripeRepository.kt index 7d84db1a54e..5285516e8f3 100644 --- a/payments-core/src/main/java/com/stripe/android/networking/StripeRepository.kt +++ b/payments-core/src/main/java/com/stripe/android/networking/StripeRepository.kt @@ -11,7 +11,6 @@ import com.stripe.android.core.model.StripeFile import com.stripe.android.core.model.StripeFileParams import com.stripe.android.core.networking.ApiRequest import com.stripe.android.exception.CardException -import com.stripe.android.model.FinancialConnectionsSession import com.stripe.android.model.BankStatuses import com.stripe.android.model.CardMetadata import com.stripe.android.model.ConfirmPaymentIntentParams @@ -21,6 +20,7 @@ import com.stripe.android.model.ConsumerSession import com.stripe.android.model.ConsumerSessionLookup import com.stripe.android.model.CreateFinancialConnectionsSessionParams import com.stripe.android.model.Customer +import com.stripe.android.model.FinancialConnectionsSession import com.stripe.android.model.ListPaymentMethodsParams import com.stripe.android.model.PaymentIntent import com.stripe.android.model.PaymentMethod diff --git a/payments-core/src/main/java/com/stripe/android/payments/bankaccount/domain/CreateFinancialConnectionsSession.kt b/payments-core/src/main/java/com/stripe/android/payments/bankaccount/domain/CreateFinancialConnectionsSession.kt index 164466d9d28..f31b49c7d0c 100644 --- a/payments-core/src/main/java/com/stripe/android/payments/bankaccount/domain/CreateFinancialConnectionsSession.kt +++ b/payments-core/src/main/java/com/stripe/android/payments/bankaccount/domain/CreateFinancialConnectionsSession.kt @@ -1,8 +1,8 @@ package com.stripe.android.payments.bankaccount.domain import com.stripe.android.core.networking.ApiRequest -import com.stripe.android.model.FinancialConnectionsSession import com.stripe.android.model.CreateFinancialConnectionsSessionParams +import com.stripe.android.model.FinancialConnectionsSession import com.stripe.android.model.PaymentIntent import com.stripe.android.model.SetupIntent import com.stripe.android.networking.StripeRepository diff --git a/payments-core/src/test/java/com/stripe/android/networking/AbsFakeStripeRepository.kt b/payments-core/src/test/java/com/stripe/android/networking/AbsFakeStripeRepository.kt index 86a87dcef26..a80b0a5c728 100644 --- a/payments-core/src/test/java/com/stripe/android/networking/AbsFakeStripeRepository.kt +++ b/payments-core/src/test/java/com/stripe/android/networking/AbsFakeStripeRepository.kt @@ -5,7 +5,6 @@ import com.stripe.android.core.exception.APIException import com.stripe.android.core.model.StripeFile import com.stripe.android.core.model.StripeFileParams import com.stripe.android.core.networking.ApiRequest -import com.stripe.android.model.FinancialConnectionsSession import com.stripe.android.model.BankStatuses import com.stripe.android.model.BinFixtures import com.stripe.android.model.CardMetadata @@ -16,6 +15,7 @@ import com.stripe.android.model.ConsumerSession import com.stripe.android.model.ConsumerSessionLookup import com.stripe.android.model.CreateFinancialConnectionsSessionParams import com.stripe.android.model.Customer +import com.stripe.android.model.FinancialConnectionsSession import com.stripe.android.model.ListPaymentMethodsParams import com.stripe.android.model.PaymentIntent import com.stripe.android.model.PaymentMethod diff --git a/payments-core/src/test/java/com/stripe/android/payments/bankaccount/domain/CreateFinancialConnectionsSessionTest.kt b/payments-core/src/test/java/com/stripe/android/payments/bankaccount/domain/CreateFinancialConnectionsSessionTest.kt index 5d7de95ba00..933c7c7d839 100644 --- a/payments-core/src/test/java/com/stripe/android/payments/bankaccount/domain/CreateFinancialConnectionsSessionTest.kt +++ b/payments-core/src/test/java/com/stripe/android/payments/bankaccount/domain/CreateFinancialConnectionsSessionTest.kt @@ -3,8 +3,8 @@ package com.stripe.android.payments.bankaccount.domain import com.google.common.truth.Truth.assertThat import com.stripe.android.core.exception.APIException import com.stripe.android.core.networking.ApiRequest -import com.stripe.android.model.FinancialConnectionsSession import com.stripe.android.model.CreateFinancialConnectionsSessionParams +import com.stripe.android.model.FinancialConnectionsSession import com.stripe.android.networking.StripeRepository import kotlinx.coroutines.ExperimentalCoroutinesApi import kotlinx.coroutines.test.runTest diff --git a/payments-core/src/test/java/com/stripe/android/payments/bankaccount/ui/CollectBankAccountViewModelTest.kt b/payments-core/src/test/java/com/stripe/android/payments/bankaccount/ui/CollectBankAccountViewModelTest.kt index 07595348e6a..64b5bbefac1 100644 --- a/payments-core/src/test/java/com/stripe/android/payments/bankaccount/ui/CollectBankAccountViewModelTest.kt +++ b/payments-core/src/test/java/com/stripe/android/payments/bankaccount/ui/CollectBankAccountViewModelTest.kt @@ -4,7 +4,6 @@ import app.cash.turbine.test import com.google.common.truth.Truth.assertThat import com.stripe.android.core.Logger import com.stripe.android.financialconnections.FinancialConnectionsSheetResult -import com.stripe.android.financialconnections.model.FinancialConnectionsSession as PaymentsFinancialConnectionsSession import com.stripe.android.model.FinancialConnectionsSession import com.stripe.android.model.PaymentIntent import com.stripe.android.model.SetupIntent @@ -33,6 +32,7 @@ import org.mockito.kotlin.never import org.mockito.kotlin.stub import org.mockito.kotlin.verify import org.robolectric.RobolectricTestRunner +import com.stripe.android.financialconnections.model.FinancialConnectionsSession as PaymentsFinancialConnectionsSession @ExperimentalCoroutinesApi @RunWith(RobolectricTestRunner::class) From 2ff6a3227cd232c320604c4f506b80caee83da9c Mon Sep 17 00:00:00 2001 From: Carlos Munoz Date: Tue, 26 Apr 2022 12:01:20 -0700 Subject: [PATCH 04/12] Revert endpoint changes. --- .../FinancialFinancialConnectionsApiRepository.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/financial-connections/src/main/java/com/stripe/android/financialconnections/repository/FinancialFinancialConnectionsApiRepository.kt b/financial-connections/src/main/java/com/stripe/android/financialconnections/repository/FinancialFinancialConnectionsApiRepository.kt index 9ade34d0d92..53b7f0539ff 100644 --- a/financial-connections/src/main/java/com/stripe/android/financialconnections/repository/FinancialFinancialConnectionsApiRepository.kt +++ b/financial-connections/src/main/java/com/stripe/android/financialconnections/repository/FinancialFinancialConnectionsApiRepository.kt @@ -141,12 +141,12 @@ internal class FinancialFinancialConnectionsApiRepository @Inject constructor( internal const val PARAMS_APPLICATION_ID = "application_id" internal const val listAccountsUrl: String = - "$API_HOST/v1/financial_connections/list_accounts" + "$API_HOST/v1/link_account_sessions/list_accounts" internal const val generateHostedUrl: String = - "$API_HOST/v1/financial_connections/generate_hosted_url" + "$API_HOST/v1/link_account_sessions/generate_hosted_url" internal const val sessionReceiptUrl: String = - "$API_HOST/v1/financial_connections/session_receipt" + "$API_HOST/v1/link_account_sessions/session_receipt" } } From 80439f97dba38d89811ec41278f887ced8e7459e Mon Sep 17 00:00:00 2001 From: Carlos Munoz Date: Tue, 26 Apr 2022 16:04:24 -0700 Subject: [PATCH 05/12] Updates missing session and account occurrences. --- .../FinancialConnectionsExampleViewModel.kt | 4 +- .../api/financial-connections.api | 364 +++++++++--------- .../FinancialConnectionsSheet.kt | 6 +- .../FinancialConnectionsSheetActivity.kt | 2 +- .../FinancialConnectionsSheetContract.kt | 6 +- ...FinancialConnectionsSheetForTokenResult.kt | 2 +- .../FinancialConnectionsSheetResult.kt | 2 +- .../FinancialConnectionsSheetViewModel.kt | 32 +- ...ancialFinancialConnectionsEventReporter.kt | 8 +- .../di/FinancialConnectionsSheetModule.kt | 4 +- .../FetchFinancialConnectionsSession.kt | 56 +++ ...tchFinancialConnectionsSessionForToken.kt} | 14 +- .../domain/FetchLinkAccountSession.kt | 56 --- ...ateFinancialConnectionsSessionManifest.kt} | 4 +- .../model/AccountHolder.kt | 4 +- ...ount.kt => FinancialConnectionsAccount.kt} | 10 +- ....kt => FinancialConnectionsAccountList.kt} | 4 +- .../model/FinancialConnectionsSession.kt | 4 +- ...GetFinancialConnectionsAcccountsParams.kt} | 2 +- .../serializer/PaymentAccountSerializer.kt | 4 +- ...t => FinancialConnectionsApiRepository.kt} | 20 +- .../FinancialConnectionsRepository.kt | 14 +- .../financialconnections/ApiKeyFixtures.kt | 2 +- .../FinancialConnectionsSheetTest.kt | 2 +- ...alFinancialConnectionsSheetActivityTest.kt | 8 +- ...alFinancialConnectionsSheetContractTest.kt | 8 +- ...lFinancialConnectionsSheetViewModelTest.kt | 62 +-- .../DefaultConnectionsEventReportTest.kt | 18 +- ...FinancialConnectionsSessionForTokenTest.kt | 7 +- .../FetchFinancialConnectionsSessionTest.kt | 40 +- .../FinancialConnectionsAccountFixtures.kt | 51 +++ .../model/LinkedAccountFixtures.kt | 51 --- .../FakeFinancialConnectionsRepository.kt | 18 +- .../FinancialConnectionsApiRepositoryTest.kt | 14 +- .../financialconnections/testmodels.kt | 26 +- 35 files changed, 466 insertions(+), 463 deletions(-) create mode 100644 financial-connections/src/main/java/com/stripe/android/financialconnections/domain/FetchFinancialConnectionsSession.kt rename financial-connections/src/main/java/com/stripe/android/financialconnections/domain/{FetchLinkAccountSessionForToken.kt => FetchFinancialConnectionsSessionForToken.kt} (62%) delete mode 100644 financial-connections/src/main/java/com/stripe/android/financialconnections/domain/FetchLinkAccountSession.kt rename financial-connections/src/main/java/com/stripe/android/financialconnections/domain/{GenerateLinkAccountSessionManifest.kt => GenerateFinancialConnectionsSessionManifest.kt} (81%) rename financial-connections/src/main/java/com/stripe/android/financialconnections/model/{LinkedAccount.kt => FinancialConnectionsAccount.kt} (95%) rename financial-connections/src/main/java/com/stripe/android/financialconnections/model/{LinkedAccountList.kt => FinancialConnectionsAccountList.kt} (88%) rename financial-connections/src/main/java/com/stripe/android/financialconnections/model/{ListLinkedAccountParams.kt => GetFinancialConnectionsAcccountsParams.kt} (94%) rename financial-connections/src/main/java/com/stripe/android/financialconnections/repository/{FinancialFinancialConnectionsApiRepository.kt => FinancialConnectionsApiRepository.kt} (87%) create mode 100644 financial-connections/src/test/java/com/stripe/android/financialconnections/model/FinancialConnectionsAccountFixtures.kt delete mode 100644 financial-connections/src/test/java/com/stripe/android/financialconnections/model/LinkedAccountFixtures.kt diff --git a/financial-connections-example/src/main/java/com/stripe/android/financialconnections/example/FinancialConnectionsExampleViewModel.kt b/financial-connections-example/src/main/java/com/stripe/android/financialconnections/example/FinancialConnectionsExampleViewModel.kt index 8a493138fdb..590474acf82 100644 --- a/financial-connections-example/src/main/java/com/stripe/android/financialconnections/example/FinancialConnectionsExampleViewModel.kt +++ b/financial-connections-example/src/main/java/com/stripe/android/financialconnections/example/FinancialConnectionsExampleViewModel.kt @@ -66,8 +66,8 @@ class FinancialConnectionsExampleViewModel : ViewModel() { fun onFinancialConnectionsSheetResult(result: FinancialConnectionsSheetResult) { val statusText = when (result) { is Completed -> { - val linkedAccountList = result.financialConnectionsSession.linkedAccounts - linkedAccountList.linkedAccounts.joinToString("\n") { + val linkedAccountList = result.financialConnectionsSession.accounts + linkedAccountList.financialConnectionsAccounts.joinToString("\n") { "${it.institutionName} - ${it.displayName} - ${it.last4} - ${it.category}/${it.subcategory}" } } diff --git a/financial-connections/api/financial-connections.api b/financial-connections/api/financial-connections.api index 7f78c5ac1f5..ac18087e4c0 100644 --- a/financial-connections/api/financial-connections.api +++ b/financial-connections/api/financial-connections.api @@ -10,14 +10,14 @@ public final class com/stripe/android/connections/FinancialConnectionsSheetForTo public final class com/stripe/android/connections/FinancialConnectionsSheetForTokenResult$Completed : com/stripe/android/connections/FinancialConnectionsSheetForTokenResult { public static final field CREATOR Landroid/os/Parcelable$Creator; - public fun (Lcom/stripe/android/financialconnections/model/LinkAccountSession;Lcom/stripe/android/model/Token;)V - public final fun component1 ()Lcom/stripe/android/financialconnections/model/LinkAccountSession; + public fun (Lcom/stripe/android/financialconnections/model/FinancialConnectionsSession;Lcom/stripe/android/model/Token;)V + public final fun component1 ()Lcom/stripe/android/financialconnections/model/FinancialConnectionsSession; public final fun component2 ()Lcom/stripe/android/model/Token; - public final fun copy (Lcom/stripe/android/financialconnections/model/LinkAccountSession;Lcom/stripe/android/model/Token;)Lcom/stripe/android/connections/FinancialConnectionsSheetForTokenResult$Completed; - public static synthetic fun copy$default (Lcom/stripe/android/connections/FinancialConnectionsSheetForTokenResult$Completed;Lcom/stripe/android/financialconnections/model/LinkAccountSession;Lcom/stripe/android/model/Token;ILjava/lang/Object;)Lcom/stripe/android/connections/FinancialConnectionsSheetForTokenResult$Completed; + public final fun copy (Lcom/stripe/android/financialconnections/model/FinancialConnectionsSession;Lcom/stripe/android/model/Token;)Lcom/stripe/android/connections/FinancialConnectionsSheetForTokenResult$Completed; + public static synthetic fun copy$default (Lcom/stripe/android/connections/FinancialConnectionsSheetForTokenResult$Completed;Lcom/stripe/android/financialconnections/model/FinancialConnectionsSession;Lcom/stripe/android/model/Token;ILjava/lang/Object;)Lcom/stripe/android/connections/FinancialConnectionsSheetForTokenResult$Completed; public fun describeContents ()I public fun equals (Ljava/lang/Object;)Z - public final fun getLinkAccountSession ()Lcom/stripe/android/financialconnections/model/LinkAccountSession; + public final fun getFinancialConnectionsSession ()Lcom/stripe/android/financialconnections/model/FinancialConnectionsSession; public final fun getToken ()Lcom/stripe/android/model/Token; public fun hashCode ()I public fun toString ()Ljava/lang/String; @@ -38,14 +38,6 @@ public final class com/stripe/android/connections/FinancialConnectionsSheetForTo public fun writeToParcel (Landroid/os/Parcel;I)V } -public final class com/stripe/android/connections/domain/FetchLinkAccountSessionForToken_Factory : dagger/internal/Factory { - public fun (Ljavax/inject/Provider;)V - public static fun create (Ljavax/inject/Provider;)Lcom/stripe/android/connections/domain/FetchLinkAccountSessionForToken_Factory; - public fun get ()Lcom/stripe/android/connections/domain/FetchLinkAccountSessionForToken; - public synthetic fun get ()Ljava/lang/Object; - public static fun newInstance (Lcom/stripe/android/financialconnections/repository/FinancialConnectionsRepository;)Lcom/stripe/android/connections/domain/FetchLinkAccountSessionForToken; -} - public final class com/stripe/android/financialconnections/BuildConfig { public static final field BUILD_TYPE Ljava/lang/String; public static final field DEBUG Z @@ -72,7 +64,7 @@ public final class com/stripe/android/financialconnections/FinancialConnectionsS public static synthetic fun copy$default (Lcom/stripe/android/financialconnections/FinancialConnectionsSheet$Configuration;Ljava/lang/String;Ljava/lang/String;ILjava/lang/Object;)Lcom/stripe/android/financialconnections/FinancialConnectionsSheet$Configuration; public fun describeContents ()I public fun equals (Ljava/lang/Object;)Z - public final fun getLinkAccountSessionClientSecret ()Ljava/lang/String; + public final fun getFinancialConnectionsSessionClientSecret ()Ljava/lang/String; public final fun getPublishableKey ()Ljava/lang/String; public fun hashCode ()I public fun toString ()Ljava/lang/String; @@ -95,13 +87,13 @@ public final class com/stripe/android/financialconnections/FinancialConnectionsS public final class com/stripe/android/financialconnections/FinancialConnectionsSheetResult$Completed : com/stripe/android/financialconnections/FinancialConnectionsSheetResult { public static final field CREATOR Landroid/os/Parcelable$Creator; - public fun (Lcom/stripe/android/financialconnections/model/LinkAccountSession;)V - public final fun component1 ()Lcom/stripe/android/financialconnections/model/LinkAccountSession; - public final fun copy (Lcom/stripe/android/financialconnections/model/LinkAccountSession;)Lcom/stripe/android/financialconnections/FinancialConnectionsSheetResult$Completed; - public static synthetic fun copy$default (Lcom/stripe/android/financialconnections/FinancialConnectionsSheetResult$Completed;Lcom/stripe/android/financialconnections/model/LinkAccountSession;ILjava/lang/Object;)Lcom/stripe/android/financialconnections/FinancialConnectionsSheetResult$Completed; + public fun (Lcom/stripe/android/financialconnections/model/FinancialConnectionsSession;)V + public final fun component1 ()Lcom/stripe/android/financialconnections/model/FinancialConnectionsSession; + public final fun copy (Lcom/stripe/android/financialconnections/model/FinancialConnectionsSession;)Lcom/stripe/android/financialconnections/FinancialConnectionsSheetResult$Completed; + public static synthetic fun copy$default (Lcom/stripe/android/financialconnections/FinancialConnectionsSheetResult$Completed;Lcom/stripe/android/financialconnections/model/FinancialConnectionsSession;ILjava/lang/Object;)Lcom/stripe/android/financialconnections/FinancialConnectionsSheetResult$Completed; public fun describeContents ()I public fun equals (Ljava/lang/Object;)Z - public final fun getLinkAccountSession ()Lcom/stripe/android/financialconnections/model/LinkAccountSession; + public final fun getFinancialConnectionsSession ()Lcom/stripe/android/financialconnections/model/FinancialConnectionsSession; public fun hashCode ()I public fun toString ()Ljava/lang/String; public fun writeToParcel (Landroid/os/Parcel;I)V @@ -130,7 +122,7 @@ public final class com/stripe/android/financialconnections/FinancialConnectionsS public static fun create (Ljavax/inject/Provider;Ljavax/inject/Provider;Ljavax/inject/Provider;Ljavax/inject/Provider;Ljavax/inject/Provider;Ljavax/inject/Provider;Ljavax/inject/Provider;)Lcom/stripe/android/financialconnections/FinancialConnectionsSheetViewModel_Factory; public fun get ()Lcom/stripe/android/financialconnections/FinancialConnectionsSheetViewModel; public synthetic fun get ()Ljava/lang/Object; - public static fun newInstance (Ljava/lang/String;Lcom/stripe/android/financialconnections/FinancialConnectionsSheetContract$Args;Lcom/stripe/android/financialconnections/domain/GenerateLinkAccountSessionManifest;Lcom/stripe/android/financialconnections/domain/FetchLinkAccountSession;Lcom/stripe/android/connections/domain/FetchLinkAccountSessionForToken;Landroidx/lifecycle/SavedStateHandle;Lcom/stripe/android/financialconnections/analytics/FinancialConnectionsEventReporter;)Lcom/stripe/android/financialconnections/FinancialConnectionsSheetViewModel; + public static fun newInstance (Ljava/lang/String;Lcom/stripe/android/financialconnections/FinancialConnectionsSheetContract$Args;Lcom/stripe/android/financialconnections/domain/GenerateFinancialConnectionsSessionManifest;Lcom/stripe/android/financialconnections/domain/FetchFinancialConnectionsSession;Lcom/stripe/android/financialconnections/domain/FetchFinancialConnectionsSessionForToken;Landroidx/lifecycle/SavedStateHandle;Lcom/stripe/android/financialconnections/analytics/FinancialConnectionsEventReporter;)Lcom/stripe/android/financialconnections/FinancialConnectionsSheetViewModel; } public final class com/stripe/android/financialconnections/analytics/DefaultFinancialFinancialConnectionsEventReporter_Factory : dagger/internal/Factory { @@ -201,7 +193,7 @@ public final class com/stripe/android/financialconnections/di/FinancialConnectio public static fun create (Ljavax/inject/Provider;)Lcom/stripe/android/financialconnections/di/FinancialConnectionsSheetModule_ProvideConnectionsRepositoryFactory; public fun get ()Lcom/stripe/android/financialconnections/repository/FinancialConnectionsRepository; public synthetic fun get ()Ljava/lang/Object; - public static fun provideConnectionsRepository (Lcom/stripe/android/financialconnections/repository/FinancialFinancialConnectionsApiRepository;)Lcom/stripe/android/financialconnections/repository/FinancialConnectionsRepository; + public static fun provideConnectionsRepository (Lcom/stripe/android/financialconnections/repository/FinancialConnectionsApiRepository;)Lcom/stripe/android/financialconnections/repository/FinancialConnectionsRepository; } public final class com/stripe/android/financialconnections/di/FinancialConnectionsSheetModule_ProvideEventReporterFactory : dagger/internal/Factory { @@ -244,20 +236,28 @@ public final class com/stripe/android/financialconnections/di/FinancialConnectio public static fun providesApiRequestFactory ()Lcom/stripe/android/core/networking/ApiRequest$Factory; } -public final class com/stripe/android/financialconnections/domain/FetchLinkAccountSession_Factory : dagger/internal/Factory { +public final class com/stripe/android/financialconnections/domain/FetchFinancialConnectionsSessionForToken_Factory : dagger/internal/Factory { + public fun (Ljavax/inject/Provider;)V + public static fun create (Ljavax/inject/Provider;)Lcom/stripe/android/financialconnections/domain/FetchFinancialConnectionsSessionForToken_Factory; + public fun get ()Lcom/stripe/android/financialconnections/domain/FetchFinancialConnectionsSessionForToken; + public synthetic fun get ()Ljava/lang/Object; + public static fun newInstance (Lcom/stripe/android/financialconnections/repository/FinancialConnectionsRepository;)Lcom/stripe/android/financialconnections/domain/FetchFinancialConnectionsSessionForToken; +} + +public final class com/stripe/android/financialconnections/domain/FetchFinancialConnectionsSession_Factory : dagger/internal/Factory { public fun (Ljavax/inject/Provider;)V - public static fun create (Ljavax/inject/Provider;)Lcom/stripe/android/financialconnections/domain/FetchLinkAccountSession_Factory; - public fun get ()Lcom/stripe/android/financialconnections/domain/FetchLinkAccountSession; + public static fun create (Ljavax/inject/Provider;)Lcom/stripe/android/financialconnections/domain/FetchFinancialConnectionsSession_Factory; + public fun get ()Lcom/stripe/android/financialconnections/domain/FetchFinancialConnectionsSession; public synthetic fun get ()Ljava/lang/Object; - public static fun newInstance (Lcom/stripe/android/financialconnections/repository/FinancialConnectionsRepository;)Lcom/stripe/android/financialconnections/domain/FetchLinkAccountSession; + public static fun newInstance (Lcom/stripe/android/financialconnections/repository/FinancialConnectionsRepository;)Lcom/stripe/android/financialconnections/domain/FetchFinancialConnectionsSession; } -public final class com/stripe/android/financialconnections/domain/GenerateLinkAccountSessionManifest_Factory : dagger/internal/Factory { +public final class com/stripe/android/financialconnections/domain/GenerateFinancialConnectionsSessionManifest_Factory : dagger/internal/Factory { public fun (Ljavax/inject/Provider;)V - public static fun create (Ljavax/inject/Provider;)Lcom/stripe/android/financialconnections/domain/GenerateLinkAccountSessionManifest_Factory; - public fun get ()Lcom/stripe/android/financialconnections/domain/GenerateLinkAccountSessionManifest; + public static fun create (Ljavax/inject/Provider;)Lcom/stripe/android/financialconnections/domain/GenerateFinancialConnectionsSessionManifest_Factory; + public fun get ()Lcom/stripe/android/financialconnections/domain/GenerateFinancialConnectionsSessionManifest; public synthetic fun get ()Ljava/lang/Object; - public static fun newInstance (Lcom/stripe/android/financialconnections/repository/FinancialConnectionsRepository;)Lcom/stripe/android/financialconnections/domain/GenerateLinkAccountSessionManifest; + public static fun newInstance (Lcom/stripe/android/financialconnections/repository/FinancialConnectionsRepository;)Lcom/stripe/android/financialconnections/domain/GenerateFinancialConnectionsSessionManifest; } public final class com/stripe/android/financialconnections/model/AccountHolder : android/os/Parcelable, com/stripe/android/core/model/StripeModel { @@ -541,55 +541,14 @@ public final class com/stripe/android/financialconnections/model/CreditBalance$C public final fun serializer ()Lkotlinx/serialization/KSerializer; } -public final class com/stripe/android/financialconnections/model/LinkAccountSession : android/os/Parcelable, com/stripe/android/core/model/StripeModel { - public static final field CREATOR Landroid/os/Parcelable$Creator; - public static final field Companion Lcom/stripe/android/financialconnections/model/LinkAccountSession$Companion; - public synthetic fun (ILjava/lang/String;Ljava/lang/String;Lcom/stripe/android/financialconnections/model/LinkedAccountList;ZLcom/stripe/android/financialconnections/model/PaymentAccount;Ljava/lang/String;Ljava/lang/String;Lkotlinx/serialization/internal/SerializationConstructorMarker;)V - public final fun component1 ()Ljava/lang/String; - public final fun component2 ()Ljava/lang/String; - public final fun component3 ()Lcom/stripe/android/financialconnections/model/LinkedAccountList; - public final fun component4 ()Z - public final fun component5 ()Lcom/stripe/android/financialconnections/model/PaymentAccount; - public final fun component6 ()Ljava/lang/String; - public final fun copy (Ljava/lang/String;Ljava/lang/String;Lcom/stripe/android/financialconnections/model/LinkedAccountList;ZLcom/stripe/android/financialconnections/model/PaymentAccount;Ljava/lang/String;Ljava/lang/String;)Lcom/stripe/android/financialconnections/model/LinkAccountSession; - public static synthetic fun copy$default (Lcom/stripe/android/financialconnections/model/LinkAccountSession;Ljava/lang/String;Ljava/lang/String;Lcom/stripe/android/financialconnections/model/LinkedAccountList;ZLcom/stripe/android/financialconnections/model/PaymentAccount;Ljava/lang/String;Ljava/lang/String;ILjava/lang/Object;)Lcom/stripe/android/financialconnections/model/LinkAccountSession; - public fun describeContents ()I - public fun equals (Ljava/lang/Object;)Z - public final fun getClientSecret ()Ljava/lang/String; - public final fun getId ()Ljava/lang/String; - public final fun getLinkedAccounts ()Lcom/stripe/android/financialconnections/model/LinkedAccountList; - public final fun getLivemode ()Z - public final fun getReturnUrl ()Ljava/lang/String; - public fun hashCode ()I - public fun toString ()Ljava/lang/String; - public static final fun write$Self (Lcom/stripe/android/financialconnections/model/LinkAccountSession;Lkotlinx/serialization/encoding/CompositeEncoder;Lkotlinx/serialization/descriptors/SerialDescriptor;)V - public fun writeToParcel (Landroid/os/Parcel;I)V -} - -public final class com/stripe/android/financialconnections/model/LinkAccountSession$$serializer : kotlinx/serialization/internal/GeneratedSerializer { - public static final field INSTANCE Lcom/stripe/android/financialconnections/model/LinkAccountSession$$serializer; - public static final synthetic field descriptor Lkotlinx/serialization/descriptors/SerialDescriptor; - public fun childSerializers ()[Lkotlinx/serialization/KSerializer; - public fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Lcom/stripe/android/financialconnections/model/LinkAccountSession; - public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; - public fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; - public fun serialize (Lkotlinx/serialization/encoding/Encoder;Lcom/stripe/android/financialconnections/model/LinkAccountSession;)V - public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V - public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer; -} - -public final class com/stripe/android/financialconnections/model/LinkAccountSession$Companion { - public final fun serializer ()Lkotlinx/serialization/KSerializer; -} - -public final class com/stripe/android/financialconnections/model/LinkedAccount : com/stripe/android/financialconnections/model/PaymentAccount, android/os/Parcelable, com/stripe/android/core/model/StripeModel { +public final class com/stripe/android/financialconnections/model/FinancialConnectionsAccount : com/stripe/android/financialconnections/model/PaymentAccount, android/os/Parcelable, com/stripe/android/core/model/StripeModel { public static final field CREATOR Landroid/os/Parcelable$Creator; - public static final field Companion Lcom/stripe/android/financialconnections/model/LinkedAccount$Companion; + public static final field Companion Lcom/stripe/android/financialconnections/model/FinancialConnectionsAccount$Companion; public static final field OBJECT Ljava/lang/String; - public synthetic fun (ILcom/stripe/android/financialconnections/model/LinkedAccount$Category;ILjava/lang/String;Ljava/lang/String;ZLcom/stripe/android/financialconnections/model/LinkedAccount$Status;Lcom/stripe/android/financialconnections/model/LinkedAccount$Subcategory;Ljava/util/List;Lcom/stripe/android/financialconnections/model/AccountHolder;Lcom/stripe/android/financialconnections/model/Balance;Lcom/stripe/android/financialconnections/model/BalanceRefresh;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Lcom/stripe/android/financialconnections/model/OwnershipRefresh;Ljava/util/List;Lkotlinx/serialization/internal/SerializationConstructorMarker;)V - public fun (Lcom/stripe/android/financialconnections/model/LinkedAccount$Category;ILjava/lang/String;Ljava/lang/String;ZLcom/stripe/android/financialconnections/model/LinkedAccount$Status;Lcom/stripe/android/financialconnections/model/LinkedAccount$Subcategory;Ljava/util/List;Lcom/stripe/android/financialconnections/model/AccountHolder;Lcom/stripe/android/financialconnections/model/Balance;Lcom/stripe/android/financialconnections/model/BalanceRefresh;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Lcom/stripe/android/financialconnections/model/OwnershipRefresh;Ljava/util/List;)V - public synthetic fun (Lcom/stripe/android/financialconnections/model/LinkedAccount$Category;ILjava/lang/String;Ljava/lang/String;ZLcom/stripe/android/financialconnections/model/LinkedAccount$Status;Lcom/stripe/android/financialconnections/model/LinkedAccount$Subcategory;Ljava/util/List;Lcom/stripe/android/financialconnections/model/AccountHolder;Lcom/stripe/android/financialconnections/model/Balance;Lcom/stripe/android/financialconnections/model/BalanceRefresh;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Lcom/stripe/android/financialconnections/model/OwnershipRefresh;Ljava/util/List;ILkotlin/jvm/internal/DefaultConstructorMarker;)V - public final fun component1 ()Lcom/stripe/android/financialconnections/model/LinkedAccount$Category; + public synthetic fun (ILcom/stripe/android/financialconnections/model/FinancialConnectionsAccount$Category;ILjava/lang/String;Ljava/lang/String;ZLcom/stripe/android/financialconnections/model/FinancialConnectionsAccount$Status;Lcom/stripe/android/financialconnections/model/FinancialConnectionsAccount$Subcategory;Ljava/util/List;Lcom/stripe/android/financialconnections/model/AccountHolder;Lcom/stripe/android/financialconnections/model/Balance;Lcom/stripe/android/financialconnections/model/BalanceRefresh;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Lcom/stripe/android/financialconnections/model/OwnershipRefresh;Ljava/util/List;Lkotlinx/serialization/internal/SerializationConstructorMarker;)V + public fun (Lcom/stripe/android/financialconnections/model/FinancialConnectionsAccount$Category;ILjava/lang/String;Ljava/lang/String;ZLcom/stripe/android/financialconnections/model/FinancialConnectionsAccount$Status;Lcom/stripe/android/financialconnections/model/FinancialConnectionsAccount$Subcategory;Ljava/util/List;Lcom/stripe/android/financialconnections/model/AccountHolder;Lcom/stripe/android/financialconnections/model/Balance;Lcom/stripe/android/financialconnections/model/BalanceRefresh;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Lcom/stripe/android/financialconnections/model/OwnershipRefresh;Ljava/util/List;)V + public synthetic fun (Lcom/stripe/android/financialconnections/model/FinancialConnectionsAccount$Category;ILjava/lang/String;Ljava/lang/String;ZLcom/stripe/android/financialconnections/model/FinancialConnectionsAccount$Status;Lcom/stripe/android/financialconnections/model/FinancialConnectionsAccount$Subcategory;Ljava/util/List;Lcom/stripe/android/financialconnections/model/AccountHolder;Lcom/stripe/android/financialconnections/model/Balance;Lcom/stripe/android/financialconnections/model/BalanceRefresh;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Lcom/stripe/android/financialconnections/model/OwnershipRefresh;Ljava/util/List;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public final fun component1 ()Lcom/stripe/android/financialconnections/model/FinancialConnectionsAccount$Category; public final fun component10 ()Lcom/stripe/android/financialconnections/model/Balance; public final fun component11 ()Lcom/stripe/android/financialconnections/model/BalanceRefresh; public final fun component12 ()Ljava/lang/String; @@ -601,18 +560,18 @@ public final class com/stripe/android/financialconnections/model/LinkedAccount : public final fun component3 ()Ljava/lang/String; public final fun component4 ()Ljava/lang/String; public final fun component5 ()Z - public final fun component6 ()Lcom/stripe/android/financialconnections/model/LinkedAccount$Status; - public final fun component7 ()Lcom/stripe/android/financialconnections/model/LinkedAccount$Subcategory; + public final fun component6 ()Lcom/stripe/android/financialconnections/model/FinancialConnectionsAccount$Status; + public final fun component7 ()Lcom/stripe/android/financialconnections/model/FinancialConnectionsAccount$Subcategory; public final fun component8 ()Ljava/util/List; public final fun component9 ()Lcom/stripe/android/financialconnections/model/AccountHolder; - public final fun copy (Lcom/stripe/android/financialconnections/model/LinkedAccount$Category;ILjava/lang/String;Ljava/lang/String;ZLcom/stripe/android/financialconnections/model/LinkedAccount$Status;Lcom/stripe/android/financialconnections/model/LinkedAccount$Subcategory;Ljava/util/List;Lcom/stripe/android/financialconnections/model/AccountHolder;Lcom/stripe/android/financialconnections/model/Balance;Lcom/stripe/android/financialconnections/model/BalanceRefresh;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Lcom/stripe/android/financialconnections/model/OwnershipRefresh;Ljava/util/List;)Lcom/stripe/android/financialconnections/model/LinkedAccount; - public static synthetic fun copy$default (Lcom/stripe/android/financialconnections/model/LinkedAccount;Lcom/stripe/android/financialconnections/model/LinkedAccount$Category;ILjava/lang/String;Ljava/lang/String;ZLcom/stripe/android/financialconnections/model/LinkedAccount$Status;Lcom/stripe/android/financialconnections/model/LinkedAccount$Subcategory;Ljava/util/List;Lcom/stripe/android/financialconnections/model/AccountHolder;Lcom/stripe/android/financialconnections/model/Balance;Lcom/stripe/android/financialconnections/model/BalanceRefresh;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Lcom/stripe/android/financialconnections/model/OwnershipRefresh;Ljava/util/List;ILjava/lang/Object;)Lcom/stripe/android/financialconnections/model/LinkedAccount; + public final fun copy (Lcom/stripe/android/financialconnections/model/FinancialConnectionsAccount$Category;ILjava/lang/String;Ljava/lang/String;ZLcom/stripe/android/financialconnections/model/FinancialConnectionsAccount$Status;Lcom/stripe/android/financialconnections/model/FinancialConnectionsAccount$Subcategory;Ljava/util/List;Lcom/stripe/android/financialconnections/model/AccountHolder;Lcom/stripe/android/financialconnections/model/Balance;Lcom/stripe/android/financialconnections/model/BalanceRefresh;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Lcom/stripe/android/financialconnections/model/OwnershipRefresh;Ljava/util/List;)Lcom/stripe/android/financialconnections/model/FinancialConnectionsAccount; + public static synthetic fun copy$default (Lcom/stripe/android/financialconnections/model/FinancialConnectionsAccount;Lcom/stripe/android/financialconnections/model/FinancialConnectionsAccount$Category;ILjava/lang/String;Ljava/lang/String;ZLcom/stripe/android/financialconnections/model/FinancialConnectionsAccount$Status;Lcom/stripe/android/financialconnections/model/FinancialConnectionsAccount$Subcategory;Ljava/util/List;Lcom/stripe/android/financialconnections/model/AccountHolder;Lcom/stripe/android/financialconnections/model/Balance;Lcom/stripe/android/financialconnections/model/BalanceRefresh;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Lcom/stripe/android/financialconnections/model/OwnershipRefresh;Ljava/util/List;ILjava/lang/Object;)Lcom/stripe/android/financialconnections/model/FinancialConnectionsAccount; public fun describeContents ()I public fun equals (Ljava/lang/Object;)Z public final fun getAccountholder ()Lcom/stripe/android/financialconnections/model/AccountHolder; public final fun getBalance ()Lcom/stripe/android/financialconnections/model/Balance; public final fun getBalanceRefresh ()Lcom/stripe/android/financialconnections/model/BalanceRefresh; - public final fun getCategory ()Lcom/stripe/android/financialconnections/model/LinkedAccount$Category; + public final fun getCategory ()Lcom/stripe/android/financialconnections/model/FinancialConnectionsAccount$Category; public final fun getCreated ()I public final fun getDisplayName ()Ljava/lang/String; public final fun getId ()Ljava/lang/String; @@ -622,174 +581,174 @@ public final class com/stripe/android/financialconnections/model/LinkedAccount : public final fun getOwnership ()Ljava/lang/String; public final fun getOwnershipRefresh ()Lcom/stripe/android/financialconnections/model/OwnershipRefresh; public final fun getPermissions ()Ljava/util/List; - public final fun getStatus ()Lcom/stripe/android/financialconnections/model/LinkedAccount$Status; - public final fun getSubcategory ()Lcom/stripe/android/financialconnections/model/LinkedAccount$Subcategory; + public final fun getStatus ()Lcom/stripe/android/financialconnections/model/FinancialConnectionsAccount$Status; + public final fun getSubcategory ()Lcom/stripe/android/financialconnections/model/FinancialConnectionsAccount$Subcategory; public final fun getSupportedPaymentMethodTypes ()Ljava/util/List; public fun hashCode ()I public fun toString ()Ljava/lang/String; - public static final fun write$Self (Lcom/stripe/android/financialconnections/model/LinkedAccount;Lkotlinx/serialization/encoding/CompositeEncoder;Lkotlinx/serialization/descriptors/SerialDescriptor;)V + public static final fun write$Self (Lcom/stripe/android/financialconnections/model/FinancialConnectionsAccount;Lkotlinx/serialization/encoding/CompositeEncoder;Lkotlinx/serialization/descriptors/SerialDescriptor;)V public fun writeToParcel (Landroid/os/Parcel;I)V } -public final class com/stripe/android/financialconnections/model/LinkedAccount$$serializer : kotlinx/serialization/internal/GeneratedSerializer { - public static final field INSTANCE Lcom/stripe/android/financialconnections/model/LinkedAccount$$serializer; +public final class com/stripe/android/financialconnections/model/FinancialConnectionsAccount$$serializer : kotlinx/serialization/internal/GeneratedSerializer { + public static final field INSTANCE Lcom/stripe/android/financialconnections/model/FinancialConnectionsAccount$$serializer; public static final synthetic field descriptor Lkotlinx/serialization/descriptors/SerialDescriptor; public fun childSerializers ()[Lkotlinx/serialization/KSerializer; - public fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Lcom/stripe/android/financialconnections/model/LinkedAccount; + public fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Lcom/stripe/android/financialconnections/model/FinancialConnectionsAccount; public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; public fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; - public fun serialize (Lkotlinx/serialization/encoding/Encoder;Lcom/stripe/android/financialconnections/model/LinkedAccount;)V + public fun serialize (Lkotlinx/serialization/encoding/Encoder;Lcom/stripe/android/financialconnections/model/FinancialConnectionsAccount;)V public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer; } -public final class com/stripe/android/financialconnections/model/LinkedAccount$Category : java/lang/Enum { - public static final field CASH Lcom/stripe/android/financialconnections/model/LinkedAccount$Category; - public static final field CREDIT Lcom/stripe/android/financialconnections/model/LinkedAccount$Category; - public static final field Companion Lcom/stripe/android/financialconnections/model/LinkedAccount$Category$Companion; - public static final field INVESTMENT Lcom/stripe/android/financialconnections/model/LinkedAccount$Category; - public static final field OTHER Lcom/stripe/android/financialconnections/model/LinkedAccount$Category; - public static final field UNKNOWN Lcom/stripe/android/financialconnections/model/LinkedAccount$Category; +public final class com/stripe/android/financialconnections/model/FinancialConnectionsAccount$Category : java/lang/Enum { + public static final field CASH Lcom/stripe/android/financialconnections/model/FinancialConnectionsAccount$Category; + public static final field CREDIT Lcom/stripe/android/financialconnections/model/FinancialConnectionsAccount$Category; + public static final field Companion Lcom/stripe/android/financialconnections/model/FinancialConnectionsAccount$Category$Companion; + public static final field INVESTMENT Lcom/stripe/android/financialconnections/model/FinancialConnectionsAccount$Category; + public static final field OTHER Lcom/stripe/android/financialconnections/model/FinancialConnectionsAccount$Category; + public static final field UNKNOWN Lcom/stripe/android/financialconnections/model/FinancialConnectionsAccount$Category; public final fun getValue ()Ljava/lang/String; - public static fun valueOf (Ljava/lang/String;)Lcom/stripe/android/financialconnections/model/LinkedAccount$Category; - public static fun values ()[Lcom/stripe/android/financialconnections/model/LinkedAccount$Category; + public static fun valueOf (Ljava/lang/String;)Lcom/stripe/android/financialconnections/model/FinancialConnectionsAccount$Category; + public static fun values ()[Lcom/stripe/android/financialconnections/model/FinancialConnectionsAccount$Category; } -public final class com/stripe/android/financialconnections/model/LinkedAccount$Category$$serializer : kotlinx/serialization/internal/GeneratedSerializer { - public static final field INSTANCE Lcom/stripe/android/financialconnections/model/LinkedAccount$Category$$serializer; +public final class com/stripe/android/financialconnections/model/FinancialConnectionsAccount$Category$$serializer : kotlinx/serialization/internal/GeneratedSerializer { + public static final field INSTANCE Lcom/stripe/android/financialconnections/model/FinancialConnectionsAccount$Category$$serializer; public static final synthetic field descriptor Lkotlinx/serialization/descriptors/SerialDescriptor; public fun childSerializers ()[Lkotlinx/serialization/KSerializer; - public fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Lcom/stripe/android/financialconnections/model/LinkedAccount$Category; + public fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Lcom/stripe/android/financialconnections/model/FinancialConnectionsAccount$Category; public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; public fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; - public fun serialize (Lkotlinx/serialization/encoding/Encoder;Lcom/stripe/android/financialconnections/model/LinkedAccount$Category;)V + public fun serialize (Lkotlinx/serialization/encoding/Encoder;Lcom/stripe/android/financialconnections/model/FinancialConnectionsAccount$Category;)V public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer; } -public final class com/stripe/android/financialconnections/model/LinkedAccount$Category$Companion { +public final class com/stripe/android/financialconnections/model/FinancialConnectionsAccount$Category$Companion { public final fun serializer ()Lkotlinx/serialization/KSerializer; } -public final class com/stripe/android/financialconnections/model/LinkedAccount$Companion { +public final class com/stripe/android/financialconnections/model/FinancialConnectionsAccount$Companion { public final fun serializer ()Lkotlinx/serialization/KSerializer; } -public final class com/stripe/android/financialconnections/model/LinkedAccount$Permissions : java/lang/Enum { - public static final field BALANCES Lcom/stripe/android/financialconnections/model/LinkedAccount$Permissions; - public static final field Companion Lcom/stripe/android/financialconnections/model/LinkedAccount$Permissions$Companion; - public static final field IDENTITY Lcom/stripe/android/financialconnections/model/LinkedAccount$Permissions; - public static final field OWNERSHIP Lcom/stripe/android/financialconnections/model/LinkedAccount$Permissions; - public static final field PAYMENT_METHOD Lcom/stripe/android/financialconnections/model/LinkedAccount$Permissions; - public static final field TRANSACTIONS Lcom/stripe/android/financialconnections/model/LinkedAccount$Permissions; - public static final field UNKNOWN Lcom/stripe/android/financialconnections/model/LinkedAccount$Permissions; +public final class com/stripe/android/financialconnections/model/FinancialConnectionsAccount$Permissions : java/lang/Enum { + public static final field BALANCES Lcom/stripe/android/financialconnections/model/FinancialConnectionsAccount$Permissions; + public static final field Companion Lcom/stripe/android/financialconnections/model/FinancialConnectionsAccount$Permissions$Companion; + public static final field IDENTITY Lcom/stripe/android/financialconnections/model/FinancialConnectionsAccount$Permissions; + public static final field OWNERSHIP Lcom/stripe/android/financialconnections/model/FinancialConnectionsAccount$Permissions; + public static final field PAYMENT_METHOD Lcom/stripe/android/financialconnections/model/FinancialConnectionsAccount$Permissions; + public static final field TRANSACTIONS Lcom/stripe/android/financialconnections/model/FinancialConnectionsAccount$Permissions; + public static final field UNKNOWN Lcom/stripe/android/financialconnections/model/FinancialConnectionsAccount$Permissions; public final fun getValue ()Ljava/lang/String; - public static fun valueOf (Ljava/lang/String;)Lcom/stripe/android/financialconnections/model/LinkedAccount$Permissions; - public static fun values ()[Lcom/stripe/android/financialconnections/model/LinkedAccount$Permissions; + public static fun valueOf (Ljava/lang/String;)Lcom/stripe/android/financialconnections/model/FinancialConnectionsAccount$Permissions; + public static fun values ()[Lcom/stripe/android/financialconnections/model/FinancialConnectionsAccount$Permissions; } -public final class com/stripe/android/financialconnections/model/LinkedAccount$Permissions$$serializer : kotlinx/serialization/internal/GeneratedSerializer { - public static final field INSTANCE Lcom/stripe/android/financialconnections/model/LinkedAccount$Permissions$$serializer; +public final class com/stripe/android/financialconnections/model/FinancialConnectionsAccount$Permissions$$serializer : kotlinx/serialization/internal/GeneratedSerializer { + public static final field INSTANCE Lcom/stripe/android/financialconnections/model/FinancialConnectionsAccount$Permissions$$serializer; public static final synthetic field descriptor Lkotlinx/serialization/descriptors/SerialDescriptor; public fun childSerializers ()[Lkotlinx/serialization/KSerializer; - public fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Lcom/stripe/android/financialconnections/model/LinkedAccount$Permissions; + public fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Lcom/stripe/android/financialconnections/model/FinancialConnectionsAccount$Permissions; public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; public fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; - public fun serialize (Lkotlinx/serialization/encoding/Encoder;Lcom/stripe/android/financialconnections/model/LinkedAccount$Permissions;)V + public fun serialize (Lkotlinx/serialization/encoding/Encoder;Lcom/stripe/android/financialconnections/model/FinancialConnectionsAccount$Permissions;)V public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer; } -public final class com/stripe/android/financialconnections/model/LinkedAccount$Permissions$Companion { +public final class com/stripe/android/financialconnections/model/FinancialConnectionsAccount$Permissions$Companion { public final fun serializer ()Lkotlinx/serialization/KSerializer; } -public final class com/stripe/android/financialconnections/model/LinkedAccount$Status : java/lang/Enum { - public static final field ACTIVE Lcom/stripe/android/financialconnections/model/LinkedAccount$Status; - public static final field Companion Lcom/stripe/android/financialconnections/model/LinkedAccount$Status$Companion; - public static final field DISCONNECTED Lcom/stripe/android/financialconnections/model/LinkedAccount$Status; - public static final field INACTIVE Lcom/stripe/android/financialconnections/model/LinkedAccount$Status; - public static final field UNKNOWN Lcom/stripe/android/financialconnections/model/LinkedAccount$Status; +public final class com/stripe/android/financialconnections/model/FinancialConnectionsAccount$Status : java/lang/Enum { + public static final field ACTIVE Lcom/stripe/android/financialconnections/model/FinancialConnectionsAccount$Status; + public static final field Companion Lcom/stripe/android/financialconnections/model/FinancialConnectionsAccount$Status$Companion; + public static final field DISCONNECTED Lcom/stripe/android/financialconnections/model/FinancialConnectionsAccount$Status; + public static final field INACTIVE Lcom/stripe/android/financialconnections/model/FinancialConnectionsAccount$Status; + public static final field UNKNOWN Lcom/stripe/android/financialconnections/model/FinancialConnectionsAccount$Status; public final fun getValue ()Ljava/lang/String; - public static fun valueOf (Ljava/lang/String;)Lcom/stripe/android/financialconnections/model/LinkedAccount$Status; - public static fun values ()[Lcom/stripe/android/financialconnections/model/LinkedAccount$Status; + public static fun valueOf (Ljava/lang/String;)Lcom/stripe/android/financialconnections/model/FinancialConnectionsAccount$Status; + public static fun values ()[Lcom/stripe/android/financialconnections/model/FinancialConnectionsAccount$Status; } -public final class com/stripe/android/financialconnections/model/LinkedAccount$Status$$serializer : kotlinx/serialization/internal/GeneratedSerializer { - public static final field INSTANCE Lcom/stripe/android/financialconnections/model/LinkedAccount$Status$$serializer; +public final class com/stripe/android/financialconnections/model/FinancialConnectionsAccount$Status$$serializer : kotlinx/serialization/internal/GeneratedSerializer { + public static final field INSTANCE Lcom/stripe/android/financialconnections/model/FinancialConnectionsAccount$Status$$serializer; public static final synthetic field descriptor Lkotlinx/serialization/descriptors/SerialDescriptor; public fun childSerializers ()[Lkotlinx/serialization/KSerializer; - public fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Lcom/stripe/android/financialconnections/model/LinkedAccount$Status; + public fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Lcom/stripe/android/financialconnections/model/FinancialConnectionsAccount$Status; public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; public fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; - public fun serialize (Lkotlinx/serialization/encoding/Encoder;Lcom/stripe/android/financialconnections/model/LinkedAccount$Status;)V + public fun serialize (Lkotlinx/serialization/encoding/Encoder;Lcom/stripe/android/financialconnections/model/FinancialConnectionsAccount$Status;)V public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer; } -public final class com/stripe/android/financialconnections/model/LinkedAccount$Status$Companion { +public final class com/stripe/android/financialconnections/model/FinancialConnectionsAccount$Status$Companion { public final fun serializer ()Lkotlinx/serialization/KSerializer; } -public final class com/stripe/android/financialconnections/model/LinkedAccount$Subcategory : java/lang/Enum { - public static final field CHECKING Lcom/stripe/android/financialconnections/model/LinkedAccount$Subcategory; - public static final field CREDIT_CARD Lcom/stripe/android/financialconnections/model/LinkedAccount$Subcategory; - public static final field Companion Lcom/stripe/android/financialconnections/model/LinkedAccount$Subcategory$Companion; - public static final field LINE_OF_CREDIT Lcom/stripe/android/financialconnections/model/LinkedAccount$Subcategory; - public static final field MORTGAGE Lcom/stripe/android/financialconnections/model/LinkedAccount$Subcategory; - public static final field OTHER Lcom/stripe/android/financialconnections/model/LinkedAccount$Subcategory; - public static final field SAVINGS Lcom/stripe/android/financialconnections/model/LinkedAccount$Subcategory; - public static final field UNKNOWN Lcom/stripe/android/financialconnections/model/LinkedAccount$Subcategory; +public final class com/stripe/android/financialconnections/model/FinancialConnectionsAccount$Subcategory : java/lang/Enum { + public static final field CHECKING Lcom/stripe/android/financialconnections/model/FinancialConnectionsAccount$Subcategory; + public static final field CREDIT_CARD Lcom/stripe/android/financialconnections/model/FinancialConnectionsAccount$Subcategory; + public static final field Companion Lcom/stripe/android/financialconnections/model/FinancialConnectionsAccount$Subcategory$Companion; + public static final field LINE_OF_CREDIT Lcom/stripe/android/financialconnections/model/FinancialConnectionsAccount$Subcategory; + public static final field MORTGAGE Lcom/stripe/android/financialconnections/model/FinancialConnectionsAccount$Subcategory; + public static final field OTHER Lcom/stripe/android/financialconnections/model/FinancialConnectionsAccount$Subcategory; + public static final field SAVINGS Lcom/stripe/android/financialconnections/model/FinancialConnectionsAccount$Subcategory; + public static final field UNKNOWN Lcom/stripe/android/financialconnections/model/FinancialConnectionsAccount$Subcategory; public final fun getValue ()Ljava/lang/String; - public static fun valueOf (Ljava/lang/String;)Lcom/stripe/android/financialconnections/model/LinkedAccount$Subcategory; - public static fun values ()[Lcom/stripe/android/financialconnections/model/LinkedAccount$Subcategory; + public static fun valueOf (Ljava/lang/String;)Lcom/stripe/android/financialconnections/model/FinancialConnectionsAccount$Subcategory; + public static fun values ()[Lcom/stripe/android/financialconnections/model/FinancialConnectionsAccount$Subcategory; } -public final class com/stripe/android/financialconnections/model/LinkedAccount$Subcategory$$serializer : kotlinx/serialization/internal/GeneratedSerializer { - public static final field INSTANCE Lcom/stripe/android/financialconnections/model/LinkedAccount$Subcategory$$serializer; +public final class com/stripe/android/financialconnections/model/FinancialConnectionsAccount$Subcategory$$serializer : kotlinx/serialization/internal/GeneratedSerializer { + public static final field INSTANCE Lcom/stripe/android/financialconnections/model/FinancialConnectionsAccount$Subcategory$$serializer; public static final synthetic field descriptor Lkotlinx/serialization/descriptors/SerialDescriptor; public fun childSerializers ()[Lkotlinx/serialization/KSerializer; - public fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Lcom/stripe/android/financialconnections/model/LinkedAccount$Subcategory; + public fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Lcom/stripe/android/financialconnections/model/FinancialConnectionsAccount$Subcategory; public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; public fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; - public fun serialize (Lkotlinx/serialization/encoding/Encoder;Lcom/stripe/android/financialconnections/model/LinkedAccount$Subcategory;)V + public fun serialize (Lkotlinx/serialization/encoding/Encoder;Lcom/stripe/android/financialconnections/model/FinancialConnectionsAccount$Subcategory;)V public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer; } -public final class com/stripe/android/financialconnections/model/LinkedAccount$Subcategory$Companion { +public final class com/stripe/android/financialconnections/model/FinancialConnectionsAccount$Subcategory$Companion { public final fun serializer ()Lkotlinx/serialization/KSerializer; } -public final class com/stripe/android/financialconnections/model/LinkedAccount$SupportedPaymentMethodTypes : java/lang/Enum { - public static final field Companion Lcom/stripe/android/financialconnections/model/LinkedAccount$SupportedPaymentMethodTypes$Companion; - public static final field LINK Lcom/stripe/android/financialconnections/model/LinkedAccount$SupportedPaymentMethodTypes; - public static final field UNKNOWN Lcom/stripe/android/financialconnections/model/LinkedAccount$SupportedPaymentMethodTypes; - public static final field US_BANK_ACCOUNT Lcom/stripe/android/financialconnections/model/LinkedAccount$SupportedPaymentMethodTypes; +public final class com/stripe/android/financialconnections/model/FinancialConnectionsAccount$SupportedPaymentMethodTypes : java/lang/Enum { + public static final field Companion Lcom/stripe/android/financialconnections/model/FinancialConnectionsAccount$SupportedPaymentMethodTypes$Companion; + public static final field LINK Lcom/stripe/android/financialconnections/model/FinancialConnectionsAccount$SupportedPaymentMethodTypes; + public static final field UNKNOWN Lcom/stripe/android/financialconnections/model/FinancialConnectionsAccount$SupportedPaymentMethodTypes; + public static final field US_BANK_ACCOUNT Lcom/stripe/android/financialconnections/model/FinancialConnectionsAccount$SupportedPaymentMethodTypes; public final fun getValue ()Ljava/lang/String; - public static fun valueOf (Ljava/lang/String;)Lcom/stripe/android/financialconnections/model/LinkedAccount$SupportedPaymentMethodTypes; - public static fun values ()[Lcom/stripe/android/financialconnections/model/LinkedAccount$SupportedPaymentMethodTypes; + public static fun valueOf (Ljava/lang/String;)Lcom/stripe/android/financialconnections/model/FinancialConnectionsAccount$SupportedPaymentMethodTypes; + public static fun values ()[Lcom/stripe/android/financialconnections/model/FinancialConnectionsAccount$SupportedPaymentMethodTypes; } -public final class com/stripe/android/financialconnections/model/LinkedAccount$SupportedPaymentMethodTypes$$serializer : kotlinx/serialization/internal/GeneratedSerializer { - public static final field INSTANCE Lcom/stripe/android/financialconnections/model/LinkedAccount$SupportedPaymentMethodTypes$$serializer; +public final class com/stripe/android/financialconnections/model/FinancialConnectionsAccount$SupportedPaymentMethodTypes$$serializer : kotlinx/serialization/internal/GeneratedSerializer { + public static final field INSTANCE Lcom/stripe/android/financialconnections/model/FinancialConnectionsAccount$SupportedPaymentMethodTypes$$serializer; public static final synthetic field descriptor Lkotlinx/serialization/descriptors/SerialDescriptor; public fun childSerializers ()[Lkotlinx/serialization/KSerializer; - public fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Lcom/stripe/android/financialconnections/model/LinkedAccount$SupportedPaymentMethodTypes; + public fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Lcom/stripe/android/financialconnections/model/FinancialConnectionsAccount$SupportedPaymentMethodTypes; public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; public fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; - public fun serialize (Lkotlinx/serialization/encoding/Encoder;Lcom/stripe/android/financialconnections/model/LinkedAccount$SupportedPaymentMethodTypes;)V + public fun serialize (Lkotlinx/serialization/encoding/Encoder;Lcom/stripe/android/financialconnections/model/FinancialConnectionsAccount$SupportedPaymentMethodTypes;)V public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer; } -public final class com/stripe/android/financialconnections/model/LinkedAccount$SupportedPaymentMethodTypes$Companion { +public final class com/stripe/android/financialconnections/model/FinancialConnectionsAccount$SupportedPaymentMethodTypes$Companion { public final fun serializer ()Lkotlinx/serialization/KSerializer; } -public final class com/stripe/android/financialconnections/model/LinkedAccountList : android/os/Parcelable, com/stripe/android/core/model/StripeModel { +public final class com/stripe/android/financialconnections/model/FinancialConnectionsAccountList : android/os/Parcelable, com/stripe/android/core/model/StripeModel { public static final field CREATOR Landroid/os/Parcelable$Creator; - public static final field Companion Lcom/stripe/android/financialconnections/model/LinkedAccountList$Companion; + public static final field Companion Lcom/stripe/android/financialconnections/model/FinancialConnectionsAccountList$Companion; public synthetic fun (ILjava/util/List;ZLjava/lang/String;Ljava/lang/Integer;Ljava/lang/Integer;Lkotlinx/serialization/internal/SerializationConstructorMarker;)V public fun (Ljava/util/List;ZLjava/lang/String;Ljava/lang/Integer;Ljava/lang/Integer;)V public synthetic fun (Ljava/util/List;ZLjava/lang/String;Ljava/lang/Integer;Ljava/lang/Integer;ILkotlin/jvm/internal/DefaultConstructorMarker;)V @@ -798,60 +757,101 @@ public final class com/stripe/android/financialconnections/model/LinkedAccountLi public final fun component3 ()Ljava/lang/String; public final fun component4 ()Ljava/lang/Integer; public final fun component5 ()Ljava/lang/Integer; - public final fun copy (Ljava/util/List;ZLjava/lang/String;Ljava/lang/Integer;Ljava/lang/Integer;)Lcom/stripe/android/financialconnections/model/LinkedAccountList; - public static synthetic fun copy$default (Lcom/stripe/android/financialconnections/model/LinkedAccountList;Ljava/util/List;ZLjava/lang/String;Ljava/lang/Integer;Ljava/lang/Integer;ILjava/lang/Object;)Lcom/stripe/android/financialconnections/model/LinkedAccountList; + public final fun copy (Ljava/util/List;ZLjava/lang/String;Ljava/lang/Integer;Ljava/lang/Integer;)Lcom/stripe/android/financialconnections/model/FinancialConnectionsAccountList; + public static synthetic fun copy$default (Lcom/stripe/android/financialconnections/model/FinancialConnectionsAccountList;Ljava/util/List;ZLjava/lang/String;Ljava/lang/Integer;Ljava/lang/Integer;ILjava/lang/Object;)Lcom/stripe/android/financialconnections/model/FinancialConnectionsAccountList; public fun describeContents ()I public fun equals (Ljava/lang/Object;)Z public final fun getCount ()Ljava/lang/Integer; + public final fun getFinancialConnectionsAccounts ()Ljava/util/List; public final fun getHasMore ()Z - public final fun getLinkedAccounts ()Ljava/util/List; public final fun getTotalCount ()Ljava/lang/Integer; public final fun getUrl ()Ljava/lang/String; public fun hashCode ()I public fun toString ()Ljava/lang/String; - public static final fun write$Self (Lcom/stripe/android/financialconnections/model/LinkedAccountList;Lkotlinx/serialization/encoding/CompositeEncoder;Lkotlinx/serialization/descriptors/SerialDescriptor;)V + public static final fun write$Self (Lcom/stripe/android/financialconnections/model/FinancialConnectionsAccountList;Lkotlinx/serialization/encoding/CompositeEncoder;Lkotlinx/serialization/descriptors/SerialDescriptor;)V + public fun writeToParcel (Landroid/os/Parcel;I)V +} + +public final class com/stripe/android/financialconnections/model/FinancialConnectionsAccountList$$serializer : kotlinx/serialization/internal/GeneratedSerializer { + public static final field INSTANCE Lcom/stripe/android/financialconnections/model/FinancialConnectionsAccountList$$serializer; + public static final synthetic field descriptor Lkotlinx/serialization/descriptors/SerialDescriptor; + public fun childSerializers ()[Lkotlinx/serialization/KSerializer; + public fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Lcom/stripe/android/financialconnections/model/FinancialConnectionsAccountList; + public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; + public fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; + public fun serialize (Lkotlinx/serialization/encoding/Encoder;Lcom/stripe/android/financialconnections/model/FinancialConnectionsAccountList;)V + public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V + public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer; +} + +public final class com/stripe/android/financialconnections/model/FinancialConnectionsAccountList$Companion { + public final fun serializer ()Lkotlinx/serialization/KSerializer; +} + +public final class com/stripe/android/financialconnections/model/FinancialConnectionsSession : android/os/Parcelable, com/stripe/android/core/model/StripeModel { + public static final field CREATOR Landroid/os/Parcelable$Creator; + public static final field Companion Lcom/stripe/android/financialconnections/model/FinancialConnectionsSession$Companion; + public synthetic fun (ILjava/lang/String;Ljava/lang/String;Lcom/stripe/android/financialconnections/model/FinancialConnectionsAccountList;ZLcom/stripe/android/financialconnections/model/PaymentAccount;Ljava/lang/String;Ljava/lang/String;Lkotlinx/serialization/internal/SerializationConstructorMarker;)V + public final fun component1 ()Ljava/lang/String; + public final fun component2 ()Ljava/lang/String; + public final fun component3 ()Lcom/stripe/android/financialconnections/model/FinancialConnectionsAccountList; + public final fun component4 ()Z + public final fun component5 ()Lcom/stripe/android/financialconnections/model/PaymentAccount; + public final fun component6 ()Ljava/lang/String; + public final fun copy (Ljava/lang/String;Ljava/lang/String;Lcom/stripe/android/financialconnections/model/FinancialConnectionsAccountList;ZLcom/stripe/android/financialconnections/model/PaymentAccount;Ljava/lang/String;Ljava/lang/String;)Lcom/stripe/android/financialconnections/model/FinancialConnectionsSession; + public static synthetic fun copy$default (Lcom/stripe/android/financialconnections/model/FinancialConnectionsSession;Ljava/lang/String;Ljava/lang/String;Lcom/stripe/android/financialconnections/model/FinancialConnectionsAccountList;ZLcom/stripe/android/financialconnections/model/PaymentAccount;Ljava/lang/String;Ljava/lang/String;ILjava/lang/Object;)Lcom/stripe/android/financialconnections/model/FinancialConnectionsSession; + public fun describeContents ()I + public fun equals (Ljava/lang/Object;)Z + public final fun getAccounts ()Lcom/stripe/android/financialconnections/model/FinancialConnectionsAccountList; + public final fun getClientSecret ()Ljava/lang/String; + public final fun getId ()Ljava/lang/String; + public final fun getLivemode ()Z + public final fun getReturnUrl ()Ljava/lang/String; + public fun hashCode ()I + public fun toString ()Ljava/lang/String; + public static final fun write$Self (Lcom/stripe/android/financialconnections/model/FinancialConnectionsSession;Lkotlinx/serialization/encoding/CompositeEncoder;Lkotlinx/serialization/descriptors/SerialDescriptor;)V public fun writeToParcel (Landroid/os/Parcel;I)V } -public final class com/stripe/android/financialconnections/model/LinkedAccountList$$serializer : kotlinx/serialization/internal/GeneratedSerializer { - public static final field INSTANCE Lcom/stripe/android/financialconnections/model/LinkedAccountList$$serializer; +public final class com/stripe/android/financialconnections/model/FinancialConnectionsSession$$serializer : kotlinx/serialization/internal/GeneratedSerializer { + public static final field INSTANCE Lcom/stripe/android/financialconnections/model/FinancialConnectionsSession$$serializer; public static final synthetic field descriptor Lkotlinx/serialization/descriptors/SerialDescriptor; public fun childSerializers ()[Lkotlinx/serialization/KSerializer; - public fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Lcom/stripe/android/financialconnections/model/LinkedAccountList; + public fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Lcom/stripe/android/financialconnections/model/FinancialConnectionsSession; public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; public fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; - public fun serialize (Lkotlinx/serialization/encoding/Encoder;Lcom/stripe/android/financialconnections/model/LinkedAccountList;)V + public fun serialize (Lkotlinx/serialization/encoding/Encoder;Lcom/stripe/android/financialconnections/model/FinancialConnectionsSession;)V public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer; } -public final class com/stripe/android/financialconnections/model/LinkedAccountList$Companion { +public final class com/stripe/android/financialconnections/model/FinancialConnectionsSession$Companion { public final fun serializer ()Lkotlinx/serialization/KSerializer; } -public final class com/stripe/android/financialconnections/model/ListLinkedAccountParams : android/os/Parcelable { +public final class com/stripe/android/financialconnections/model/GetFinancialConnectionsAcccountsParams : android/os/Parcelable { public static final field CREATOR Landroid/os/Parcelable$Creator; public synthetic fun (ILjava/lang/String;Ljava/lang/String;Lkotlinx/serialization/internal/SerializationConstructorMarker;)V public fun (Ljava/lang/String;Ljava/lang/String;)V - public final fun copy (Ljava/lang/String;Ljava/lang/String;)Lcom/stripe/android/financialconnections/model/ListLinkedAccountParams; - public static synthetic fun copy$default (Lcom/stripe/android/financialconnections/model/ListLinkedAccountParams;Ljava/lang/String;Ljava/lang/String;ILjava/lang/Object;)Lcom/stripe/android/financialconnections/model/ListLinkedAccountParams; + public final fun copy (Ljava/lang/String;Ljava/lang/String;)Lcom/stripe/android/financialconnections/model/GetFinancialConnectionsAcccountsParams; + public static synthetic fun copy$default (Lcom/stripe/android/financialconnections/model/GetFinancialConnectionsAcccountsParams;Ljava/lang/String;Ljava/lang/String;ILjava/lang/Object;)Lcom/stripe/android/financialconnections/model/GetFinancialConnectionsAcccountsParams; public fun describeContents ()I public fun equals (Ljava/lang/Object;)Z public fun hashCode ()I public final fun toParamMap ()Ljava/util/Map; public fun toString ()Ljava/lang/String; - public static final fun write$Self (Lcom/stripe/android/financialconnections/model/ListLinkedAccountParams;Lkotlinx/serialization/encoding/CompositeEncoder;Lkotlinx/serialization/descriptors/SerialDescriptor;)V + public static final fun write$Self (Lcom/stripe/android/financialconnections/model/GetFinancialConnectionsAcccountsParams;Lkotlinx/serialization/encoding/CompositeEncoder;Lkotlinx/serialization/descriptors/SerialDescriptor;)V public fun writeToParcel (Landroid/os/Parcel;I)V } -public final class com/stripe/android/financialconnections/model/ListLinkedAccountParams$$serializer : kotlinx/serialization/internal/GeneratedSerializer { - public static final field INSTANCE Lcom/stripe/android/financialconnections/model/ListLinkedAccountParams$$serializer; +public final class com/stripe/android/financialconnections/model/GetFinancialConnectionsAcccountsParams$$serializer : kotlinx/serialization/internal/GeneratedSerializer { + public static final field INSTANCE Lcom/stripe/android/financialconnections/model/GetFinancialConnectionsAcccountsParams$$serializer; public static final synthetic field descriptor Lkotlinx/serialization/descriptors/SerialDescriptor; public fun childSerializers ()[Lkotlinx/serialization/KSerializer; - public fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Lcom/stripe/android/financialconnections/model/ListLinkedAccountParams; + public fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Lcom/stripe/android/financialconnections/model/GetFinancialConnectionsAcccountsParams; public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; public fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; - public fun serialize (Lkotlinx/serialization/encoding/Encoder;Lcom/stripe/android/financialconnections/model/ListLinkedAccountParams;)V + public fun serialize (Lkotlinx/serialization/encoding/Encoder;Lcom/stripe/android/financialconnections/model/GetFinancialConnectionsAcccountsParams;)V public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer; } @@ -927,11 +927,11 @@ public final class com/stripe/android/financialconnections/model/PaymentAccount$ public final fun serializer ()Lkotlinx/serialization/KSerializer; } -public final class com/stripe/android/financialconnections/repository/FinancialFinancialConnectionsApiRepository_Factory : dagger/internal/Factory { +public final class com/stripe/android/financialconnections/repository/FinancialConnectionsApiRepository_Factory : dagger/internal/Factory { public fun (Ljavax/inject/Provider;Ljavax/inject/Provider;Ljavax/inject/Provider;)V - public static fun create (Ljavax/inject/Provider;Ljavax/inject/Provider;Ljavax/inject/Provider;)Lcom/stripe/android/financialconnections/repository/FinancialFinancialConnectionsApiRepository_Factory; - public fun get ()Lcom/stripe/android/financialconnections/repository/FinancialFinancialConnectionsApiRepository; + public static fun create (Ljavax/inject/Provider;Ljavax/inject/Provider;Ljavax/inject/Provider;)Lcom/stripe/android/financialconnections/repository/FinancialConnectionsApiRepository_Factory; + public fun get ()Lcom/stripe/android/financialconnections/repository/FinancialConnectionsApiRepository; public synthetic fun get ()Ljava/lang/Object; - public static fun newInstance (Ljava/lang/String;Lcom/stripe/android/core/networking/StripeNetworkClient;Lcom/stripe/android/core/networking/ApiRequest$Factory;)Lcom/stripe/android/financialconnections/repository/FinancialFinancialConnectionsApiRepository; + public static fun newInstance (Ljava/lang/String;Lcom/stripe/android/core/networking/StripeNetworkClient;Lcom/stripe/android/core/networking/ApiRequest$Factory;)Lcom/stripe/android/financialconnections/repository/FinancialConnectionsApiRepository; } diff --git a/financial-connections/src/main/java/com/stripe/android/financialconnections/FinancialConnectionsSheet.kt b/financial-connections/src/main/java/com/stripe/android/financialconnections/FinancialConnectionsSheet.kt index b67171705cf..ea2de601aed 100644 --- a/financial-connections/src/main/java/com/stripe/android/financialconnections/FinancialConnectionsSheet.kt +++ b/financial-connections/src/main/java/com/stripe/android/financialconnections/FinancialConnectionsSheet.kt @@ -10,7 +10,7 @@ import com.stripe.android.financialconnections.launcher.FinancialConnectionsShee import kotlinx.parcelize.Parcelize /** - * A drop in class to present the Link Account Session Auth Flow. + * A drop in class to present the Financial Connections Auth Flow. * * This *must* be called unconditionally, as part of initialization path, * typically as a field initializer of an Activity or Fragment. @@ -21,12 +21,12 @@ class FinancialConnectionsSheet internal constructor( /** * Configuration for a [FinancialConnectionsSheet] * - * @param linkAccountSessionClientSecret the client secret for the Link Account Session + * @param financialConnectionsSessionClientSecret the session client secret * @param publishableKey the Stripe publishable key */ @Parcelize data class Configuration( - val linkAccountSessionClientSecret: String, + val financialConnectionsSessionClientSecret: String, val publishableKey: String, ) : Parcelable diff --git a/financial-connections/src/main/java/com/stripe/android/financialconnections/FinancialConnectionsSheetActivity.kt b/financial-connections/src/main/java/com/stripe/android/financialconnections/FinancialConnectionsSheetActivity.kt index de6f5d51984..aa5985d8972 100644 --- a/financial-connections/src/main/java/com/stripe/android/financialconnections/FinancialConnectionsSheetActivity.kt +++ b/financial-connections/src/main/java/com/stripe/android/financialconnections/FinancialConnectionsSheetActivity.kt @@ -107,7 +107,7 @@ internal class FinancialConnectionsSheetActivity : AppCompatActivity() { } /** - * If the back button is pressed during the manifest fetch or link account session fetch + * If the back button is pressed during the manifest fetch or session fetch * return canceled result */ override fun onBackPressed() { diff --git a/financial-connections/src/main/java/com/stripe/android/financialconnections/FinancialConnectionsSheetContract.kt b/financial-connections/src/main/java/com/stripe/android/financialconnections/FinancialConnectionsSheetContract.kt index 279e313d7fd..cc80de1898c 100644 --- a/financial-connections/src/main/java/com/stripe/android/financialconnections/FinancialConnectionsSheetContract.kt +++ b/financial-connections/src/main/java/com/stripe/android/financialconnections/FinancialConnectionsSheetContract.kt @@ -48,9 +48,9 @@ internal class FinancialConnectionsSheetContract : ) : Args(configuration) fun validate() { - if (configuration.linkAccountSessionClientSecret.isBlank()) { + if (configuration.financialConnectionsSessionClientSecret.isBlank()) { throw InvalidParameterException( - "The link account session client secret cannot be an empty string." + "The session client secret cannot be an empty string." ) } if (configuration.publishableKey.isBlank()) { @@ -70,7 +70,7 @@ internal class FinancialConnectionsSheetContract : internal sealed class Result : Parcelable { /** * The customer completed the connections session. - * @param financialConnectionsSession The link account session connected + * @param financialConnectionsSession The financial connections session connected */ @Parcelize data class Completed( diff --git a/financial-connections/src/main/java/com/stripe/android/financialconnections/FinancialConnectionsSheetForTokenResult.kt b/financial-connections/src/main/java/com/stripe/android/financialconnections/FinancialConnectionsSheetForTokenResult.kt index 91a457934f7..4725b6b7744 100644 --- a/financial-connections/src/main/java/com/stripe/android/financialconnections/FinancialConnectionsSheetForTokenResult.kt +++ b/financial-connections/src/main/java/com/stripe/android/financialconnections/FinancialConnectionsSheetForTokenResult.kt @@ -11,7 +11,7 @@ import kotlinx.parcelize.Parcelize sealed class FinancialConnectionsSheetForTokenResult : Parcelable { /** * The customer completed the connections session. - * @param financialConnectionsSession The link account session connected + * @param financialConnectionsSession The financial connections session connected */ @Parcelize data class Completed( diff --git a/financial-connections/src/main/java/com/stripe/android/financialconnections/FinancialConnectionsSheetResult.kt b/financial-connections/src/main/java/com/stripe/android/financialconnections/FinancialConnectionsSheetResult.kt index e3760255a7f..4393aa51b47 100644 --- a/financial-connections/src/main/java/com/stripe/android/financialconnections/FinancialConnectionsSheetResult.kt +++ b/financial-connections/src/main/java/com/stripe/android/financialconnections/FinancialConnectionsSheetResult.kt @@ -10,7 +10,7 @@ import kotlinx.parcelize.Parcelize sealed class FinancialConnectionsSheetResult : Parcelable { /** * The customer completed the connections session. - * @param financialConnectionsSession The link account session connected + * @param financialConnectionsSession The financial connections session connected */ @Parcelize data class Completed( diff --git a/financial-connections/src/main/java/com/stripe/android/financialconnections/FinancialConnectionsSheetViewModel.kt b/financial-connections/src/main/java/com/stripe/android/financialconnections/FinancialConnectionsSheetViewModel.kt index 7702aaa8968..97ea42e91d1 100644 --- a/financial-connections/src/main/java/com/stripe/android/financialconnections/FinancialConnectionsSheetViewModel.kt +++ b/financial-connections/src/main/java/com/stripe/android/financialconnections/FinancialConnectionsSheetViewModel.kt @@ -8,7 +8,6 @@ import androidx.lifecycle.SavedStateHandle import androidx.lifecycle.ViewModel import androidx.lifecycle.viewModelScope import androidx.savedstate.SavedStateRegistryOwner -import com.stripe.android.connections.domain.FetchLinkAccountSessionForToken import com.stripe.android.financialconnections.FinancialConnectionsSheetContract.Result.Canceled import com.stripe.android.financialconnections.FinancialConnectionsSheetContract.Result.Completed import com.stripe.android.financialconnections.FinancialConnectionsSheetContract.Result.Failed @@ -17,8 +16,9 @@ import com.stripe.android.financialconnections.FinancialConnectionsSheetViewEffe import com.stripe.android.financialconnections.analytics.FinancialConnectionsEventReporter import com.stripe.android.financialconnections.di.APPLICATION_ID import com.stripe.android.financialconnections.di.DaggerFinancialConnectionsSheetComponent -import com.stripe.android.financialconnections.domain.FetchLinkAccountSession -import com.stripe.android.financialconnections.domain.GenerateLinkAccountSessionManifest +import com.stripe.android.financialconnections.domain.FetchFinancialConnectionsSession +import com.stripe.android.financialconnections.domain.FetchFinancialConnectionsSessionForToken +import com.stripe.android.financialconnections.domain.GenerateFinancialConnectionsSessionManifest import com.stripe.android.financialconnections.model.FinancialConnectionsSession import com.stripe.android.financialconnections.model.FinancialConnectionsSessionManifest import kotlinx.coroutines.flow.MutableSharedFlow @@ -34,9 +34,9 @@ import javax.inject.Named internal class FinancialConnectionsSheetViewModel @Inject constructor( @Named(APPLICATION_ID) private val applicationId: String, private val starterArgs: FinancialConnectionsSheetContract.Args, - private val generateLinkAccountSessionManifest: GenerateLinkAccountSessionManifest, - private val fetchLinkAccountSession: FetchLinkAccountSession, - private val fetchLinkAccountSessionForToken: FetchLinkAccountSessionForToken, + private val generateFinancialConnectionsSessionManifest: GenerateFinancialConnectionsSessionManifest, + private val fetchFinancialConnectionsSession: FetchFinancialConnectionsSession, + private val fetchFinancialConnectionsSessionForToken: FetchFinancialConnectionsSessionForToken, private val savedStateHandle: SavedStateHandle, private val eventReporter: FinancialConnectionsEventReporter ) : ViewModel() { @@ -63,8 +63,8 @@ internal class FinancialConnectionsSheetViewModel @Inject constructor( private fun fetchManifest() { viewModelScope.launch { kotlin.runCatching { - generateLinkAccountSessionManifest( - clientSecret = starterArgs.configuration.linkAccountSessionClientSecret, + generateFinancialConnectionsSessionManifest( + clientSecret = starterArgs.configuration.financialConnectionsSessionClientSecret, applicationId = applicationId ) }.onFailure { @@ -139,16 +139,16 @@ internal class FinancialConnectionsSheetViewModel @Inject constructor( } /** - * For regular connections flows requesting a link account session: + * For regular connections flows requesting a session: * * On successfully completing the hosted auth flow and receiving the success callback intent, * fetch the updated [FinancialConnectionsSession] model from the API * and return it back as a [Completed] result. */ - private fun fetchLinkAccountSession() { + private fun fetchFinancialConnectionsSession() { viewModelScope.launch { kotlin.runCatching { - fetchLinkAccountSession(starterArgs.configuration.linkAccountSessionClientSecret) + fetchFinancialConnectionsSession(starterArgs.configuration.financialConnectionsSessionClientSecret) }.onSuccess { val result = Completed(it) eventReporter.onResult(starterArgs.configuration, result) @@ -166,10 +166,12 @@ internal class FinancialConnectionsSheetViewModel @Inject constructor( * fetch the updated [FinancialConnectionsSession] and the generated [com.stripe.android.model.Token] * and return it back as a [Completed] result. */ - private fun fetchLinkAccountSessionForToken() { + private fun fetchFinancialConnectionsSessionForToken() { viewModelScope.launch { kotlin.runCatching { - fetchLinkAccountSessionForToken(starterArgs.configuration.linkAccountSessionClientSecret) + fetchFinancialConnectionsSessionForToken( + clientSecret = starterArgs.configuration.financialConnectionsSessionClientSecret + ) }.onSuccess { (las, token) -> val result = Completed(las, token) eventReporter.onResult(starterArgs.configuration, result) @@ -217,8 +219,8 @@ internal class FinancialConnectionsSheetViewModel @Inject constructor( val manifest = _state.value.manifest when (intent?.data.toString()) { manifest?.successUrl -> when (starterArgs) { - is FinancialConnectionsSheetContract.Args.Default -> fetchLinkAccountSession() - is FinancialConnectionsSheetContract.Args.ForToken -> fetchLinkAccountSessionForToken() + is FinancialConnectionsSheetContract.Args.Default -> fetchFinancialConnectionsSession() + is FinancialConnectionsSheetContract.Args.ForToken -> fetchFinancialConnectionsSessionForToken() } manifest?.cancelUrl -> onUserCancel() else -> onFatal(Exception("Error processing FinancialConnectionsSheet intent")) diff --git a/financial-connections/src/main/java/com/stripe/android/financialconnections/analytics/DefaultFinancialFinancialConnectionsEventReporter.kt b/financial-connections/src/main/java/com/stripe/android/financialconnections/analytics/DefaultFinancialFinancialConnectionsEventReporter.kt index 8583c37c297..86e2bcf7813 100644 --- a/financial-connections/src/main/java/com/stripe/android/financialconnections/analytics/DefaultFinancialFinancialConnectionsEventReporter.kt +++ b/financial-connections/src/main/java/com/stripe/android/financialconnections/analytics/DefaultFinancialFinancialConnectionsEventReporter.kt @@ -20,7 +20,7 @@ internal class DefaultFinancialFinancialConnectionsEventReporter @Inject constru fireEvent( FinancialConnectionsAnalyticsEvent( FinancialConnectionsAnalyticsEvent.Code.SheetPresented, - mapOf(PARAM_CLIENT_SECRET to configuration.linkAccountSessionClientSecret) + mapOf(PARAM_CLIENT_SECRET to configuration.financialConnectionsSessionClientSecret) ) ) } @@ -34,7 +34,7 @@ internal class DefaultFinancialFinancialConnectionsEventReporter @Inject constru FinancialConnectionsAnalyticsEvent( FinancialConnectionsAnalyticsEvent.Code.SheetClosed, mapOf( - PARAM_CLIENT_SECRET to configuration.linkAccountSessionClientSecret, + PARAM_CLIENT_SECRET to configuration.financialConnectionsSessionClientSecret, PARAM_SESSION_RESULT to "completed" ) ) @@ -42,7 +42,7 @@ internal class DefaultFinancialFinancialConnectionsEventReporter @Inject constru FinancialConnectionsAnalyticsEvent( FinancialConnectionsAnalyticsEvent.Code.SheetClosed, mapOf( - PARAM_CLIENT_SECRET to configuration.linkAccountSessionClientSecret, + PARAM_CLIENT_SECRET to configuration.financialConnectionsSessionClientSecret, PARAM_SESSION_RESULT to "cancelled" ) ) @@ -50,7 +50,7 @@ internal class DefaultFinancialFinancialConnectionsEventReporter @Inject constru FinancialConnectionsAnalyticsEvent( FinancialConnectionsAnalyticsEvent.Code.SheetFailed, mapOf( - PARAM_CLIENT_SECRET to configuration.linkAccountSessionClientSecret, + PARAM_CLIENT_SECRET to configuration.financialConnectionsSessionClientSecret, PARAM_SESSION_RESULT to "failure" ) ) diff --git a/financial-connections/src/main/java/com/stripe/android/financialconnections/di/FinancialConnectionsSheetModule.kt b/financial-connections/src/main/java/com/stripe/android/financialconnections/di/FinancialConnectionsSheetModule.kt index 70c0d8fb072..66af0b5ce7c 100644 --- a/financial-connections/src/main/java/com/stripe/android/financialconnections/di/FinancialConnectionsSheetModule.kt +++ b/financial-connections/src/main/java/com/stripe/android/financialconnections/di/FinancialConnectionsSheetModule.kt @@ -12,8 +12,8 @@ import com.stripe.android.core.networking.DefaultStripeNetworkClient import com.stripe.android.core.networking.StripeNetworkClient import com.stripe.android.financialconnections.analytics.DefaultFinancialFinancialConnectionsEventReporter import com.stripe.android.financialconnections.analytics.FinancialConnectionsEventReporter +import com.stripe.android.financialconnections.repository.FinancialConnectionsApiRepository import com.stripe.android.financialconnections.repository.FinancialConnectionsRepository -import com.stripe.android.financialconnections.repository.FinancialFinancialConnectionsApiRepository import dagger.Module import dagger.Provides import java.util.Locale @@ -43,7 +43,7 @@ internal object FinancialConnectionsSheetModule { @Provides @Singleton fun provideConnectionsRepository( - repository: FinancialFinancialConnectionsApiRepository + repository: FinancialConnectionsApiRepository ): FinancialConnectionsRepository = repository @Provides diff --git a/financial-connections/src/main/java/com/stripe/android/financialconnections/domain/FetchFinancialConnectionsSession.kt b/financial-connections/src/main/java/com/stripe/android/financialconnections/domain/FetchFinancialConnectionsSession.kt new file mode 100644 index 00000000000..bad85b4143e --- /dev/null +++ b/financial-connections/src/main/java/com/stripe/android/financialconnections/domain/FetchFinancialConnectionsSession.kt @@ -0,0 +1,56 @@ +package com.stripe.android.financialconnections.domain + +import com.stripe.android.financialconnections.FinancialConnectionsSheetViewModel +import com.stripe.android.financialconnections.model.FinancialConnectionsAccount +import com.stripe.android.financialconnections.model.FinancialConnectionsAccountList +import com.stripe.android.financialconnections.model.FinancialConnectionsSession +import com.stripe.android.financialconnections.model.GetFinancialConnectionsAcccountsParams +import com.stripe.android.financialconnections.repository.FinancialConnectionsRepository +import javax.inject.Inject + +internal class FetchFinancialConnectionsSession @Inject constructor( + private val financialConnectionsRepository: FinancialConnectionsRepository +) { + + /** + * Fetches the session with all the connected accounts via pagination + * + * @param clientSecret the [FinancialConnectionsSession] client secret + * + * @return [FinancialConnectionsSession] with all connected accounts + */ + suspend operator fun invoke(clientSecret: String): FinancialConnectionsSession { + val session = financialConnectionsRepository.getFinancialConnectionsSession(clientSecret) + if (session.accounts.hasMore) { + val accounts = mutableListOf() + accounts.addAll(session.accounts.financialConnectionsAccounts) + + var nextAccountList = financialConnectionsRepository.getFinancialConnectionsAccounts( + GetFinancialConnectionsAcccountsParams(clientSecret, accounts.last().id) + ) + accounts.addAll(nextAccountList.financialConnectionsAccounts) + + while (nextAccountList.hasMore && accounts.size < FinancialConnectionsSheetViewModel.MAX_ACCOUNTS) { + nextAccountList = financialConnectionsRepository.getFinancialConnectionsAccounts( + GetFinancialConnectionsAcccountsParams(clientSecret, accounts.last().id) + ) + accounts.addAll(nextAccountList.financialConnectionsAccounts) + } + + return FinancialConnectionsSession( + id = session.id, + clientSecret = session.clientSecret, + accounts = FinancialConnectionsAccountList( + financialConnectionsAccounts = accounts, + hasMore = nextAccountList.hasMore, + url = nextAccountList.url, + count = accounts.size, + totalCount = nextAccountList.totalCount + ), + bankAccountToken = null, // Token should not be exposed on regular sessions. + livemode = session.livemode + ) + } + return session + } +} diff --git a/financial-connections/src/main/java/com/stripe/android/financialconnections/domain/FetchLinkAccountSessionForToken.kt b/financial-connections/src/main/java/com/stripe/android/financialconnections/domain/FetchFinancialConnectionsSessionForToken.kt similarity index 62% rename from financial-connections/src/main/java/com/stripe/android/financialconnections/domain/FetchLinkAccountSessionForToken.kt rename to financial-connections/src/main/java/com/stripe/android/financialconnections/domain/FetchFinancialConnectionsSessionForToken.kt index 9c6c030f106..d8a6314f655 100644 --- a/financial-connections/src/main/java/com/stripe/android/financialconnections/domain/FetchLinkAccountSessionForToken.kt +++ b/financial-connections/src/main/java/com/stripe/android/financialconnections/domain/FetchFinancialConnectionsSessionForToken.kt @@ -1,4 +1,4 @@ -package com.stripe.android.connections.domain +package com.stripe.android.financialconnections.domain import com.stripe.android.financialconnections.model.FinancialConnectionsSession import com.stripe.android.financialconnections.repository.FinancialConnectionsRepository @@ -7,22 +7,22 @@ import com.stripe.android.model.parsers.TokenJsonParser import org.json.JSONObject import javax.inject.Inject -internal class FetchLinkAccountSessionForToken @Inject constructor( +internal class FetchFinancialConnectionsSessionForToken @Inject constructor( private val connectionsRepository: FinancialConnectionsRepository ) { /** * Fetches the [FinancialConnectionsSession] and its nested [Token]. * - * @param clientSecret the link account session client secret + * @param clientSecret the [FinancialConnectionsSession] client secret * * @return pair of [FinancialConnectionsSession] and [Token] */ suspend operator fun invoke(clientSecret: String): Pair { - val linkAccountSession = connectionsRepository.getLinkAccountSession(clientSecret) + val session = connectionsRepository.getFinancialConnectionsSession(clientSecret) val parsedToken = - linkAccountSession.bankAccountToken?.let { TokenJsonParser().parse(JSONObject(it)) } - requireNotNull(parsedToken) { "Could not extract Token from LinkedAccountSession." } - return linkAccountSession to parsedToken + session.bankAccountToken?.let { TokenJsonParser().parse(JSONObject(it)) } + requireNotNull(parsedToken) { "Could not extract Token from FinancialConnectionsSession." } + return session to parsedToken } } diff --git a/financial-connections/src/main/java/com/stripe/android/financialconnections/domain/FetchLinkAccountSession.kt b/financial-connections/src/main/java/com/stripe/android/financialconnections/domain/FetchLinkAccountSession.kt deleted file mode 100644 index be55d83749a..00000000000 --- a/financial-connections/src/main/java/com/stripe/android/financialconnections/domain/FetchLinkAccountSession.kt +++ /dev/null @@ -1,56 +0,0 @@ -package com.stripe.android.financialconnections.domain - -import com.stripe.android.financialconnections.FinancialConnectionsSheetViewModel -import com.stripe.android.financialconnections.model.FinancialConnectionsSession -import com.stripe.android.financialconnections.model.LinkedAccount -import com.stripe.android.financialconnections.model.LinkedAccountList -import com.stripe.android.financialconnections.model.ListLinkedAccountParams -import com.stripe.android.financialconnections.repository.FinancialConnectionsRepository -import javax.inject.Inject - -internal class FetchLinkAccountSession @Inject constructor( - private val financialConnectionsRepository: FinancialConnectionsRepository -) { - - /** - * Fetches the link account session with all linked accounts via pagination - * - * @param clientSecret the link account session client secret - * - * @return LinkAccountSession with all linked accounts - */ - suspend operator fun invoke(clientSecret: String): FinancialConnectionsSession { - val linkAccountSession = financialConnectionsRepository.getLinkAccountSession(clientSecret) - if (linkAccountSession.linkedAccounts.hasMore) { - val accounts = mutableListOf() - accounts.addAll(linkAccountSession.linkedAccounts.linkedAccounts) - - var nextLinkedAccountList = financialConnectionsRepository.getLinkedAccounts( - ListLinkedAccountParams(clientSecret, accounts.last().id) - ) - accounts.addAll(nextLinkedAccountList.linkedAccounts) - - while (nextLinkedAccountList.hasMore && accounts.size < FinancialConnectionsSheetViewModel.MAX_ACCOUNTS) { - nextLinkedAccountList = financialConnectionsRepository.getLinkedAccounts( - ListLinkedAccountParams(clientSecret, accounts.last().id) - ) - accounts.addAll(nextLinkedAccountList.linkedAccounts) - } - - return FinancialConnectionsSession( - id = linkAccountSession.id, - clientSecret = linkAccountSession.clientSecret, - linkedAccounts = LinkedAccountList( - linkedAccounts = accounts, - hasMore = nextLinkedAccountList.hasMore, - url = nextLinkedAccountList.url, - count = accounts.size, - totalCount = nextLinkedAccountList.totalCount - ), - bankAccountToken = null, // Token should not be exposed on regular sessions. - livemode = linkAccountSession.livemode - ) - } - return linkAccountSession - } -} diff --git a/financial-connections/src/main/java/com/stripe/android/financialconnections/domain/GenerateLinkAccountSessionManifest.kt b/financial-connections/src/main/java/com/stripe/android/financialconnections/domain/GenerateFinancialConnectionsSessionManifest.kt similarity index 81% rename from financial-connections/src/main/java/com/stripe/android/financialconnections/domain/GenerateLinkAccountSessionManifest.kt rename to financial-connections/src/main/java/com/stripe/android/financialconnections/domain/GenerateFinancialConnectionsSessionManifest.kt index b32e08c7eb7..0c42b8b2f03 100644 --- a/financial-connections/src/main/java/com/stripe/android/financialconnections/domain/GenerateLinkAccountSessionManifest.kt +++ b/financial-connections/src/main/java/com/stripe/android/financialconnections/domain/GenerateFinancialConnectionsSessionManifest.kt @@ -8,7 +8,7 @@ import javax.inject.Inject * Fetches the [FinancialConnectionsSessionManifest] from the Stripe API to get the hosted auth flow URL * as well as the success and cancel callback URLs to verify. */ -internal class GenerateLinkAccountSessionManifest @Inject constructor( +internal class GenerateFinancialConnectionsSessionManifest @Inject constructor( private val financialConnectionsRepository: FinancialConnectionsRepository, ) { @@ -16,7 +16,7 @@ internal class GenerateLinkAccountSessionManifest @Inject constructor( clientSecret: String, applicationId: String ): FinancialConnectionsSessionManifest { - return financialConnectionsRepository.generateLinkAccountSessionManifest( + return financialConnectionsRepository.generateFinancialConnectionsSessionManifest( clientSecret = clientSecret, applicationId = applicationId ) diff --git a/financial-connections/src/main/java/com/stripe/android/financialconnections/model/AccountHolder.kt b/financial-connections/src/main/java/com/stripe/android/financialconnections/model/AccountHolder.kt index ecb8601de67..9355354609e 100644 --- a/financial-connections/src/main/java/com/stripe/android/financialconnections/model/AccountHolder.kt +++ b/financial-connections/src/main/java/com/stripe/android/financialconnections/model/AccountHolder.kt @@ -11,7 +11,7 @@ import kotlinx.serialization.Serializable * * @param type * @param account - * @param customer ID of the Customer this LinkedAccount belongs to. Present if and only if `type` is `customer`. + * @param customer ID of the Customer this account belongs to. Present if and only if `type` is `customer`. */ @Parcelize @Serializable @@ -24,7 +24,7 @@ data class AccountHolder( @SerialName("account") val account: String? = null, - /* ID of the Customer this LinkedAccount belongs to. Present if and only if `type` is `customer`. */ + /* ID of the Customer this account belongs to. Present if and only if `type` is `customer`. */ @SerialName("customer") val customer: String? = null diff --git a/financial-connections/src/main/java/com/stripe/android/financialconnections/model/LinkedAccount.kt b/financial-connections/src/main/java/com/stripe/android/financialconnections/model/FinancialConnectionsAccount.kt similarity index 95% rename from financial-connections/src/main/java/com/stripe/android/financialconnections/model/LinkedAccount.kt rename to financial-connections/src/main/java/com/stripe/android/financialconnections/model/FinancialConnectionsAccount.kt index f7dd4303e68..10f69c51398 100644 --- a/financial-connections/src/main/java/com/stripe/android/financialconnections/model/LinkedAccount.kt +++ b/financial-connections/src/main/java/com/stripe/android/financialconnections/model/FinancialConnectionsAccount.kt @@ -7,7 +7,7 @@ import kotlinx.serialization.SerialName import kotlinx.serialization.Serializable /** - * A Linked Account represents an account that exists outside of Stripe, + * A FinancialConnectionsAccount represents an account that exists outside of Stripe, * to which you have been granted some degree of access. * * @param category @@ -22,7 +22,7 @@ import kotlinx.serialization.Serializable * If `category` is `investment` or `other`, this will be `other`. * @param supportedPaymentMethodTypes * The [PaymentMethod type](https://stripe.com/docs/api/payment_methods/object#payment_method_object-type)(s) - * that can be created from this LinkedAccount. + * that can be created from this FinancialConnectionsAccount. * @param accountholder * @param balance The most recent information about the account's balance. * @param balanceRefresh The state of the most recent attempt to refresh the account balance. @@ -36,7 +36,7 @@ import kotlinx.serialization.Serializable @Serializable @Parcelize @Suppress("unused") -data class LinkedAccount( +data class FinancialConnectionsAccount( @SerialName("category") val category: Category = Category.UNKNOWN, @@ -69,7 +69,7 @@ data class LinkedAccount( val subcategory: Subcategory = Subcategory.UNKNOWN, /* The [PaymentMethod type](https://stripe.com/docs/api/payment_methods/object#payment_method_object-type)(s) - that can be created from this LinkedAccount. */ + that can be created from this FinancialConnectionsAccount. */ @SerialName("supported_payment_method_types") val supportedPaymentMethodTypes: List, @@ -180,7 +180,7 @@ data class LinkedAccount( /** * The [PaymentMethod type](https://stripe.com/docs/api/payment_methods/object#payment_method_object-type)(s) - * that can be created from this LinkedAccount. + * that can be created from this FinancialConnectionsAccount. * * Values: link,usBankAccount */ diff --git a/financial-connections/src/main/java/com/stripe/android/financialconnections/model/LinkedAccountList.kt b/financial-connections/src/main/java/com/stripe/android/financialconnections/model/FinancialConnectionsAccountList.kt similarity index 88% rename from financial-connections/src/main/java/com/stripe/android/financialconnections/model/LinkedAccountList.kt rename to financial-connections/src/main/java/com/stripe/android/financialconnections/model/FinancialConnectionsAccountList.kt index 7e0b2cd8565..40c2cf188dc 100644 --- a/financial-connections/src/main/java/com/stripe/android/financialconnections/model/LinkedAccountList.kt +++ b/financial-connections/src/main/java/com/stripe/android/financialconnections/model/FinancialConnectionsAccountList.kt @@ -17,9 +17,9 @@ import kotlinx.serialization.Serializable */ @Parcelize @Serializable -data class LinkedAccountList( +data class FinancialConnectionsAccountList( @SerialName("data") - val linkedAccounts: List, + val financialConnectionsAccounts: List, /* True if this list has another page of items after this one that can be fetched. */ @SerialName("has_more") diff --git a/financial-connections/src/main/java/com/stripe/android/financialconnections/model/FinancialConnectionsSession.kt b/financial-connections/src/main/java/com/stripe/android/financialconnections/model/FinancialConnectionsSession.kt index 83fd186083d..6959038bd66 100644 --- a/financial-connections/src/main/java/com/stripe/android/financialconnections/model/FinancialConnectionsSession.kt +++ b/financial-connections/src/main/java/com/stripe/android/financialconnections/model/FinancialConnectionsSession.kt @@ -14,7 +14,7 @@ import kotlinx.serialization.Serializable * * @param clientSecret * @param id - * @param linkedAccounts + * @param accounts * @param livemode * @param paymentAccount * @param returnUrl @@ -29,7 +29,7 @@ data class FinancialConnectionsSession internal constructor( val id: String, @SerialName("linked_accounts") - val linkedAccounts: LinkedAccountList, + val accounts: FinancialConnectionsAccountList, @SerialName("livemode") val livemode: Boolean, diff --git a/financial-connections/src/main/java/com/stripe/android/financialconnections/model/ListLinkedAccountParams.kt b/financial-connections/src/main/java/com/stripe/android/financialconnections/model/GetFinancialConnectionsAcccountsParams.kt similarity index 94% rename from financial-connections/src/main/java/com/stripe/android/financialconnections/model/ListLinkedAccountParams.kt rename to financial-connections/src/main/java/com/stripe/android/financialconnections/model/GetFinancialConnectionsAcccountsParams.kt index c98ec7d037d..96acd14068b 100644 --- a/financial-connections/src/main/java/com/stripe/android/financialconnections/model/ListLinkedAccountParams.kt +++ b/financial-connections/src/main/java/com/stripe/android/financialconnections/model/GetFinancialConnectionsAcccountsParams.kt @@ -7,7 +7,7 @@ import kotlinx.serialization.Serializable @Parcelize @Serializable -data class ListLinkedAccountParams( +data class GetFinancialConnectionsAcccountsParams( @SerialName("client_secret") private val clientSecret: String, @SerialName("starting_after") private val startingAfterAccountId: String?, ) : Parcelable { diff --git a/financial-connections/src/main/java/com/stripe/android/financialconnections/model/serializer/PaymentAccountSerializer.kt b/financial-connections/src/main/java/com/stripe/android/financialconnections/model/serializer/PaymentAccountSerializer.kt index 5cf6a3c2b7e..f5af2d603b1 100644 --- a/financial-connections/src/main/java/com/stripe/android/financialconnections/model/serializer/PaymentAccountSerializer.kt +++ b/financial-connections/src/main/java/com/stripe/android/financialconnections/model/serializer/PaymentAccountSerializer.kt @@ -1,7 +1,7 @@ package com.stripe.android.financialconnections.model.serializer import com.stripe.android.financialconnections.model.BankAccount -import com.stripe.android.financialconnections.model.LinkedAccount +import com.stripe.android.financialconnections.model.FinancialConnectionsAccount import com.stripe.android.financialconnections.model.PaymentAccount import kotlinx.serialization.KSerializer import kotlinx.serialization.json.JsonContentPolymorphicSerializer @@ -14,7 +14,7 @@ internal object PaymentAccountSerializer : override fun selectDeserializer(element: JsonElement): KSerializer { return when (element.objectValue) { - LinkedAccount.OBJECT -> LinkedAccount.serializer() + FinancialConnectionsAccount.OBJECT -> FinancialConnectionsAccount.serializer() else -> BankAccount.serializer() } } diff --git a/financial-connections/src/main/java/com/stripe/android/financialconnections/repository/FinancialFinancialConnectionsApiRepository.kt b/financial-connections/src/main/java/com/stripe/android/financialconnections/repository/FinancialConnectionsApiRepository.kt similarity index 87% rename from financial-connections/src/main/java/com/stripe/android/financialconnections/repository/FinancialFinancialConnectionsApiRepository.kt rename to financial-connections/src/main/java/com/stripe/android/financialconnections/repository/FinancialConnectionsApiRepository.kt index 53b7f0539ff..a0d82094ad1 100644 --- a/financial-connections/src/main/java/com/stripe/android/financialconnections/repository/FinancialFinancialConnectionsApiRepository.kt +++ b/financial-connections/src/main/java/com/stripe/android/financialconnections/repository/FinancialConnectionsApiRepository.kt @@ -15,17 +15,17 @@ import com.stripe.android.core.networking.StripeRequest import com.stripe.android.core.networking.StripeResponse import com.stripe.android.core.networking.responseJson import com.stripe.android.financialconnections.di.PUBLISHABLE_KEY +import com.stripe.android.financialconnections.model.FinancialConnectionsAccountList import com.stripe.android.financialconnections.model.FinancialConnectionsSession import com.stripe.android.financialconnections.model.FinancialConnectionsSessionManifest -import com.stripe.android.financialconnections.model.LinkedAccountList -import com.stripe.android.financialconnections.model.ListLinkedAccountParams +import com.stripe.android.financialconnections.model.GetFinancialConnectionsAcccountsParams import kotlinx.serialization.KSerializer import kotlinx.serialization.json.Json import java.net.HttpURLConnection import javax.inject.Inject import javax.inject.Named -internal class FinancialFinancialConnectionsApiRepository @Inject constructor( +internal class FinancialConnectionsApiRepository @Inject constructor( @Named(PUBLISHABLE_KEY) publishableKey: String, private val stripeNetworkClient: StripeNetworkClient, private val apiRequestFactory: ApiRequest.Factory @@ -43,18 +43,18 @@ internal class FinancialFinancialConnectionsApiRepository @Inject constructor( apiKey = publishableKey ) - override suspend fun getLinkedAccounts( - listLinkedAccountParams: ListLinkedAccountParams - ): LinkedAccountList { + override suspend fun getFinancialConnectionsAccounts( + getFinancialConnectionsAcccountsParams: GetFinancialConnectionsAcccountsParams + ): FinancialConnectionsAccountList { val financialConnectionsRequest = apiRequestFactory.createGet( url = listAccountsUrl, options = options, - params = listLinkedAccountParams.toParamMap() + params = getFinancialConnectionsAcccountsParams.toParamMap() ) - return executeRequest(financialConnectionsRequest, LinkedAccountList.serializer()) + return executeRequest(financialConnectionsRequest, FinancialConnectionsAccountList.serializer()) } - override suspend fun getLinkAccountSession( + override suspend fun getFinancialConnectionsSession( clientSecret: String ): FinancialConnectionsSession { val financialConnectionsRequest = apiRequestFactory.createGet( @@ -67,7 +67,7 @@ internal class FinancialFinancialConnectionsApiRepository @Inject constructor( return executeRequest(financialConnectionsRequest, FinancialConnectionsSession.serializer()) } - override suspend fun generateLinkAccountSessionManifest( + override suspend fun generateFinancialConnectionsSessionManifest( clientSecret: String, applicationId: String ): FinancialConnectionsSessionManifest { diff --git a/financial-connections/src/main/java/com/stripe/android/financialconnections/repository/FinancialConnectionsRepository.kt b/financial-connections/src/main/java/com/stripe/android/financialconnections/repository/FinancialConnectionsRepository.kt index 87549ee1ba3..e65aea47501 100644 --- a/financial-connections/src/main/java/com/stripe/android/financialconnections/repository/FinancialConnectionsRepository.kt +++ b/financial-connections/src/main/java/com/stripe/android/financialconnections/repository/FinancialConnectionsRepository.kt @@ -4,10 +4,10 @@ import com.stripe.android.core.exception.APIConnectionException import com.stripe.android.core.exception.APIException import com.stripe.android.core.exception.AuthenticationException import com.stripe.android.core.exception.InvalidRequestException +import com.stripe.android.financialconnections.model.FinancialConnectionsAccountList import com.stripe.android.financialconnections.model.FinancialConnectionsSession import com.stripe.android.financialconnections.model.FinancialConnectionsSessionManifest -import com.stripe.android.financialconnections.model.LinkedAccountList -import com.stripe.android.financialconnections.model.ListLinkedAccountParams +import com.stripe.android.financialconnections.model.GetFinancialConnectionsAcccountsParams internal interface FinancialConnectionsRepository { @Throws( @@ -16,9 +16,9 @@ internal interface FinancialConnectionsRepository { APIConnectionException::class, APIException::class ) - suspend fun getLinkedAccounts( - listLinkedAccountParams: ListLinkedAccountParams - ): LinkedAccountList + suspend fun getFinancialConnectionsAccounts( + getFinancialConnectionsAcccountsParams: GetFinancialConnectionsAcccountsParams + ): FinancialConnectionsAccountList @Throws( AuthenticationException::class, @@ -26,7 +26,7 @@ internal interface FinancialConnectionsRepository { APIConnectionException::class, APIException::class ) - suspend fun getLinkAccountSession( + suspend fun getFinancialConnectionsSession( clientSecret: String ): FinancialConnectionsSession @@ -36,7 +36,7 @@ internal interface FinancialConnectionsRepository { APIConnectionException::class, APIException::class ) - suspend fun generateLinkAccountSessionManifest( + suspend fun generateFinancialConnectionsSessionManifest( clientSecret: String, applicationId: String ): FinancialConnectionsSessionManifest diff --git a/financial-connections/src/test/java/com/stripe/android/financialconnections/ApiKeyFixtures.kt b/financial-connections/src/test/java/com/stripe/android/financialconnections/ApiKeyFixtures.kt index 365855bbb2f..2782e72d595 100644 --- a/financial-connections/src/test/java/com/stripe/android/financialconnections/ApiKeyFixtures.kt +++ b/financial-connections/src/test/java/com/stripe/android/financialconnections/ApiKeyFixtures.kt @@ -4,7 +4,7 @@ import com.stripe.android.financialconnections.model.FinancialConnectionsSession internal object ApiKeyFixtures { const val DEFAULT_PUBLISHABLE_KEY = "pk_test_vOo1umqsYxSrP5UXfOeL3ecm" - const val DEFAULT_LINK_ACCOUNT_SESSION_SECRET = "las_client_secret_asdf1234" + const val DEFAULT_FINANCIAL_CONNECTIONS_SESSION_SECRET = "las_client_secret_asdf1234" const val HOSTED_AUTH_URL = "https://stripe.com/auth/flow/start" const val SUCCESS_URL = "stripe-auth://link-accounts/success" diff --git a/financial-connections/src/test/java/com/stripe/android/financialconnections/FinancialConnectionsSheetTest.kt b/financial-connections/src/test/java/com/stripe/android/financialconnections/FinancialConnectionsSheetTest.kt index 66954da1888..96f6e0090bb 100644 --- a/financial-connections/src/test/java/com/stripe/android/financialconnections/FinancialConnectionsSheetTest.kt +++ b/financial-connections/src/test/java/com/stripe/android/financialconnections/FinancialConnectionsSheetTest.kt @@ -8,7 +8,7 @@ import org.mockito.kotlin.verify class FinancialConnectionsSheetTest { private val financialConnectionsSheetLauncher = mock() private val configuration = FinancialConnectionsSheet.Configuration( - ApiKeyFixtures.DEFAULT_LINK_ACCOUNT_SESSION_SECRET, + ApiKeyFixtures.DEFAULT_FINANCIAL_CONNECTIONS_SESSION_SECRET, ApiKeyFixtures.DEFAULT_PUBLISHABLE_KEY ) private val financialConnectionsSheet = diff --git a/financial-connections/src/test/java/com/stripe/android/financialconnections/FinancialFinancialConnectionsSheetActivityTest.kt b/financial-connections/src/test/java/com/stripe/android/financialconnections/FinancialFinancialConnectionsSheetActivityTest.kt index 447b0df5eed..f342299bca0 100644 --- a/financial-connections/src/test/java/com/stripe/android/financialconnections/FinancialFinancialConnectionsSheetActivityTest.kt +++ b/financial-connections/src/test/java/com/stripe/android/financialconnections/FinancialFinancialConnectionsSheetActivityTest.kt @@ -33,7 +33,7 @@ class FinancialFinancialConnectionsSheetActivityTest { private val context = ApplicationProvider.getApplicationContext() private val contract = FinancialConnectionsSheetContract() private val configuration = FinancialConnectionsSheet.Configuration( - ApiKeyFixtures.DEFAULT_LINK_ACCOUNT_SESSION_SECRET, + ApiKeyFixtures.DEFAULT_FINANCIAL_CONNECTIONS_SESSION_SECRET, ApiKeyFixtures.DEFAULT_PUBLISHABLE_KEY ) private val args = FinancialConnectionsSheetContract.Args.Default(configuration) @@ -45,9 +45,9 @@ class FinancialFinancialConnectionsSheetActivityTest { applicationId = "com.example.test", starterArgs = args, savedStateHandle = SavedStateHandle(), - generateLinkAccountSessionManifest = mock(), - fetchLinkAccountSession = mock(), - fetchLinkAccountSessionForToken = mock(), + generateFinancialConnectionsSessionManifest = mock(), + fetchFinancialConnectionsSession = mock(), + fetchFinancialConnectionsSessionForToken = mock(), eventReporter = mock() ) } diff --git a/financial-connections/src/test/java/com/stripe/android/financialconnections/FinancialFinancialConnectionsSheetContractTest.kt b/financial-connections/src/test/java/com/stripe/android/financialconnections/FinancialFinancialConnectionsSheetContractTest.kt index a3fa1972263..4a4c33dceaa 100644 --- a/financial-connections/src/test/java/com/stripe/android/financialconnections/FinancialFinancialConnectionsSheetContractTest.kt +++ b/financial-connections/src/test/java/com/stripe/android/financialconnections/FinancialFinancialConnectionsSheetContractTest.kt @@ -20,7 +20,7 @@ class FinancialFinancialConnectionsSheetContractTest { @Test fun `validate() valid args`() { val configuration = FinancialConnectionsSheet.Configuration( - ApiKeyFixtures.DEFAULT_LINK_ACCOUNT_SESSION_SECRET, + ApiKeyFixtures.DEFAULT_FINANCIAL_CONNECTIONS_SESSION_SECRET, ApiKeyFixtures.DEFAULT_PUBLISHABLE_KEY ) val args = FinancialConnectionsSheetContract.Args.Default(configuration) @@ -28,14 +28,14 @@ class FinancialFinancialConnectionsSheetContractTest { } @Test - fun `validate() missing link account session client secret`() { + fun `validate() missing session client secret`() { val configuration = FinancialConnectionsSheet.Configuration( " ", ApiKeyFixtures.DEFAULT_PUBLISHABLE_KEY ) val args = FinancialConnectionsSheetContract.Args.Default(configuration) assertFailsWith( - "The link account session client secret cannot be an empty string." + "The financial connections session client secret cannot be an empty string." ) { args.validate() } @@ -44,7 +44,7 @@ class FinancialFinancialConnectionsSheetContractTest { @Test fun `validate() missing publishable key`() { val configuration = FinancialConnectionsSheet.Configuration( - ApiKeyFixtures.DEFAULT_LINK_ACCOUNT_SESSION_SECRET, + ApiKeyFixtures.DEFAULT_FINANCIAL_CONNECTIONS_SESSION_SECRET, " " ) val args = FinancialConnectionsSheetContract.Args.Default(configuration) diff --git a/financial-connections/src/test/java/com/stripe/android/financialconnections/FinancialFinancialConnectionsSheetViewModelTest.kt b/financial-connections/src/test/java/com/stripe/android/financialconnections/FinancialFinancialConnectionsSheetViewModelTest.kt index 113ccb8e08f..a38cdcea79c 100644 --- a/financial-connections/src/test/java/com/stripe/android/financialconnections/FinancialFinancialConnectionsSheetViewModelTest.kt +++ b/financial-connections/src/test/java/com/stripe/android/financialconnections/FinancialFinancialConnectionsSheetViewModelTest.kt @@ -6,16 +6,16 @@ import androidx.lifecycle.SavedStateHandle import androidx.test.ext.junit.runners.AndroidJUnit4 import app.cash.turbine.test import com.google.common.truth.Truth.assertThat -import com.stripe.android.connections.domain.FetchLinkAccountSessionForToken import com.stripe.android.core.exception.APIException import com.stripe.android.financialconnections.FinancialConnectionsSheetViewEffect.FinishWithResult import com.stripe.android.financialconnections.analytics.FinancialConnectionsEventReporter -import com.stripe.android.financialconnections.domain.FetchLinkAccountSession -import com.stripe.android.financialconnections.domain.GenerateLinkAccountSessionManifest +import com.stripe.android.financialconnections.domain.FetchFinancialConnectionsSession +import com.stripe.android.financialconnections.domain.FetchFinancialConnectionsSessionForToken +import com.stripe.android.financialconnections.domain.GenerateFinancialConnectionsSessionManifest +import com.stripe.android.financialconnections.model.FinancialConnectionsAccountFixtures +import com.stripe.android.financialconnections.model.FinancialConnectionsAccountList import com.stripe.android.financialconnections.model.FinancialConnectionsSession import com.stripe.android.financialconnections.model.FinancialConnectionsSessionManifest -import com.stripe.android.financialconnections.model.LinkedAccountFixtures -import com.stripe.android.financialconnections.model.LinkedAccountList import kotlinx.coroutines.ExperimentalCoroutinesApi import kotlinx.coroutines.test.runTest import org.junit.Test @@ -33,7 +33,7 @@ class FinancialFinancialConnectionsSheetViewModelTest { private val eventReporter = mock() private val configuration = FinancialConnectionsSheet.Configuration( - ApiKeyFixtures.DEFAULT_LINK_ACCOUNT_SESSION_SECRET, + ApiKeyFixtures.DEFAULT_FINANCIAL_CONNECTIONS_SESSION_SECRET, ApiKeyFixtures.DEFAULT_PUBLISHABLE_KEY ) private val manifest = FinancialConnectionsSessionManifest( @@ -41,9 +41,9 @@ class FinancialFinancialConnectionsSheetViewModelTest { ApiKeyFixtures.SUCCESS_URL, ApiKeyFixtures.CANCEL_URL ) - private val fetchLinkAccountSession = mock() - private val fetchLinkAccountSessionForToken = mock() - private val generateLinkAccountSessionManifest = mock() + private val fetchFinancialConnectionsSession = mock() + private val fetchFinancialConnectionsSessionForToken = mock() + private val generateFinancialConnectionsSessionManifest = mock() @Test fun `init - eventReporter fires onPresented`() { @@ -60,7 +60,7 @@ class FinancialFinancialConnectionsSheetViewModelTest { savedStateHandle = SavedStateHandle() ) - verify(generateLinkAccountSessionManifest).invoke(any(), any()) + verify(generateFinancialConnectionsSessionManifest).invoke(any(), any()) } @Test @@ -71,7 +71,7 @@ class FinancialFinancialConnectionsSheetViewModelTest { savedStateHandle = SavedStateHandle().also { it.set("key_manifest", manifest) } ) - verifyNoInteractions(generateLinkAccountSessionManifest) + verifyNoInteractions(generateFinancialConnectionsSessionManifest) } } @@ -94,7 +94,7 @@ class FinancialFinancialConnectionsSheetViewModelTest { fun `handleOnNewIntent - intent with cancel url should fire analytics event and set cancel result`() { runTest { // Given - whenever(generateLinkAccountSessionManifest(any(), any())).thenReturn(manifest) + whenever(generateFinancialConnectionsSessionManifest(any(), any())).thenReturn(manifest) val viewModel = createViewModel(configuration) val cancelIntent = cancelIntent() @@ -112,7 +112,7 @@ class FinancialFinancialConnectionsSheetViewModelTest { fun `handleOnNewIntent - when intent with cancel URL received, then finish with Result#Cancel`() = runTest { // Given - whenever(generateLinkAccountSessionManifest(any(), any())).thenReturn(manifest) + whenever(generateFinancialConnectionsSessionManifest(any(), any())).thenReturn(manifest) val viewModel = createViewModel(configuration) viewModel.viewEffect.test { // When @@ -150,9 +150,9 @@ class FinancialFinancialConnectionsSheetViewModelTest { fun `handleOnNewIntent - when intent with success, then finish with Result#Success`() = runTest { // Given - val expectedLinkAccountSession = linkAccountSession() - whenever(generateLinkAccountSessionManifest(any(), any())).thenReturn(manifest) - whenever(fetchLinkAccountSession(any())).thenReturn(expectedLinkAccountSession) + val expectedSession = financialConnectionsSession() + whenever(generateFinancialConnectionsSessionManifest(any(), any())).thenReturn(manifest) + whenever(fetchFinancialConnectionsSession(any())).thenReturn(expectedSession) val viewModel = createViewModel(configuration) viewModel.viewEffect.test { @@ -166,7 +166,7 @@ class FinancialFinancialConnectionsSheetViewModelTest { assertThat(awaitItem()).isEqualTo( FinishWithResult( result = FinancialConnectionsSheetContract.Result.Completed( - expectedLinkAccountSession + expectedSession ) ) ) @@ -178,8 +178,8 @@ class FinancialFinancialConnectionsSheetViewModelTest { runTest { // Given val apiException = APIException() - whenever(generateLinkAccountSessionManifest(any(), any())).thenReturn(manifest) - whenever(fetchLinkAccountSession.invoke(any())).thenAnswer { throw apiException } + whenever(generateFinancialConnectionsSessionManifest(any(), any())).thenReturn(manifest) + whenever(fetchFinancialConnectionsSession.invoke(any())).thenAnswer { throw apiException } val viewModel = createViewModel(configuration) viewModel.viewEffect.test { // When @@ -198,8 +198,8 @@ class FinancialFinancialConnectionsSheetViewModelTest { fun `handleOnNewIntent - when error fetching account session, then finish with Result#Failed`() = runTest { // Given - whenever(generateLinkAccountSessionManifest(any(), any())).thenReturn(manifest) - whenever(fetchLinkAccountSession(any())).thenAnswer { throw APIException() } + whenever(generateFinancialConnectionsSessionManifest(any(), any())).thenReturn(manifest) + whenever(fetchFinancialConnectionsSession(any())).thenAnswer { throw APIException() } val viewModel = createViewModel(configuration) viewModel.viewEffect.test { // When @@ -254,7 +254,7 @@ class FinancialFinancialConnectionsSheetViewModelTest { fun `init - when repository returns manifest, manifest fetched and stored in state`() { runTest { // Given - whenever(generateLinkAccountSessionManifest(any(), any())).thenReturn(manifest) + whenever(generateFinancialConnectionsSessionManifest(any(), any())).thenReturn(manifest) // When val viewModel = createViewModel(configuration) @@ -272,18 +272,18 @@ class FinancialFinancialConnectionsSheetViewModelTest { it.data = Uri.parse(ApiKeyFixtures.CANCEL_URL) } - private fun linkAccountSession() = FinancialConnectionsSession( + private fun financialConnectionsSession() = FinancialConnectionsSession( id = "las_no_more", - clientSecret = configuration.linkAccountSessionClientSecret, + clientSecret = configuration.financialConnectionsSessionClientSecret, livemode = true, - linkedAccounts = LinkedAccountList( + accounts = FinancialConnectionsAccountList( hasMore = false, count = 2, url = "url", totalCount = 2, - linkedAccounts = listOf( - LinkedAccountFixtures.CREDIT_CARD, - LinkedAccountFixtures.CHECKING_ACCOUNT + financialConnectionsAccounts = listOf( + FinancialConnectionsAccountFixtures.CREDIT_CARD, + FinancialConnectionsAccountFixtures.CHECKING_ACCOUNT ), ) ) @@ -297,9 +297,9 @@ class FinancialFinancialConnectionsSheetViewModelTest { applicationId = "com.example.app", starterArgs = args, savedStateHandle = savedStateHandle, - generateLinkAccountSessionManifest = generateLinkAccountSessionManifest, - fetchLinkAccountSession = fetchLinkAccountSession, - fetchLinkAccountSessionForToken = fetchLinkAccountSessionForToken, + generateFinancialConnectionsSessionManifest = generateFinancialConnectionsSessionManifest, + fetchFinancialConnectionsSession = fetchFinancialConnectionsSession, + fetchFinancialConnectionsSessionForToken = fetchFinancialConnectionsSessionForToken, eventReporter = eventReporter ) } diff --git a/financial-connections/src/test/java/com/stripe/android/financialconnections/analytics/DefaultConnectionsEventReportTest.kt b/financial-connections/src/test/java/com/stripe/android/financialconnections/analytics/DefaultConnectionsEventReportTest.kt index 4a5a22f2e74..f44e5793c03 100644 --- a/financial-connections/src/test/java/com/stripe/android/financialconnections/analytics/DefaultConnectionsEventReportTest.kt +++ b/financial-connections/src/test/java/com/stripe/android/financialconnections/analytics/DefaultConnectionsEventReportTest.kt @@ -7,8 +7,8 @@ import com.stripe.android.core.networking.AnalyticsRequestFactory import com.stripe.android.financialconnections.ApiKeyFixtures import com.stripe.android.financialconnections.FinancialConnectionsSheet import com.stripe.android.financialconnections.FinancialConnectionsSheetContract +import com.stripe.android.financialconnections.model.FinancialConnectionsAccountList import com.stripe.android.financialconnections.model.FinancialConnectionsSession -import com.stripe.android.financialconnections.model.LinkedAccountList import kotlinx.coroutines.ExperimentalCoroutinesApi import kotlinx.coroutines.test.UnconfinedTestDispatcher import org.junit.Test @@ -39,15 +39,15 @@ class DefaultConnectionsEventReportTest { ) private val configuration = FinancialConnectionsSheet.Configuration( - ApiKeyFixtures.DEFAULT_LINK_ACCOUNT_SESSION_SECRET, + ApiKeyFixtures.DEFAULT_FINANCIAL_CONNECTIONS_SESSION_SECRET, ApiKeyFixtures.DEFAULT_PUBLISHABLE_KEY ) private val financialConnectionsSession = FinancialConnectionsSession( "las_1234567890", - ApiKeyFixtures.DEFAULT_LINK_ACCOUNT_SESSION_SECRET, - LinkedAccountList( - linkedAccounts = emptyList(), + ApiKeyFixtures.DEFAULT_FINANCIAL_CONNECTIONS_SESSION_SECRET, + FinancialConnectionsAccountList( + financialConnectionsAccounts = emptyList(), hasMore = false, url = "url", count = 0 @@ -61,7 +61,7 @@ class DefaultConnectionsEventReportTest { verify(analyticsRequestExecutor).executeAsync( argWhere { req -> req.params["event"] == "stripe_android.connections.sheet.presented" && - req.params["las_client_secret"] == ApiKeyFixtures.DEFAULT_LINK_ACCOUNT_SESSION_SECRET + req.params["las_client_secret"] == ApiKeyFixtures.DEFAULT_FINANCIAL_CONNECTIONS_SESSION_SECRET } ) } @@ -76,7 +76,7 @@ class DefaultConnectionsEventReportTest { argWhere { req -> req.params["event"] == "stripe_android.connections.sheet.closed" && req.params["session_result"] == "completed" && - req.params["las_client_secret"] == ApiKeyFixtures.DEFAULT_LINK_ACCOUNT_SESSION_SECRET + req.params["las_client_secret"] == ApiKeyFixtures.DEFAULT_FINANCIAL_CONNECTIONS_SESSION_SECRET } ) } @@ -88,7 +88,7 @@ class DefaultConnectionsEventReportTest { argWhere { req -> req.params["event"] == "stripe_android.connections.sheet.closed" && req.params["session_result"] == "cancelled" && - req.params["las_client_secret"] == ApiKeyFixtures.DEFAULT_LINK_ACCOUNT_SESSION_SECRET + req.params["las_client_secret"] == ApiKeyFixtures.DEFAULT_FINANCIAL_CONNECTIONS_SESSION_SECRET } ) } @@ -100,7 +100,7 @@ class DefaultConnectionsEventReportTest { argWhere { req -> req.params["event"] == "stripe_android.connections.sheet.failed" && req.params["session_result"] == "failure" && - req.params["las_client_secret"] == ApiKeyFixtures.DEFAULT_LINK_ACCOUNT_SESSION_SECRET + req.params["las_client_secret"] == ApiKeyFixtures.DEFAULT_FINANCIAL_CONNECTIONS_SESSION_SECRET } ) } diff --git a/financial-connections/src/test/java/com/stripe/android/financialconnections/domain/FetchFinancialConnectionsSessionForTokenTest.kt b/financial-connections/src/test/java/com/stripe/android/financialconnections/domain/FetchFinancialConnectionsSessionForTokenTest.kt index c43504a29fc..d16d0940f29 100644 --- a/financial-connections/src/test/java/com/stripe/android/financialconnections/domain/FetchFinancialConnectionsSessionForTokenTest.kt +++ b/financial-connections/src/test/java/com/stripe/android/financialconnections/domain/FetchFinancialConnectionsSessionForTokenTest.kt @@ -3,6 +3,7 @@ package com.stripe.android.connections.domain import com.google.common.truth.Truth.assertThat import com.stripe.android.connections.test.readResourceAsString import com.stripe.android.financialconnections.ApiKeyFixtures +import com.stripe.android.financialconnections.domain.FetchFinancialConnectionsSessionForToken import com.stripe.android.financialconnections.model.FinancialConnectionsSession import com.stripe.android.financialconnections.networking.FakeFinancialConnectionsRepository import kotlinx.coroutines.ExperimentalCoroutinesApi @@ -15,7 +16,7 @@ import kotlin.test.assertFailsWith class FetchFinancialConnectionsSessionForTokenTest { private val repository = FakeFinancialConnectionsRepository(ApiKeyFixtures.MANIFEST) - private val getLinkAccountSession = FetchLinkAccountSessionForToken(repository) + private val fetchFinancialConnectionsSessionForToken = FetchFinancialConnectionsSessionForToken(repository) private val json = Json { ignoreUnknownKeys = true } @@ -33,7 +34,7 @@ class FetchFinancialConnectionsSessionForTokenTest { } // When - val (_, token) = getLinkAccountSession(clientSecret) + val (_, token) = fetchFinancialConnectionsSessionForToken(clientSecret) // Then assertThat(token.id).isEqualTo("tok_1F4ACMCRMbs6FrXf6fPqLnN7") @@ -53,7 +54,7 @@ class FetchFinancialConnectionsSessionForTokenTest { // Then assertFailsWith { - getLinkAccountSession(clientSecret) + fetchFinancialConnectionsSessionForToken(clientSecret) } } } diff --git a/financial-connections/src/test/java/com/stripe/android/financialconnections/domain/FetchFinancialConnectionsSessionTest.kt b/financial-connections/src/test/java/com/stripe/android/financialconnections/domain/FetchFinancialConnectionsSessionTest.kt index a5c68c65600..8bf42201f97 100644 --- a/financial-connections/src/test/java/com/stripe/android/financialconnections/domain/FetchFinancialConnectionsSessionTest.kt +++ b/financial-connections/src/test/java/com/stripe/android/financialconnections/domain/FetchFinancialConnectionsSessionTest.kt @@ -6,9 +6,9 @@ import com.stripe.android.core.exception.APIException import com.stripe.android.financialconnections.ApiKeyFixtures import com.stripe.android.financialconnections.financialConnectionsSessionWithMoreAccounts import com.stripe.android.financialconnections.financialConnectionsSessionWithNoMoreAccounts +import com.stripe.android.financialconnections.model.FinancialConnectionsAccountList import com.stripe.android.financialconnections.model.FinancialConnectionsSession -import com.stripe.android.financialconnections.model.LinkedAccountList -import com.stripe.android.financialconnections.moreLinkedAccountList +import com.stripe.android.financialconnections.moreFinancialConnectionsAccountList import com.stripe.android.financialconnections.networking.FakeFinancialConnectionsRepository import kotlinx.coroutines.ExperimentalCoroutinesApi import kotlinx.coroutines.test.runTest @@ -21,7 +21,7 @@ import kotlin.test.assertFailsWith class FetchFinancialConnectionsSessionTest { private val repository = FakeFinancialConnectionsRepository(ApiKeyFixtures.MANIFEST) - private val getLinkAccountSession = FetchLinkAccountSession(repository) + private val getFinancialConnectionsSession = FetchFinancialConnectionsSession(repository) @Test fun `invoke - when session with no more accounts, should return unmodified session`() = @@ -32,39 +32,39 @@ class FetchFinancialConnectionsSessionTest { { financialConnectionsSessionWithNoMoreAccounts } // When - val result: FinancialConnectionsSession = getLinkAccountSession(clientSecret) + val result: FinancialConnectionsSession = getFinancialConnectionsSession(clientSecret) // Then assertThat(result).isEqualTo(financialConnectionsSessionWithNoMoreAccounts) } @Test - fun `invoke - when session with more accounts, should return combined linked account list`() = + fun `invoke - when session with more accounts, should return combined account list`() = runTest { // Given val clientSecret = "clientSecret" repository.getFinancialConnectionsSessionResultProvider = { financialConnectionsSessionWithMoreAccounts } - repository.getLinkedAccountsResultProvider = { moreLinkedAccountList } + repository.getAccountsResultProvider = { moreFinancialConnectionsAccountList } // When - val result: FinancialConnectionsSession = getLinkAccountSession(clientSecret) + val result: FinancialConnectionsSession = getFinancialConnectionsSession(clientSecret) // Then val combinedAccounts = listOf( // Original account list with hasMore == true - financialConnectionsSessionWithMoreAccounts.linkedAccounts.linkedAccounts, - // Next and last linked accounts page. - moreLinkedAccountList.linkedAccounts + financialConnectionsSessionWithMoreAccounts.accounts.financialConnectionsAccounts, + // Next and last connected accounts page. + moreFinancialConnectionsAccountList.financialConnectionsAccounts ).flatten() assertThat(result).isEqualTo( financialConnectionsSessionWithMoreAccounts.copy( - linkedAccounts = LinkedAccountList( - linkedAccounts = combinedAccounts, + accounts = FinancialConnectionsAccountList( + financialConnectionsAccounts = combinedAccounts, hasMore = false, count = combinedAccounts.size, totalCount = combinedAccounts.size, - url = moreLinkedAccountList.url + url = moreFinancialConnectionsAccountList.url ) ) ) @@ -77,23 +77,23 @@ class FetchFinancialConnectionsSessionTest { val clientSecret = "clientSecret" repository.getFinancialConnectionsSessionResultProvider = { financialConnectionsSessionWithMoreAccounts } - repository.getLinkedAccountsResultProvider = { throw APIException() } + repository.getAccountsResultProvider = { throw APIException() } // When - val result: FinancialConnectionsSession = getLinkAccountSession(clientSecret) + val result: FinancialConnectionsSession = getFinancialConnectionsSession(clientSecret) // Then val combinedAccounts = listOf( // Original account list with hasMore == true - financialConnectionsSessionWithMoreAccounts.linkedAccounts.linkedAccounts, - // Next and last linked accounts page. - moreLinkedAccountList.linkedAccounts + financialConnectionsSessionWithMoreAccounts.accounts.financialConnectionsAccounts, + // Next and last connected accounts page. + moreFinancialConnectionsAccountList.financialConnectionsAccounts ).flatten() assertThat(result).isEqualTo( financialConnectionsSessionWithMoreAccounts.copy( - linkedAccounts = LinkedAccountList( - linkedAccounts = combinedAccounts, + accounts = FinancialConnectionsAccountList( + financialConnectionsAccounts = combinedAccounts, hasMore = false, totalCount = combinedAccounts.size, url = "url" diff --git a/financial-connections/src/test/java/com/stripe/android/financialconnections/model/FinancialConnectionsAccountFixtures.kt b/financial-connections/src/test/java/com/stripe/android/financialconnections/model/FinancialConnectionsAccountFixtures.kt new file mode 100644 index 00000000000..a8b6a48353b --- /dev/null +++ b/financial-connections/src/test/java/com/stripe/android/financialconnections/model/FinancialConnectionsAccountFixtures.kt @@ -0,0 +1,51 @@ +package com.stripe.android.financialconnections.model + +internal object FinancialConnectionsAccountFixtures { + + val CREDIT_CARD = FinancialConnectionsAccount( + id = "la_1KMEuEClCIKljWvsfeLEm28K", + displayName = "My Credit Card", + institutionName = "My Bank", + last4 = "3456", + category = FinancialConnectionsAccount.Category.CREDIT, + created = 1643216618, + livemode = true, + permissions = listOf(FinancialConnectionsAccount.Permissions.PAYMENT_METHOD), + status = FinancialConnectionsAccount.Status.ACTIVE, + subcategory = FinancialConnectionsAccount.Subcategory.CREDIT_CARD, + supportedPaymentMethodTypes = emptyList() + ) + + val CHECKING_ACCOUNT = FinancialConnectionsAccount( + id = "la_1KMGIuClCIKljWvsLzbigpVh", + displayName = "My Checking", + institutionName = "My Bank", + last4 = "3456", + category = FinancialConnectionsAccount.Category.CASH, + created = 1643221992, + livemode = true, + permissions = listOf(FinancialConnectionsAccount.Permissions.PAYMENT_METHOD), + status = FinancialConnectionsAccount.Status.ACTIVE, + subcategory = FinancialConnectionsAccount.Subcategory.CHECKING, + supportedPaymentMethodTypes = listOf( + FinancialConnectionsAccount.SupportedPaymentMethodTypes.US_BANK_ACCOUNT, + FinancialConnectionsAccount.SupportedPaymentMethodTypes.LINK + ), + ) + + val SAVINGS_ACCOUNT = FinancialConnectionsAccount( + id = "la_1KMGIuClCIKljWvsN3k8bH3B", + displayName = "My Savings", + institutionName = "My Bank", + last4 = "6789", + category = FinancialConnectionsAccount.Category.CASH, + created = 1643221992, + livemode = true, + permissions = listOf(FinancialConnectionsAccount.Permissions.PAYMENT_METHOD), + status = FinancialConnectionsAccount.Status.ACTIVE, + subcategory = FinancialConnectionsAccount.Subcategory.SAVINGS, + supportedPaymentMethodTypes = listOf( + FinancialConnectionsAccount.SupportedPaymentMethodTypes.US_BANK_ACCOUNT, + ), + ) +} diff --git a/financial-connections/src/test/java/com/stripe/android/financialconnections/model/LinkedAccountFixtures.kt b/financial-connections/src/test/java/com/stripe/android/financialconnections/model/LinkedAccountFixtures.kt deleted file mode 100644 index f1282e0feeb..00000000000 --- a/financial-connections/src/test/java/com/stripe/android/financialconnections/model/LinkedAccountFixtures.kt +++ /dev/null @@ -1,51 +0,0 @@ -package com.stripe.android.financialconnections.model - -internal object LinkedAccountFixtures { - - val CREDIT_CARD = LinkedAccount( - id = "la_1KMEuEClCIKljWvsfeLEm28K", - displayName = "My Credit Card", - institutionName = "My Bank", - last4 = "3456", - category = LinkedAccount.Category.CREDIT, - created = 1643216618, - livemode = true, - permissions = listOf(LinkedAccount.Permissions.PAYMENT_METHOD), - status = LinkedAccount.Status.ACTIVE, - subcategory = LinkedAccount.Subcategory.CREDIT_CARD, - supportedPaymentMethodTypes = emptyList() - ) - - val CHECKING_ACCOUNT = LinkedAccount( - id = "la_1KMGIuClCIKljWvsLzbigpVh", - displayName = "My Checking", - institutionName = "My Bank", - last4 = "3456", - category = LinkedAccount.Category.CASH, - created = 1643221992, - livemode = true, - permissions = listOf(LinkedAccount.Permissions.PAYMENT_METHOD), - status = LinkedAccount.Status.ACTIVE, - subcategory = LinkedAccount.Subcategory.CHECKING, - supportedPaymentMethodTypes = listOf( - LinkedAccount.SupportedPaymentMethodTypes.US_BANK_ACCOUNT, - LinkedAccount.SupportedPaymentMethodTypes.LINK - ), - ) - - val SAVINGS_ACCOUNT = LinkedAccount( - id = "la_1KMGIuClCIKljWvsN3k8bH3B", - displayName = "My Savings", - institutionName = "My Bank", - last4 = "6789", - category = LinkedAccount.Category.CASH, - created = 1643221992, - livemode = true, - permissions = listOf(LinkedAccount.Permissions.PAYMENT_METHOD), - status = LinkedAccount.Status.ACTIVE, - subcategory = LinkedAccount.Subcategory.SAVINGS, - supportedPaymentMethodTypes = listOf( - LinkedAccount.SupportedPaymentMethodTypes.US_BANK_ACCOUNT, - ), - ) -} diff --git a/financial-connections/src/test/java/com/stripe/android/financialconnections/networking/FakeFinancialConnectionsRepository.kt b/financial-connections/src/test/java/com/stripe/android/financialconnections/networking/FakeFinancialConnectionsRepository.kt index 12915d5a2f6..95d3484c3ec 100644 --- a/financial-connections/src/test/java/com/stripe/android/financialconnections/networking/FakeFinancialConnectionsRepository.kt +++ b/financial-connections/src/test/java/com/stripe/android/financialconnections/networking/FakeFinancialConnectionsRepository.kt @@ -1,11 +1,11 @@ package com.stripe.android.financialconnections.networking import com.stripe.android.financialconnections.financialConnectionsSessionWithNoMoreAccounts +import com.stripe.android.financialconnections.model.FinancialConnectionsAccountList import com.stripe.android.financialconnections.model.FinancialConnectionsSession import com.stripe.android.financialconnections.model.FinancialConnectionsSessionManifest -import com.stripe.android.financialconnections.model.LinkedAccountList -import com.stripe.android.financialconnections.model.ListLinkedAccountParams -import com.stripe.android.financialconnections.moreLinkedAccountList +import com.stripe.android.financialconnections.model.GetFinancialConnectionsAcccountsParams +import com.stripe.android.financialconnections.moreFinancialConnectionsAccountList import com.stripe.android.financialconnections.repository.FinancialConnectionsRepository internal class FakeFinancialConnectionsRepository( @@ -14,17 +14,17 @@ internal class FakeFinancialConnectionsRepository( var getFinancialConnectionsSessionResultProvider: () -> FinancialConnectionsSession = { financialConnectionsSessionWithNoMoreAccounts } - var getLinkedAccountsResultProvider: () -> LinkedAccountList = { moreLinkedAccountList } + var getAccountsResultProvider: () -> FinancialConnectionsAccountList = { moreFinancialConnectionsAccountList } - override suspend fun getLinkedAccounts( - listLinkedAccountParams: ListLinkedAccountParams - ): LinkedAccountList = getLinkedAccountsResultProvider() + override suspend fun getFinancialConnectionsAccounts( + getFinancialConnectionsAcccountsParams: GetFinancialConnectionsAcccountsParams + ): FinancialConnectionsAccountList = getAccountsResultProvider() - override suspend fun getLinkAccountSession( + override suspend fun getFinancialConnectionsSession( clientSecret: String ): FinancialConnectionsSession = getFinancialConnectionsSessionResultProvider() - override suspend fun generateLinkAccountSessionManifest( + override suspend fun generateFinancialConnectionsSessionManifest( clientSecret: String, applicationId: String ): FinancialConnectionsSessionManifest = manifest diff --git a/financial-connections/src/test/java/com/stripe/android/financialconnections/repository/FinancialConnectionsApiRepositoryTest.kt b/financial-connections/src/test/java/com/stripe/android/financialconnections/repository/FinancialConnectionsApiRepositoryTest.kt index 2b8c102ba37..59179f05019 100644 --- a/financial-connections/src/test/java/com/stripe/android/financialconnections/repository/FinancialConnectionsApiRepositoryTest.kt +++ b/financial-connections/src/test/java/com/stripe/android/financialconnections/repository/FinancialConnectionsApiRepositoryTest.kt @@ -7,7 +7,7 @@ import com.stripe.android.core.networking.StripeNetworkClient import com.stripe.android.core.networking.StripeResponse import com.stripe.android.financialconnections.ApiKeyFixtures import com.stripe.android.financialconnections.model.BankAccount -import com.stripe.android.financialconnections.model.LinkedAccount +import com.stripe.android.financialconnections.model.FinancialConnectionsAccount import kotlinx.coroutines.ExperimentalCoroutinesApi import kotlinx.coroutines.test.runTest import org.junit.Test @@ -22,14 +22,14 @@ class FinancialConnectionsApiRepositoryTest { private val mockStripeNetworkClient = mock() private val apiRequestFactory = mock() - private val financialConnectionsApiRepository = FinancialFinancialConnectionsApiRepository( + private val financialConnectionsApiRepository = FinancialConnectionsApiRepository( publishableKey = ApiKeyFixtures.DEFAULT_PUBLISHABLE_KEY, stripeNetworkClient = mockStripeNetworkClient, apiRequestFactory = apiRequestFactory ) @Test - fun `getLinkAccountSession - when paymentAccount is LinkedAccount, deserializes correct type`() = + fun `getFinancialConnectionsSession - paymentAccount is FinancialConnectionsAccount`() = runTest { givenGetRequestReturns( readResourceAsString( @@ -37,13 +37,13 @@ class FinancialConnectionsApiRepositoryTest { ) ) - val result = financialConnectionsApiRepository.getLinkAccountSession("client_secret") + val result = financialConnectionsApiRepository.getFinancialConnectionsSession("client_secret") - assertThat(result.paymentAccount).isInstanceOf(LinkedAccount::class.java) + assertThat(result.paymentAccount).isInstanceOf(FinancialConnectionsAccount::class.java) } @Test - fun `getLinkAccountSession - when paymentAccount is BankAccount, deserializes correct type`() = + fun `getFinancialConnectionsSession - paymentAccount is BankAccount`() = runTest { givenGetRequestReturns( readResourceAsString( @@ -51,7 +51,7 @@ class FinancialConnectionsApiRepositoryTest { ) ) - val result = financialConnectionsApiRepository.getLinkAccountSession("client_secret") + val result = financialConnectionsApiRepository.getFinancialConnectionsSession("client_secret") assertThat(result.paymentAccount).isInstanceOf(BankAccount::class.java) } diff --git a/financial-connections/src/test/java/com/stripe/android/financialconnections/testmodels.kt b/financial-connections/src/test/java/com/stripe/android/financialconnections/testmodels.kt index a56b40c46ff..2a3a36a7aa2 100644 --- a/financial-connections/src/test/java/com/stripe/android/financialconnections/testmodels.kt +++ b/financial-connections/src/test/java/com/stripe/android/financialconnections/testmodels.kt @@ -1,19 +1,19 @@ package com.stripe.android.financialconnections +import com.stripe.android.financialconnections.model.FinancialConnectionsAccountFixtures +import com.stripe.android.financialconnections.model.FinancialConnectionsAccountList import com.stripe.android.financialconnections.model.FinancialConnectionsSession -import com.stripe.android.financialconnections.model.LinkedAccountFixtures -import com.stripe.android.financialconnections.model.LinkedAccountList import com.stripe.android.model.BankAccount import com.stripe.android.model.Token import java.util.Date val financialConnectionsSessionWithNoMoreAccounts = FinancialConnectionsSession( id = "las_no_more", - clientSecret = ApiKeyFixtures.DEFAULT_LINK_ACCOUNT_SESSION_SECRET, - linkedAccounts = LinkedAccountList( + clientSecret = ApiKeyFixtures.DEFAULT_FINANCIAL_CONNECTIONS_SESSION_SECRET, + accounts = FinancialConnectionsAccountList( listOf( - LinkedAccountFixtures.CREDIT_CARD, - LinkedAccountFixtures.CHECKING_ACCOUNT + FinancialConnectionsAccountFixtures.CREDIT_CARD, + FinancialConnectionsAccountFixtures.CHECKING_ACCOUNT ), false, "url", @@ -24,11 +24,11 @@ val financialConnectionsSessionWithNoMoreAccounts = FinancialConnectionsSession( val financialConnectionsSessionWithMoreAccounts = FinancialConnectionsSession( id = "las_has_more", - clientSecret = ApiKeyFixtures.DEFAULT_LINK_ACCOUNT_SESSION_SECRET, - linkedAccounts = LinkedAccountList( - linkedAccounts = listOf( - LinkedAccountFixtures.CREDIT_CARD, - LinkedAccountFixtures.CHECKING_ACCOUNT + clientSecret = ApiKeyFixtures.DEFAULT_FINANCIAL_CONNECTIONS_SESSION_SECRET, + accounts = FinancialConnectionsAccountList( + financialConnectionsAccounts = listOf( + FinancialConnectionsAccountFixtures.CREDIT_CARD, + FinancialConnectionsAccountFixtures.CHECKING_ACCOUNT ), hasMore = true, url = "url", @@ -38,8 +38,8 @@ val financialConnectionsSessionWithMoreAccounts = FinancialConnectionsSession( livemode = true ) -val moreLinkedAccountList = LinkedAccountList( - linkedAccounts = listOf(LinkedAccountFixtures.SAVINGS_ACCOUNT), +val moreFinancialConnectionsAccountList = FinancialConnectionsAccountList( + financialConnectionsAccounts = listOf(FinancialConnectionsAccountFixtures.SAVINGS_ACCOUNT), hasMore = false, url = "url", count = 1, From b61eb3eef2f3dd1bc5ad60d848f766a22c7fabcd Mon Sep 17 00:00:00 2001 From: Carlos Munoz Date: Tue, 26 Apr 2022 16:11:44 -0700 Subject: [PATCH 06/12] Updates example. --- .../example/FinancialConnectionsExampleViewModel.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/financial-connections-example/src/main/java/com/stripe/android/financialconnections/example/FinancialConnectionsExampleViewModel.kt b/financial-connections-example/src/main/java/com/stripe/android/financialconnections/example/FinancialConnectionsExampleViewModel.kt index 590474acf82..c93eef90c3c 100644 --- a/financial-connections-example/src/main/java/com/stripe/android/financialconnections/example/FinancialConnectionsExampleViewModel.kt +++ b/financial-connections-example/src/main/java/com/stripe/android/financialconnections/example/FinancialConnectionsExampleViewModel.kt @@ -66,8 +66,8 @@ class FinancialConnectionsExampleViewModel : ViewModel() { fun onFinancialConnectionsSheetResult(result: FinancialConnectionsSheetResult) { val statusText = when (result) { is Completed -> { - val linkedAccountList = result.financialConnectionsSession.accounts - linkedAccountList.financialConnectionsAccounts.joinToString("\n") { + val accountList = result.financialConnectionsSession.accounts + accountList.financialConnectionsAccounts.joinToString("\n") { "${it.institutionName} - ${it.displayName} - ${it.last4} - ${it.category}/${it.subcategory}" } } From 6154f9ec024d89c7b66c90b60a6023fae6aff822 Mon Sep 17 00:00:00 2001 From: Carlos Munoz Date: Tue, 26 Apr 2022 16:22:11 -0700 Subject: [PATCH 07/12] Updates example. --- .../example/FinancialConnectionsExampleActivity.kt | 2 +- .../example/FinancialConnectionsExampleViewModel.kt | 10 +++++----- .../src/main/res/values/strings.xml | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/financial-connections-example/src/main/java/com/stripe/android/financialconnections/example/FinancialConnectionsExampleActivity.kt b/financial-connections-example/src/main/java/com/stripe/android/financialconnections/example/FinancialConnectionsExampleActivity.kt index 9ed96b66c27..edcc3bafb6a 100644 --- a/financial-connections-example/src/main/java/com/stripe/android/financialconnections/example/FinancialConnectionsExampleActivity.kt +++ b/financial-connections-example/src/main/java/com/stripe/android/financialconnections/example/FinancialConnectionsExampleActivity.kt @@ -33,7 +33,7 @@ class FinancialConnectionsExampleActivity : AppCompatActivity() { } private fun ActivityFinancialconnectionsExampleBinding.observeViews() { - launchConnectionsSheet.setOnClickListener { viewModel.startLinkAccountSession() } + launchConnectionsSheet.setOnClickListener { viewModel.startFinancialConnectionsSession() } } private fun ActivityFinancialconnectionsExampleBinding.observeState() { diff --git a/financial-connections-example/src/main/java/com/stripe/android/financialconnections/example/FinancialConnectionsExampleViewModel.kt b/financial-connections-example/src/main/java/com/stripe/android/financialconnections/example/FinancialConnectionsExampleViewModel.kt index c93eef90c3c..d6d838c8867 100644 --- a/financial-connections-example/src/main/java/com/stripe/android/financialconnections/example/FinancialConnectionsExampleViewModel.kt +++ b/financial-connections-example/src/main/java/com/stripe/android/financialconnections/example/FinancialConnectionsExampleViewModel.kt @@ -25,21 +25,21 @@ class FinancialConnectionsExampleViewModel : ViewModel() { private val _viewEffect = MutableSharedFlow() val viewEffect: SharedFlow = _viewEffect - fun startLinkAccountSession() { + fun startFinancialConnectionsSession() { viewModelScope.launch { setState { copy( loading = true, - status = "Fetching link account session from example backend!" + status = "Fetching financial connections session from example backend!" ) } kotlin.runCatching { repository.createLinkAccountSession() } - // Success creating session: open ConnectionsSheet with received secret + // Success creating session: open FinancialConnectionsSheet with received secret .onSuccess { setState { copy( loading = false, - status = "Session created, opening ConnectionsSheet." + status = "Session created, opening FinancialConnectionsSheet." ) } _viewEffect.emit( @@ -56,7 +56,7 @@ class FinancialConnectionsExampleViewModel : ViewModel() { setState { copy( loading = false, - status = "Error starting linked account session: $it" + status = "Error retrieving financial connections session: $it" ) } } diff --git a/financial-connections-example/src/main/res/values/strings.xml b/financial-connections-example/src/main/res/values/strings.xml index 90648bb1dcb..b03f3046a00 100644 --- a/financial-connections-example/src/main/res/values/strings.xml +++ b/financial-connections-example/src/main/res/values/strings.xml @@ -1,4 +1,4 @@ Financial Connections Example - Link Account + Connect an Account From 67aeb83baa690d972f3da617a6d1fa02db571295 Mon Sep 17 00:00:00 2001 From: Carlos Munoz Date: Wed, 27 Apr 2022 09:41:15 -0700 Subject: [PATCH 08/12] Updates payments api. --- payments-core/api/payments-core.api | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/payments-core/api/payments-core.api b/payments-core/api/payments-core.api index 4464323aa9f..950bdafd85a 100644 --- a/payments-core/api/payments-core.api +++ b/payments-core/api/payments-core.api @@ -4881,20 +4881,20 @@ public final class com/stripe/android/payments/bankaccount/di/DaggerCollectBankA public fun inject (Lcom/stripe/android/payments/bankaccount/ui/CollectBankAccountViewModel$Factory;)V } -public final class com/stripe/android/payments/bankaccount/domain/AttachLinkAccountSession_Factory : dagger/internal/Factory { +public final class com/stripe/android/payments/bankaccount/domain/AttachFinancialConnectionsSession_Factory : dagger/internal/Factory { public fun (Ljavax/inject/Provider;)V - public static fun create (Ljavax/inject/Provider;)Lcom/stripe/android/payments/bankaccount/domain/AttachLinkAccountSession_Factory; - public fun get ()Lcom/stripe/android/payments/bankaccount/domain/AttachLinkAccountSession; + public static fun create (Ljavax/inject/Provider;)Lcom/stripe/android/payments/bankaccount/domain/AttachFinancialConnectionsSession_Factory; + public fun get ()Lcom/stripe/android/payments/bankaccount/domain/AttachFinancialConnectionsSession; public synthetic fun get ()Ljava/lang/Object; - public static fun newInstance (Lcom/stripe/android/networking/StripeRepository;)Lcom/stripe/android/payments/bankaccount/domain/AttachLinkAccountSession; + public static fun newInstance (Lcom/stripe/android/networking/StripeRepository;)Lcom/stripe/android/payments/bankaccount/domain/AttachFinancialConnectionsSession; } -public final class com/stripe/android/payments/bankaccount/domain/CreateLinkAccountSession_Factory : dagger/internal/Factory { +public final class com/stripe/android/payments/bankaccount/domain/CreateFinancialConnectionsSession_Factory : dagger/internal/Factory { public fun (Ljavax/inject/Provider;)V - public static fun create (Ljavax/inject/Provider;)Lcom/stripe/android/payments/bankaccount/domain/CreateLinkAccountSession_Factory; - public fun get ()Lcom/stripe/android/payments/bankaccount/domain/CreateLinkAccountSession; + public static fun create (Ljavax/inject/Provider;)Lcom/stripe/android/payments/bankaccount/domain/CreateFinancialConnectionsSession_Factory; + public fun get ()Lcom/stripe/android/payments/bankaccount/domain/CreateFinancialConnectionsSession; public synthetic fun get ()Ljava/lang/Object; - public static fun newInstance (Lcom/stripe/android/networking/StripeRepository;)Lcom/stripe/android/payments/bankaccount/domain/CreateLinkAccountSession; + public static fun newInstance (Lcom/stripe/android/networking/StripeRepository;)Lcom/stripe/android/payments/bankaccount/domain/CreateFinancialConnectionsSession; } public final class com/stripe/android/payments/bankaccount/domain/RetrieveStripeIntent_Factory : dagger/internal/Factory { @@ -4920,15 +4920,15 @@ public final class com/stripe/android/payments/bankaccount/navigation/CollectBan public final class com/stripe/android/payments/bankaccount/navigation/CollectBankAccountResponse : com/stripe/android/core/model/StripeModel { public static final field $stable I public static final field CREATOR Landroid/os/Parcelable$Creator; - public fun (Lcom/stripe/android/model/StripeIntent;Lcom/stripe/android/financialconnections/model/LinkAccountSession;)V + public fun (Lcom/stripe/android/model/StripeIntent;Lcom/stripe/android/financialconnections/model/FinancialConnectionsSession;)V public final fun component1 ()Lcom/stripe/android/model/StripeIntent; - public final fun component2 ()Lcom/stripe/android/financialconnections/model/LinkAccountSession; - public final fun copy (Lcom/stripe/android/model/StripeIntent;Lcom/stripe/android/financialconnections/model/LinkAccountSession;)Lcom/stripe/android/payments/bankaccount/navigation/CollectBankAccountResponse; - public static synthetic fun copy$default (Lcom/stripe/android/payments/bankaccount/navigation/CollectBankAccountResponse;Lcom/stripe/android/model/StripeIntent;Lcom/stripe/android/financialconnections/model/LinkAccountSession;ILjava/lang/Object;)Lcom/stripe/android/payments/bankaccount/navigation/CollectBankAccountResponse; + public final fun component2 ()Lcom/stripe/android/financialconnections/model/FinancialConnectionsSession; + public final fun copy (Lcom/stripe/android/model/StripeIntent;Lcom/stripe/android/financialconnections/model/FinancialConnectionsSession;)Lcom/stripe/android/payments/bankaccount/navigation/CollectBankAccountResponse; + public static synthetic fun copy$default (Lcom/stripe/android/payments/bankaccount/navigation/CollectBankAccountResponse;Lcom/stripe/android/model/StripeIntent;Lcom/stripe/android/financialconnections/model/FinancialConnectionsSession;ILjava/lang/Object;)Lcom/stripe/android/payments/bankaccount/navigation/CollectBankAccountResponse; public fun describeContents ()I public fun equals (Ljava/lang/Object;)Z + public final fun getFinancialConnectionsSession ()Lcom/stripe/android/financialconnections/model/FinancialConnectionsSession; public final fun getIntent ()Lcom/stripe/android/model/StripeIntent; - public final fun getLinkAccountSession ()Lcom/stripe/android/financialconnections/model/LinkAccountSession; public fun hashCode ()I public fun toString ()Ljava/lang/String; public fun writeToParcel (Landroid/os/Parcel;I)V @@ -4981,7 +4981,7 @@ public final class com/stripe/android/payments/bankaccount/ui/CollectBankAccount public static fun create (Ljavax/inject/Provider;Ljavax/inject/Provider;Ljavax/inject/Provider;Ljavax/inject/Provider;Ljavax/inject/Provider;Ljavax/inject/Provider;)Lcom/stripe/android/payments/bankaccount/ui/CollectBankAccountViewModel_Factory; public fun get ()Lcom/stripe/android/payments/bankaccount/ui/CollectBankAccountViewModel; public synthetic fun get ()Ljava/lang/Object; - public static fun newInstance (Lcom/stripe/android/payments/bankaccount/navigation/CollectBankAccountContract$Args;Lkotlinx/coroutines/flow/MutableSharedFlow;Lcom/stripe/android/payments/bankaccount/domain/CreateLinkAccountSession;Lcom/stripe/android/payments/bankaccount/domain/AttachLinkAccountSession;Lcom/stripe/android/payments/bankaccount/domain/RetrieveStripeIntent;Lcom/stripe/android/core/Logger;)Lcom/stripe/android/payments/bankaccount/ui/CollectBankAccountViewModel; + public static fun newInstance (Lcom/stripe/android/payments/bankaccount/navigation/CollectBankAccountContract$Args;Lkotlinx/coroutines/flow/MutableSharedFlow;Lcom/stripe/android/payments/bankaccount/domain/CreateFinancialConnectionsSession;Lcom/stripe/android/payments/bankaccount/domain/AttachFinancialConnectionsSession;Lcom/stripe/android/payments/bankaccount/domain/RetrieveStripeIntent;Lcom/stripe/android/core/Logger;)Lcom/stripe/android/payments/bankaccount/ui/CollectBankAccountViewModel; } public final class com/stripe/android/payments/core/ActivityResultLauncherHost$DefaultImpls { From 76f575e8c6e839386a01c83f38aa2975b14eebcb Mon Sep 17 00:00:00 2001 From: Carlos Munoz Date: Thu, 28 Apr 2022 09:42:06 -0700 Subject: [PATCH 09/12] Updates changelog. --- CHANGELOG.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2d0631d0b27..69f7e4744e9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # CHANGELOG ## x.x.x - xxxx-xx-xx + +### Payments + +* [CHANGED] [4910](https://github.com/stripe/stripe-android/pull/4910) Some changes affecting CollectBankAccountLauncher (ACH) + * `CollectBankAccountResponse#LinkAccountSession` to `FinancialConnectionsSession` + * `LinkedAccount` to `FinancialConnectionsAccount`. + ### PaymentSheet * [FIXED] [4909](https://github.com/stripe/stripe-android/pull/4909) In the multi-step flow when re-opening to a new card the form will pre-populate. Also the default billing address will pre-populate in the form. From 2cc3260f3f3dadc42d2a8d8e76bac866331d7c5c Mon Sep 17 00:00:00 2001 From: Carlos Munoz Date: Thu, 28 Apr 2022 10:20:53 -0700 Subject: [PATCH 10/12] Adds missing renames. --- .../api/financial-connections.api | 80 +++++++++---------- .../FinancialConnectionsSheet.kt | 1 - .../FinancialConnectionsSheetContract.kt | 4 +- ...FinancialConnectionsSheetForTokenResult.kt | 2 +- ...nancialConnectionsSheetForTokenLauncher.kt | 2 +- ...FinancialConnectionsSessionForTokenTest.kt | 5 +- ...ialConnectionsSheetForTokenLauncherTest.kt | 5 +- .../FinancialConnectionsApiRepositoryTest.kt | 2 +- .../financialconnections/test/testutils.kt | 2 +- 9 files changed, 50 insertions(+), 53 deletions(-) diff --git a/financial-connections/api/financial-connections.api b/financial-connections/api/financial-connections.api index ac18087e4c0..6042a92f549 100644 --- a/financial-connections/api/financial-connections.api +++ b/financial-connections/api/financial-connections.api @@ -1,43 +1,3 @@ -public abstract class com/stripe/android/connections/FinancialConnectionsSheetForTokenResult : android/os/Parcelable { -} - -public final class com/stripe/android/connections/FinancialConnectionsSheetForTokenResult$Canceled : com/stripe/android/connections/FinancialConnectionsSheetForTokenResult { - public static final field CREATOR Landroid/os/Parcelable$Creator; - public static final field INSTANCE Lcom/stripe/android/connections/FinancialConnectionsSheetForTokenResult$Canceled; - public fun describeContents ()I - public fun writeToParcel (Landroid/os/Parcel;I)V -} - -public final class com/stripe/android/connections/FinancialConnectionsSheetForTokenResult$Completed : com/stripe/android/connections/FinancialConnectionsSheetForTokenResult { - public static final field CREATOR Landroid/os/Parcelable$Creator; - public fun (Lcom/stripe/android/financialconnections/model/FinancialConnectionsSession;Lcom/stripe/android/model/Token;)V - public final fun component1 ()Lcom/stripe/android/financialconnections/model/FinancialConnectionsSession; - public final fun component2 ()Lcom/stripe/android/model/Token; - public final fun copy (Lcom/stripe/android/financialconnections/model/FinancialConnectionsSession;Lcom/stripe/android/model/Token;)Lcom/stripe/android/connections/FinancialConnectionsSheetForTokenResult$Completed; - public static synthetic fun copy$default (Lcom/stripe/android/connections/FinancialConnectionsSheetForTokenResult$Completed;Lcom/stripe/android/financialconnections/model/FinancialConnectionsSession;Lcom/stripe/android/model/Token;ILjava/lang/Object;)Lcom/stripe/android/connections/FinancialConnectionsSheetForTokenResult$Completed; - public fun describeContents ()I - public fun equals (Ljava/lang/Object;)Z - public final fun getFinancialConnectionsSession ()Lcom/stripe/android/financialconnections/model/FinancialConnectionsSession; - public final fun getToken ()Lcom/stripe/android/model/Token; - public fun hashCode ()I - public fun toString ()Ljava/lang/String; - public fun writeToParcel (Landroid/os/Parcel;I)V -} - -public final class com/stripe/android/connections/FinancialConnectionsSheetForTokenResult$Failed : com/stripe/android/connections/FinancialConnectionsSheetForTokenResult { - public static final field CREATOR Landroid/os/Parcelable$Creator; - public fun (Ljava/lang/Throwable;)V - public final fun component1 ()Ljava/lang/Throwable; - public final fun copy (Ljava/lang/Throwable;)Lcom/stripe/android/connections/FinancialConnectionsSheetForTokenResult$Failed; - public static synthetic fun copy$default (Lcom/stripe/android/connections/FinancialConnectionsSheetForTokenResult$Failed;Ljava/lang/Throwable;ILjava/lang/Object;)Lcom/stripe/android/connections/FinancialConnectionsSheetForTokenResult$Failed; - public fun describeContents ()I - public fun equals (Ljava/lang/Object;)Z - public final fun getError ()Ljava/lang/Throwable; - public fun hashCode ()I - public fun toString ()Ljava/lang/String; - public fun writeToParcel (Landroid/os/Parcel;I)V -} - public final class com/stripe/android/financialconnections/BuildConfig { public static final field BUILD_TYPE Ljava/lang/String; public static final field DEBUG Z @@ -71,6 +31,46 @@ public final class com/stripe/android/financialconnections/FinancialConnectionsS public fun writeToParcel (Landroid/os/Parcel;I)V } +public abstract class com/stripe/android/financialconnections/FinancialConnectionsSheetForTokenResult : android/os/Parcelable { +} + +public final class com/stripe/android/financialconnections/FinancialConnectionsSheetForTokenResult$Canceled : com/stripe/android/financialconnections/FinancialConnectionsSheetForTokenResult { + public static final field CREATOR Landroid/os/Parcelable$Creator; + public static final field INSTANCE Lcom/stripe/android/financialconnections/FinancialConnectionsSheetForTokenResult$Canceled; + public fun describeContents ()I + public fun writeToParcel (Landroid/os/Parcel;I)V +} + +public final class com/stripe/android/financialconnections/FinancialConnectionsSheetForTokenResult$Completed : com/stripe/android/financialconnections/FinancialConnectionsSheetForTokenResult { + public static final field CREATOR Landroid/os/Parcelable$Creator; + public fun (Lcom/stripe/android/financialconnections/model/FinancialConnectionsSession;Lcom/stripe/android/model/Token;)V + public final fun component1 ()Lcom/stripe/android/financialconnections/model/FinancialConnectionsSession; + public final fun component2 ()Lcom/stripe/android/model/Token; + public final fun copy (Lcom/stripe/android/financialconnections/model/FinancialConnectionsSession;Lcom/stripe/android/model/Token;)Lcom/stripe/android/financialconnections/FinancialConnectionsSheetForTokenResult$Completed; + public static synthetic fun copy$default (Lcom/stripe/android/financialconnections/FinancialConnectionsSheetForTokenResult$Completed;Lcom/stripe/android/financialconnections/model/FinancialConnectionsSession;Lcom/stripe/android/model/Token;ILjava/lang/Object;)Lcom/stripe/android/financialconnections/FinancialConnectionsSheetForTokenResult$Completed; + public fun describeContents ()I + public fun equals (Ljava/lang/Object;)Z + public final fun getFinancialConnectionsSession ()Lcom/stripe/android/financialconnections/model/FinancialConnectionsSession; + public final fun getToken ()Lcom/stripe/android/model/Token; + public fun hashCode ()I + public fun toString ()Ljava/lang/String; + public fun writeToParcel (Landroid/os/Parcel;I)V +} + +public final class com/stripe/android/financialconnections/FinancialConnectionsSheetForTokenResult$Failed : com/stripe/android/financialconnections/FinancialConnectionsSheetForTokenResult { + public static final field CREATOR Landroid/os/Parcelable$Creator; + public fun (Ljava/lang/Throwable;)V + public final fun component1 ()Ljava/lang/Throwable; + public final fun copy (Ljava/lang/Throwable;)Lcom/stripe/android/financialconnections/FinancialConnectionsSheetForTokenResult$Failed; + public static synthetic fun copy$default (Lcom/stripe/android/financialconnections/FinancialConnectionsSheetForTokenResult$Failed;Ljava/lang/Throwable;ILjava/lang/Object;)Lcom/stripe/android/financialconnections/FinancialConnectionsSheetForTokenResult$Failed; + public fun describeContents ()I + public fun equals (Ljava/lang/Object;)Z + public final fun getError ()Ljava/lang/Throwable; + public fun hashCode ()I + public fun toString ()Ljava/lang/String; + public fun writeToParcel (Landroid/os/Parcel;I)V +} + public final class com/stripe/android/financialconnections/FinancialConnectionsSheetRedirectActivity : androidx/appcompat/app/AppCompatActivity { public fun ()V } diff --git a/financial-connections/src/main/java/com/stripe/android/financialconnections/FinancialConnectionsSheet.kt b/financial-connections/src/main/java/com/stripe/android/financialconnections/FinancialConnectionsSheet.kt index ea2de601aed..589c8976e32 100644 --- a/financial-connections/src/main/java/com/stripe/android/financialconnections/FinancialConnectionsSheet.kt +++ b/financial-connections/src/main/java/com/stripe/android/financialconnections/FinancialConnectionsSheet.kt @@ -3,7 +3,6 @@ package com.stripe.android.financialconnections import android.os.Parcelable import androidx.activity.ComponentActivity import androidx.fragment.app.Fragment -import com.stripe.android.connections.FinancialConnectionsSheetForTokenResult import com.stripe.android.financialconnections.launcher.DefaultFinancialConnectionsSheetLauncher import com.stripe.android.financialconnections.launcher.FinancialConnectionsSheetForTokenLauncher import com.stripe.android.financialconnections.launcher.FinancialConnectionsSheetLauncher diff --git a/financial-connections/src/main/java/com/stripe/android/financialconnections/FinancialConnectionsSheetContract.kt b/financial-connections/src/main/java/com/stripe/android/financialconnections/FinancialConnectionsSheetContract.kt index cc80de1898c..37ae29c610e 100644 --- a/financial-connections/src/main/java/com/stripe/android/financialconnections/FinancialConnectionsSheetContract.kt +++ b/financial-connections/src/main/java/com/stripe/android/financialconnections/FinancialConnectionsSheetContract.kt @@ -100,8 +100,8 @@ internal class FinancialConnectionsSheetContract : companion object { const val EXTRA_ARGS = - "com.stripe.android.connections.ConnectionsSheetContract.extra_args" + "com.stripe.android.financialconnections.ConnectionsSheetContract.extra_args" private const val EXTRA_RESULT = - "com.stripe.android.connections.ConnectionsSheetContract.extra_result" + "com.stripe.android.financialconnections.ConnectionsSheetContract.extra_result" } } diff --git a/financial-connections/src/main/java/com/stripe/android/financialconnections/FinancialConnectionsSheetForTokenResult.kt b/financial-connections/src/main/java/com/stripe/android/financialconnections/FinancialConnectionsSheetForTokenResult.kt index 4725b6b7744..25b2dc3dcdb 100644 --- a/financial-connections/src/main/java/com/stripe/android/financialconnections/FinancialConnectionsSheetForTokenResult.kt +++ b/financial-connections/src/main/java/com/stripe/android/financialconnections/FinancialConnectionsSheetForTokenResult.kt @@ -1,4 +1,4 @@ -package com.stripe.android.connections +package com.stripe.android.financialconnections import android.os.Parcelable import com.stripe.android.financialconnections.model.FinancialConnectionsSession diff --git a/financial-connections/src/main/java/com/stripe/android/financialconnections/launcher/FinancialConnectionsSheetForTokenLauncher.kt b/financial-connections/src/main/java/com/stripe/android/financialconnections/launcher/FinancialConnectionsSheetForTokenLauncher.kt index 95864913bf6..2af59aef65b 100644 --- a/financial-connections/src/main/java/com/stripe/android/financialconnections/launcher/FinancialConnectionsSheetForTokenLauncher.kt +++ b/financial-connections/src/main/java/com/stripe/android/financialconnections/launcher/FinancialConnectionsSheetForTokenLauncher.kt @@ -4,13 +4,13 @@ import androidx.activity.ComponentActivity import androidx.activity.result.ActivityResultLauncher import androidx.activity.result.ActivityResultRegistry import androidx.fragment.app.Fragment -import com.stripe.android.connections.FinancialConnectionsSheetForTokenResult import com.stripe.android.financialconnections.FinancialConnectionsSheet import com.stripe.android.financialconnections.FinancialConnectionsSheetContract import com.stripe.android.financialconnections.FinancialConnectionsSheetContract.Result import com.stripe.android.financialconnections.FinancialConnectionsSheetContract.Result.Canceled import com.stripe.android.financialconnections.FinancialConnectionsSheetContract.Result.Completed import com.stripe.android.financialconnections.FinancialConnectionsSheetContract.Result.Failed +import com.stripe.android.financialconnections.FinancialConnectionsSheetForTokenResult import org.jetbrains.annotations.TestOnly internal class FinancialConnectionsSheetForTokenLauncher( diff --git a/financial-connections/src/test/java/com/stripe/android/financialconnections/domain/FetchFinancialConnectionsSessionForTokenTest.kt b/financial-connections/src/test/java/com/stripe/android/financialconnections/domain/FetchFinancialConnectionsSessionForTokenTest.kt index d16d0940f29..d8cd1bd141b 100644 --- a/financial-connections/src/test/java/com/stripe/android/financialconnections/domain/FetchFinancialConnectionsSessionForTokenTest.kt +++ b/financial-connections/src/test/java/com/stripe/android/financialconnections/domain/FetchFinancialConnectionsSessionForTokenTest.kt @@ -1,11 +1,10 @@ -package com.stripe.android.connections.domain +package com.stripe.android.financialconnections.domain import com.google.common.truth.Truth.assertThat -import com.stripe.android.connections.test.readResourceAsString import com.stripe.android.financialconnections.ApiKeyFixtures -import com.stripe.android.financialconnections.domain.FetchFinancialConnectionsSessionForToken import com.stripe.android.financialconnections.model.FinancialConnectionsSession import com.stripe.android.financialconnections.networking.FakeFinancialConnectionsRepository +import com.stripe.android.financialconnections.test.readResourceAsString import kotlinx.coroutines.ExperimentalCoroutinesApi import kotlinx.coroutines.test.runTest import kotlinx.serialization.json.Json diff --git a/financial-connections/src/test/java/com/stripe/android/financialconnections/launcher/FinancialConnectionsSheetForTokenLauncherTest.kt b/financial-connections/src/test/java/com/stripe/android/financialconnections/launcher/FinancialConnectionsSheetForTokenLauncherTest.kt index 017be8ea7ed..e55ca4de027 100644 --- a/financial-connections/src/test/java/com/stripe/android/financialconnections/launcher/FinancialConnectionsSheetForTokenLauncherTest.kt +++ b/financial-connections/src/test/java/com/stripe/android/financialconnections/launcher/FinancialConnectionsSheetForTokenLauncherTest.kt @@ -1,14 +1,13 @@ -package com.stripe.android.connections.launcher +package com.stripe.android.financialconnections.launcher import androidx.fragment.app.testing.launchFragmentInContainer import androidx.lifecycle.Lifecycle import com.google.common.truth.Truth.assertThat -import com.stripe.android.connections.FinancialConnectionsSheetForTokenResult import com.stripe.android.financialconnections.FinancialConnectionsSheet import com.stripe.android.financialconnections.FinancialConnectionsSheetContract +import com.stripe.android.financialconnections.FinancialConnectionsSheetForTokenResult import com.stripe.android.financialconnections.bankAccountToken import com.stripe.android.financialconnections.financialConnectionsSessionWithNoMoreAccounts -import com.stripe.android.financialconnections.launcher.FinancialConnectionsSheetForTokenLauncher import com.stripe.android.financialconnections.utils.FakeActivityResultRegistry import com.stripe.android.financialconnections.utils.TestFragment import org.junit.Test diff --git a/financial-connections/src/test/java/com/stripe/android/financialconnections/repository/FinancialConnectionsApiRepositoryTest.kt b/financial-connections/src/test/java/com/stripe/android/financialconnections/repository/FinancialConnectionsApiRepositoryTest.kt index 59179f05019..0bfb34c977e 100644 --- a/financial-connections/src/test/java/com/stripe/android/financialconnections/repository/FinancialConnectionsApiRepositoryTest.kt +++ b/financial-connections/src/test/java/com/stripe/android/financialconnections/repository/FinancialConnectionsApiRepositoryTest.kt @@ -1,13 +1,13 @@ package com.stripe.android.financialconnections.repository import com.google.common.truth.Truth.assertThat -import com.stripe.android.connections.test.readResourceAsString import com.stripe.android.core.networking.ApiRequest import com.stripe.android.core.networking.StripeNetworkClient import com.stripe.android.core.networking.StripeResponse import com.stripe.android.financialconnections.ApiKeyFixtures import com.stripe.android.financialconnections.model.BankAccount import com.stripe.android.financialconnections.model.FinancialConnectionsAccount +import com.stripe.android.financialconnections.test.readResourceAsString import kotlinx.coroutines.ExperimentalCoroutinesApi import kotlinx.coroutines.test.runTest import org.junit.Test diff --git a/financial-connections/src/test/java/com/stripe/android/financialconnections/test/testutils.kt b/financial-connections/src/test/java/com/stripe/android/financialconnections/test/testutils.kt index 8425256b650..74c68d1b967 100644 --- a/financial-connections/src/test/java/com/stripe/android/financialconnections/test/testutils.kt +++ b/financial-connections/src/test/java/com/stripe/android/financialconnections/test/testutils.kt @@ -1,4 +1,4 @@ -package com.stripe.android.connections.test +package com.stripe.android.financialconnections.test import java.io.BufferedReader From 24fda779ba2f82cd07fe7203b0bb7b631d8d79c1 Mon Sep 17 00:00:00 2001 From: Carlos Munoz Date: Thu, 28 Apr 2022 10:55:52 -0700 Subject: [PATCH 11/12] Removes double financial occurrences. --- ...eporter.kt => DefaultFinancialConnectionsEventReporter.kt} | 2 +- .../di/FinancialConnectionsSheetModule.kt | 4 ++-- ...tivityTest.kt => FinancialConnectionsSheetActivityTest.kt} | 2 +- ...ntractTest.kt => FinancialConnectionsSheetContractTest.kt} | 2 +- ...ModelTest.kt => FinancialConnectionsSheetViewModelTest.kt} | 2 +- .../analytics/DefaultConnectionsEventReportTest.kt | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) rename financial-connections/src/main/java/com/stripe/android/financialconnections/analytics/{DefaultFinancialFinancialConnectionsEventReporter.kt => DefaultFinancialConnectionsEventReporter.kt} (97%) rename financial-connections/src/test/java/com/stripe/android/financialconnections/{FinancialFinancialConnectionsSheetActivityTest.kt => FinancialConnectionsSheetActivityTest.kt} (99%) rename financial-connections/src/test/java/com/stripe/android/financialconnections/{FinancialFinancialConnectionsSheetContractTest.kt => FinancialConnectionsSheetContractTest.kt} (97%) rename financial-connections/src/test/java/com/stripe/android/financialconnections/{FinancialFinancialConnectionsSheetViewModelTest.kt => FinancialConnectionsSheetViewModelTest.kt} (99%) diff --git a/financial-connections/src/main/java/com/stripe/android/financialconnections/analytics/DefaultFinancialFinancialConnectionsEventReporter.kt b/financial-connections/src/main/java/com/stripe/android/financialconnections/analytics/DefaultFinancialConnectionsEventReporter.kt similarity index 97% rename from financial-connections/src/main/java/com/stripe/android/financialconnections/analytics/DefaultFinancialFinancialConnectionsEventReporter.kt rename to financial-connections/src/main/java/com/stripe/android/financialconnections/analytics/DefaultFinancialConnectionsEventReporter.kt index 86e2bcf7813..763e8d654e5 100644 --- a/financial-connections/src/main/java/com/stripe/android/financialconnections/analytics/DefaultFinancialFinancialConnectionsEventReporter.kt +++ b/financial-connections/src/main/java/com/stripe/android/financialconnections/analytics/DefaultFinancialConnectionsEventReporter.kt @@ -10,7 +10,7 @@ import kotlinx.coroutines.launch import javax.inject.Inject import kotlin.coroutines.CoroutineContext -internal class DefaultFinancialFinancialConnectionsEventReporter @Inject constructor( +internal class DefaultFinancialConnectionsEventReporter @Inject constructor( private val analyticsRequestExecutor: AnalyticsRequestExecutor, private val analyticsRequestFactory: AnalyticsRequestFactory, @IOContext private val workContext: CoroutineContext diff --git a/financial-connections/src/main/java/com/stripe/android/financialconnections/di/FinancialConnectionsSheetModule.kt b/financial-connections/src/main/java/com/stripe/android/financialconnections/di/FinancialConnectionsSheetModule.kt index 66af0b5ce7c..37f43227b91 100644 --- a/financial-connections/src/main/java/com/stripe/android/financialconnections/di/FinancialConnectionsSheetModule.kt +++ b/financial-connections/src/main/java/com/stripe/android/financialconnections/di/FinancialConnectionsSheetModule.kt @@ -10,7 +10,7 @@ import com.stripe.android.core.networking.ApiRequest import com.stripe.android.core.networking.DefaultAnalyticsRequestExecutor import com.stripe.android.core.networking.DefaultStripeNetworkClient import com.stripe.android.core.networking.StripeNetworkClient -import com.stripe.android.financialconnections.analytics.DefaultFinancialFinancialConnectionsEventReporter +import com.stripe.android.financialconnections.analytics.DefaultFinancialConnectionsEventReporter import com.stripe.android.financialconnections.analytics.FinancialConnectionsEventReporter import com.stripe.android.financialconnections.repository.FinancialConnectionsApiRepository import com.stripe.android.financialconnections.repository.FinancialConnectionsRepository @@ -54,7 +54,7 @@ internal object FinancialConnectionsSheetModule { @Provides @Singleton fun provideEventReporter( - defaultFinancialConnectionsEventReporter: DefaultFinancialFinancialConnectionsEventReporter + defaultFinancialConnectionsEventReporter: DefaultFinancialConnectionsEventReporter ): FinancialConnectionsEventReporter = defaultFinancialConnectionsEventReporter @Provides diff --git a/financial-connections/src/test/java/com/stripe/android/financialconnections/FinancialFinancialConnectionsSheetActivityTest.kt b/financial-connections/src/test/java/com/stripe/android/financialconnections/FinancialConnectionsSheetActivityTest.kt similarity index 99% rename from financial-connections/src/test/java/com/stripe/android/financialconnections/FinancialFinancialConnectionsSheetActivityTest.kt rename to financial-connections/src/test/java/com/stripe/android/financialconnections/FinancialConnectionsSheetActivityTest.kt index f342299bca0..a4be9bec64b 100644 --- a/financial-connections/src/test/java/com/stripe/android/financialconnections/FinancialFinancialConnectionsSheetActivityTest.kt +++ b/financial-connections/src/test/java/com/stripe/android/financialconnections/FinancialConnectionsSheetActivityTest.kt @@ -28,7 +28,7 @@ import org.robolectric.Shadows.shadowOf @RunWith(RobolectricTestRunner::class) @ExperimentalCoroutinesApi -class FinancialFinancialConnectionsSheetActivityTest { +class FinancialConnectionsSheetActivityTest { private val context = ApplicationProvider.getApplicationContext() private val contract = FinancialConnectionsSheetContract() diff --git a/financial-connections/src/test/java/com/stripe/android/financialconnections/FinancialFinancialConnectionsSheetContractTest.kt b/financial-connections/src/test/java/com/stripe/android/financialconnections/FinancialConnectionsSheetContractTest.kt similarity index 97% rename from financial-connections/src/test/java/com/stripe/android/financialconnections/FinancialFinancialConnectionsSheetContractTest.kt rename to financial-connections/src/test/java/com/stripe/android/financialconnections/FinancialConnectionsSheetContractTest.kt index 4a4c33dceaa..213c1b236d2 100644 --- a/financial-connections/src/test/java/com/stripe/android/financialconnections/FinancialFinancialConnectionsSheetContractTest.kt +++ b/financial-connections/src/test/java/com/stripe/android/financialconnections/FinancialConnectionsSheetContractTest.kt @@ -9,7 +9,7 @@ import java.security.InvalidParameterException import kotlin.test.assertFailsWith @RunWith(RobolectricTestRunner::class) -class FinancialFinancialConnectionsSheetContractTest { +class FinancialConnectionsSheetContractTest { @Test fun `parseResult() with missing data should return failed result`() { diff --git a/financial-connections/src/test/java/com/stripe/android/financialconnections/FinancialFinancialConnectionsSheetViewModelTest.kt b/financial-connections/src/test/java/com/stripe/android/financialconnections/FinancialConnectionsSheetViewModelTest.kt similarity index 99% rename from financial-connections/src/test/java/com/stripe/android/financialconnections/FinancialFinancialConnectionsSheetViewModelTest.kt rename to financial-connections/src/test/java/com/stripe/android/financialconnections/FinancialConnectionsSheetViewModelTest.kt index a38cdcea79c..61a8946f81c 100644 --- a/financial-connections/src/test/java/com/stripe/android/financialconnections/FinancialFinancialConnectionsSheetViewModelTest.kt +++ b/financial-connections/src/test/java/com/stripe/android/financialconnections/FinancialConnectionsSheetViewModelTest.kt @@ -29,7 +29,7 @@ import org.mockito.kotlin.whenever @ExperimentalCoroutinesApi @RunWith(AndroidJUnit4::class) -class FinancialFinancialConnectionsSheetViewModelTest { +class FinancialConnectionsSheetViewModelTest { private val eventReporter = mock() private val configuration = FinancialConnectionsSheet.Configuration( diff --git a/financial-connections/src/test/java/com/stripe/android/financialconnections/analytics/DefaultConnectionsEventReportTest.kt b/financial-connections/src/test/java/com/stripe/android/financialconnections/analytics/DefaultConnectionsEventReportTest.kt index f44e5793c03..59bd77c2c11 100644 --- a/financial-connections/src/test/java/com/stripe/android/financialconnections/analytics/DefaultConnectionsEventReportTest.kt +++ b/financial-connections/src/test/java/com/stripe/android/financialconnections/analytics/DefaultConnectionsEventReportTest.kt @@ -32,7 +32,7 @@ class DefaultConnectionsEventReportTest { publishableKeyProvider = { ApiKeyFixtures.DEFAULT_PUBLISHABLE_KEY } ) - private val eventReporter = DefaultFinancialFinancialConnectionsEventReporter( + private val eventReporter = DefaultFinancialConnectionsEventReporter( analyticsRequestExecutor, analyticsRequestFactory, testDispatcher From 5861b9854dbaab1061af7784c49c0e06be348184 Mon Sep 17 00:00:00 2001 From: Carlos Munoz Date: Thu, 28 Apr 2022 11:18:28 -0700 Subject: [PATCH 12/12] Api updates. --- financial-connections/api/financial-connections.api | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/financial-connections/api/financial-connections.api b/financial-connections/api/financial-connections.api index 6042a92f549..2d0ba5527d6 100644 --- a/financial-connections/api/financial-connections.api +++ b/financial-connections/api/financial-connections.api @@ -125,12 +125,12 @@ public final class com/stripe/android/financialconnections/FinancialConnectionsS public static fun newInstance (Ljava/lang/String;Lcom/stripe/android/financialconnections/FinancialConnectionsSheetContract$Args;Lcom/stripe/android/financialconnections/domain/GenerateFinancialConnectionsSessionManifest;Lcom/stripe/android/financialconnections/domain/FetchFinancialConnectionsSession;Lcom/stripe/android/financialconnections/domain/FetchFinancialConnectionsSessionForToken;Landroidx/lifecycle/SavedStateHandle;Lcom/stripe/android/financialconnections/analytics/FinancialConnectionsEventReporter;)Lcom/stripe/android/financialconnections/FinancialConnectionsSheetViewModel; } -public final class com/stripe/android/financialconnections/analytics/DefaultFinancialFinancialConnectionsEventReporter_Factory : dagger/internal/Factory { +public final class com/stripe/android/financialconnections/analytics/DefaultFinancialConnectionsEventReporter_Factory : dagger/internal/Factory { public fun (Ljavax/inject/Provider;Ljavax/inject/Provider;Ljavax/inject/Provider;)V - public static fun create (Ljavax/inject/Provider;Ljavax/inject/Provider;Ljavax/inject/Provider;)Lcom/stripe/android/financialconnections/analytics/DefaultFinancialFinancialConnectionsEventReporter_Factory; - public fun get ()Lcom/stripe/android/financialconnections/analytics/DefaultFinancialFinancialConnectionsEventReporter; + public static fun create (Ljavax/inject/Provider;Ljavax/inject/Provider;Ljavax/inject/Provider;)Lcom/stripe/android/financialconnections/analytics/DefaultFinancialConnectionsEventReporter_Factory; + public fun get ()Lcom/stripe/android/financialconnections/analytics/DefaultFinancialConnectionsEventReporter; public synthetic fun get ()Ljava/lang/Object; - public static fun newInstance (Lcom/stripe/android/core/networking/AnalyticsRequestExecutor;Lcom/stripe/android/core/networking/AnalyticsRequestFactory;Lkotlin/coroutines/CoroutineContext;)Lcom/stripe/android/financialconnections/analytics/DefaultFinancialFinancialConnectionsEventReporter; + public static fun newInstance (Lcom/stripe/android/core/networking/AnalyticsRequestExecutor;Lcom/stripe/android/core/networking/AnalyticsRequestFactory;Lkotlin/coroutines/CoroutineContext;)Lcom/stripe/android/financialconnections/analytics/DefaultFinancialConnectionsEventReporter; } public final class com/stripe/android/financialconnections/databinding/ActivityFinancialconnectionsSheetBinding : androidx/viewbinding/ViewBinding { @@ -201,7 +201,7 @@ public final class com/stripe/android/financialconnections/di/FinancialConnectio public static fun create (Ljavax/inject/Provider;)Lcom/stripe/android/financialconnections/di/FinancialConnectionsSheetModule_ProvideEventReporterFactory; public fun get ()Lcom/stripe/android/financialconnections/analytics/FinancialConnectionsEventReporter; public synthetic fun get ()Ljava/lang/Object; - public static fun provideEventReporter (Lcom/stripe/android/financialconnections/analytics/DefaultFinancialFinancialConnectionsEventReporter;)Lcom/stripe/android/financialconnections/analytics/FinancialConnectionsEventReporter; + public static fun provideEventReporter (Lcom/stripe/android/financialconnections/analytics/DefaultFinancialConnectionsEventReporter;)Lcom/stripe/android/financialconnections/analytics/FinancialConnectionsEventReporter; } public final class com/stripe/android/financialconnections/di/FinancialConnectionsSheetModule_ProvideLocaleFactory : dagger/internal/Factory {