-
Notifications
You must be signed in to change notification settings - Fork 662
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow
instant_or_skip
verification for ACH (#9695)
* Allow `instant_or_skip` verification for ACH * Add tests * Add changelog note * Update tests * Avoid public API changes Introduce `FinancialConnectionsSheetInternalResult` and a `toPublicResult` method * Store `instantlyVerified` in `BankAccount` instead
- Loading branch information
1 parent
d7545c4
commit 4a18fb4
Showing
10 changed files
with
189 additions
and
16 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
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
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