-
Notifications
You must be signed in to change notification settings - Fork 657
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Store
instantlyVerified
in BankAccount
instead
- Loading branch information
1 parent
00a8114
commit a208f9e
Showing
22 changed files
with
146 additions
and
218 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 0 additions & 7 deletions
7
...n/java/com/stripe/android/financialconnections/FinancialConnectionsSheetResultCallback.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,8 @@ | ||
package com.stripe.android.financialconnections | ||
|
||
import androidx.annotation.RestrictTo | ||
|
||
/** | ||
* Callback that is invoked when a [FinancialConnectionsSheetResult] is available. | ||
*/ | ||
fun interface FinancialConnectionsSheetResultCallback { | ||
fun onFinancialConnectionsSheetResult(financialConnectionsSheetResult: FinancialConnectionsSheetResult) | ||
} | ||
|
||
@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP) | ||
fun interface FinancialConnectionsSheetInternalResultCallback { | ||
fun onFinancialConnectionsSheetResult(financialConnectionsSheetResult: FinancialConnectionsSheetInternalResult) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
...va/com/stripe/android/financialconnections/model/FinancialConnectionsSessionExtensions.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package com.stripe.android.financialconnections.model | ||
|
||
/** | ||
* Updates the [FinancialConnectionsSession] with any data from the [FinancialConnectionsSessionManifest] | ||
* that's not already present. | ||
*/ | ||
internal fun FinancialConnectionsSession.update( | ||
manifest: FinancialConnectionsSessionManifest?, | ||
): FinancialConnectionsSession { | ||
val manualEntryUsesMicrodeposits = manifest?.manualEntryUsesMicrodeposits ?: false | ||
return copy( | ||
paymentAccount = paymentAccount?.setUsesMicrodepositsIfNeeded(manualEntryUsesMicrodeposits), | ||
) | ||
} | ||
|
||
/** | ||
* Updates the [FinancialConnectionsSession] with the [usesMicrodeposits] value if the linked account is | ||
* a [BankAccount]. | ||
*/ | ||
internal fun FinancialConnectionsSession.update( | ||
usesMicrodeposits: Boolean, | ||
): FinancialConnectionsSession { | ||
return copy( | ||
paymentAccount = paymentAccount?.setUsesMicrodepositsIfNeeded(usesMicrodeposits), | ||
) | ||
} | ||
|
||
private fun PaymentAccount.setUsesMicrodepositsIfNeeded( | ||
usesMicrodeposits: Boolean, | ||
): PaymentAccount { | ||
return when (this) { | ||
is BankAccount -> copy(usesMicrodeposits = usesMicrodeposits) | ||
is FinancialConnectionsAccount -> this | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.