-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature/nevisaccessapp 6287 multi user transaction confirmation fixes (…
…#27) - Pass only the filtered (valid) accounts to transaction confirmation and account selector when there are multiple registered accounts - Change the order Account Selection and Transaction Confirmation screens are shown: the former now displayed before the latter - Transaction Confirmation screen now only deals with a single Account as that should be selected before that - Transaction Confirmation message is passed along Account Selection now - Simplified/clarified logic in AccountSelectorImpl - Add TransactionConfirmationResponse and TransactionConfirmationUseCase and its implementation, the former is used by AccountSelectorImpl and the latter is used by SelectAccountViewModel to show transaction confirmation when a message is received
- Loading branch information
1 parent
1c9c4bb
commit b3519f2
Showing
13 changed files
with
210 additions
and
92 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
32 changes: 32 additions & 0 deletions
32
...a/ch/nevis/exampleapp/coroutines/domain/model/response/TransactionConfirmationResponse.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,32 @@ | ||
/** | ||
* Nevis Mobile Authentication SDK Example App | ||
* | ||
* Copyright © 2024. Nevis Security AG. All rights reserved. | ||
*/ | ||
|
||
package ch.nevis.exampleapp.coroutines.domain.model.response | ||
|
||
import ch.nevis.mobile.sdk.api.localdata.Account | ||
|
||
/** | ||
* [Response] class that indicates a transaction confirmation has to be started. | ||
* After the transaction confirmation, [ch.nevis.exampleapp.coroutines.domain.usecase.SelectAccountUseCase] | ||
* should be called with the contained account to continue the operation. | ||
* | ||
* @constructor Creates a new instance. | ||
* @param account The previously selected account. | ||
* @param transactionConfirmationMessage The transaction data/message that is be sent during an | ||
* authentication process. | ||
*/ | ||
class TransactionConfirmationResponse ( | ||
|
||
/** | ||
* The previously selected account. | ||
*/ | ||
val account: Account, | ||
|
||
/** | ||
* The optional transaction data/message that is sent during an authentication process. | ||
*/ | ||
val transactionConfirmationMessage: String | ||
) : Response |
26 changes: 26 additions & 0 deletions
26
...main/java/ch/nevis/exampleapp/coroutines/domain/usecase/TransactionConfirmationUseCase.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,26 @@ | ||
/** | ||
* Nevis Mobile Authentication SDK Example App | ||
* | ||
* Copyright © 2024. Nevis Security AG. All rights reserved. | ||
*/ | ||
|
||
package ch.nevis.exampleapp.coroutines.domain.usecase | ||
|
||
import ch.nevis.exampleapp.coroutines.domain.model.response.Response | ||
import ch.nevis.mobile.sdk.api.localdata.Account | ||
|
||
/** | ||
* Use-case interface for transaction confirmation. | ||
*/ | ||
interface TransactionConfirmationUseCase { | ||
|
||
/** | ||
* Executes the use-case. | ||
* | ||
* @param account The account that is used for the out-of-band authentication. | ||
* @param transactionConfirmationMessage The transaction data/message that is be sent during an | ||
* authentication process. | ||
* @return A [Response] object that indicates the result of the use-case execution. | ||
*/ | ||
suspend fun execute(account: Account, transactionConfirmationMessage: String): Response | ||
} |
29 changes: 29 additions & 0 deletions
29
.../java/ch/nevis/exampleapp/coroutines/domain/usecase/TransactionConfirmationUseCaseImpl.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,29 @@ | ||
/** | ||
* Nevis Mobile Authentication SDK Example App | ||
* | ||
* Copyright © 2024. Nevis Security AG. All rights reserved. | ||
*/ | ||
|
||
package ch.nevis.exampleapp.coroutines.domain.usecase | ||
|
||
import ch.nevis.exampleapp.coroutines.domain.model.response.Response | ||
import ch.nevis.exampleapp.coroutines.domain.model.response.TransactionConfirmationResponse | ||
import ch.nevis.mobile.sdk.api.localdata.Account | ||
import kotlinx.coroutines.suspendCancellableCoroutine | ||
import kotlin.coroutines.resume | ||
|
||
class TransactionConfirmationUseCaseImpl : TransactionConfirmationUseCase { | ||
|
||
//region TransactionConfirmationUseCase | ||
override suspend fun execute(account: Account, transactionConfirmationMessage: String): Response { | ||
return suspendCancellableCoroutine { cancellableContinuation -> | ||
cancellableContinuation.resume( | ||
TransactionConfirmationResponse( | ||
account, | ||
transactionConfirmationMessage | ||
) | ||
) | ||
} | ||
} | ||
//endregion | ||
} |
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
Oops, something went wrong.