From 5f695e55dc897b3d0f01d0f682ae08f4956366cd Mon Sep 17 00:00:00 2001 From: Juma Allan Date: Thu, 16 Nov 2023 21:43:13 +0300 Subject: [PATCH] Rename partnerParams to extraPartnerParams (#260) * renamed partnerParams to extraPartnerParams * updated CHANGELOG.md --- CHANGELOG.md | 1 + .../com/smileidentity/compose/SmileIDExt.kt | 30 +++++++++---------- .../OrchestratedBiometricKYCScreen.kt | 4 +-- .../selfie/OrchestratedSelfieCaptureScreen.kt | 4 +-- .../viewmodel/BiometricKycViewModel.kt | 4 +-- .../viewmodel/SelfieViewModel.kt | 4 +-- .../document/OrchestratedDocumentViewModel.kt | 12 ++++---- 7 files changed, 30 insertions(+), 29 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d8a70a8df..3bc8d86c4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,7 @@ - Bump AndroidX Navigation to 2.7.5 - Bump Sentry to 6.33.1 - Bump Coil to 2.5.0 +- Rename `partnerParams` to `extraPartnerParams` ### Removed diff --git a/lib/src/main/java/com/smileidentity/compose/SmileIDExt.kt b/lib/src/main/java/com/smileidentity/compose/SmileIDExt.kt index 8b416988f..6d744e276 100644 --- a/lib/src/main/java/com/smileidentity/compose/SmileIDExt.kt +++ b/lib/src/main/java/com/smileidentity/compose/SmileIDExt.kt @@ -50,7 +50,7 @@ import java.net.URL * front camera will be used. * @param showAttribution Whether to show the Smile ID attribution or not on the Instructions screen * @param showInstructions Whether to deactivate capture screen's instructions for SmartSelfie. - * @param partnerParams Custom values specific to partners + * @param extraPartnerParams Custom values specific to partners * @param colorScheme The color scheme to use for the UI. This is passed in so that we show a Smile * ID branded UI by default, but allow the user to override it if they want. * @param typography The typography to use for the UI. This is passed in so that we show a Smile ID @@ -65,7 +65,7 @@ fun SmileID.SmartSelfieEnrollment( allowAgentMode: Boolean = false, showAttribution: Boolean = true, showInstructions: Boolean = true, - partnerParams: ImmutableMap = persistentMapOf(), + extraPartnerParams: ImmutableMap = persistentMapOf(), colorScheme: ColorScheme = SmileID.colorScheme, typography: Typography = SmileID.typography, onResult: SmileIDCallback = {}, @@ -79,7 +79,7 @@ fun SmileID.SmartSelfieEnrollment( allowAgentMode = allowAgentMode, showAttribution = showAttribution, showInstructions = showInstructions, - partnerParams = partnerParams, + extraPartnerParams = extraPartnerParams, onResult = onResult, ) } @@ -101,7 +101,7 @@ fun SmileID.SmartSelfieEnrollment( * front camera will be used. * @param showAttribution Whether to show the Smile ID attribution or not on the Instructions screen * @param showInstructions Whether to deactivate capture screen's instructions for SmartSelfie. - * @param partnerParams Custom values specific to partners + * @param extraPartnerParams Custom values specific to partners * @param colorScheme The color scheme to use for the UI. This is passed in so that we show a Smile * ID branded UI by default, but allow the user to override it if they want. * @param typography The typography to use for the UI. This is passed in so that we show a Smile ID @@ -116,7 +116,7 @@ fun SmileID.SmartSelfieAuthentication( allowAgentMode: Boolean = false, showAttribution: Boolean = true, showInstructions: Boolean = true, - partnerParams: ImmutableMap = persistentMapOf(), + extraPartnerParams: ImmutableMap = persistentMapOf(), colorScheme: ColorScheme = SmileID.colorScheme, typography: Typography = SmileID.typography, onResult: SmileIDCallback = {}, @@ -130,7 +130,7 @@ fun SmileID.SmartSelfieAuthentication( allowAgentMode = allowAgentMode, showAttribution = showAttribution, showInstructions = showInstructions, - partnerParams = partnerParams, + extraPartnerParams = extraPartnerParams, onResult = onResult, ) } @@ -163,7 +163,7 @@ fun SmileID.SmartSelfieAuthentication( * @param allowGalleryUpload Whether to allow the user to upload images from their gallery or not * @param showInstructions Whether to deactivate capture screen's instructions for Document * Verification (NB! If instructions are disabled, gallery upload won't be possible) - * @param partnerParams Custom values specific to partners + * @param extraPartnerParams Custom values specific to partners * @param colorScheme The color scheme to use for the UI. This is passed in so that we show a Smile * ID branded UI by default, but allow the user to override it if they want. * @param typography The typography to use for the UI. This is passed in so that we show a Smile ID @@ -184,7 +184,7 @@ fun SmileID.DocumentVerification( allowAgentMode: Boolean = false, allowGalleryUpload: Boolean = false, showInstructions: Boolean = true, - partnerParams: ImmutableMap = persistentMapOf(), + extraPartnerParams: ImmutableMap = persistentMapOf(), colorScheme: ColorScheme = SmileID.colorScheme, typography: Typography = SmileID.typography, onResult: SmileIDCallback = {}, @@ -211,7 +211,7 @@ fun SmileID.DocumentVerification( documentType = documentType, captureBothSides = captureBothSides, selfieFile = bypassSelfieCaptureWithFile, - partnerParams = partnerParams, + extraPartnerParams = extraPartnerParams, ) }, ), @@ -245,7 +245,7 @@ fun SmileID.DocumentVerification( * @param allowGalleryUpload Whether to allow the user to upload images from their gallery or not * @param showInstructions Whether to deactivate capture screen's instructions for Document * Verification (NB! If instructions are disabled, gallery upload won't be possible) - * @param partnerParams Custom values specific to partners + * @param extraPartnerParams Custom values specific to partners * @param colorScheme The color scheme to use for the UI. This is passed in so that we show a Smile * ID branded UI by default, but allow the user to override it if they want. * @param typography The typography to use for the UI. This is passed in so that we show a Smile ID @@ -265,7 +265,7 @@ fun SmileID.EnhancedDocumentVerificationScreen( allowAgentMode: Boolean = false, allowGalleryUpload: Boolean = false, showInstructions: Boolean = true, - partnerParams: ImmutableMap = persistentMapOf(), + extraPartnerParams: ImmutableMap = persistentMapOf(), colorScheme: ColorScheme = SmileID.colorScheme, typography: Typography = SmileID.typography, onResult: SmileIDCallback = {}, @@ -291,7 +291,7 @@ fun SmileID.EnhancedDocumentVerificationScreen( countryCode = countryCode, documentType = documentType, captureBothSides = captureBothSides, - partnerParams = partnerParams, + extraPartnerParams = extraPartnerParams, ) }, ), @@ -320,7 +320,7 @@ fun SmileID.EnhancedDocumentVerificationScreen( * camera will be used. * @param showAttribution Whether to show the Smile ID attribution or not on the Instructions screen * @param showInstructions Whether to deactivate capture screen's instructions for SmartSelfie. - * @param partnerParams Custom values specific to partners + * @param extraPartnerParams Custom values specific to partners * @param colorScheme The color scheme to use for the UI. This is passed in so that we show a Smile * ID branded UI by default, but allow the user to override it if they want. * @param typography The typography to use for the UI. This is passed in so that we show a Smile ID @@ -340,7 +340,7 @@ fun SmileID.BiometricKYC( allowAgentMode: Boolean = false, showAttribution: Boolean = true, showInstructions: Boolean = true, - partnerParams: ImmutableMap = persistentMapOf(), + extraPartnerParams: ImmutableMap = persistentMapOf(), colorScheme: ColorScheme = SmileID.colorScheme, typography: Typography = SmileID.typography, onResult: SmileIDCallback = {}, @@ -358,7 +358,7 @@ fun SmileID.BiometricKYC( allowAgentMode = allowAgentMode, showAttribution = showAttribution, showInstructions = showInstructions, - partnerParams = partnerParams, + extraPartnerParams = extraPartnerParams, onResult = onResult, ) } diff --git a/lib/src/main/java/com/smileidentity/compose/biometric/OrchestratedBiometricKYCScreen.kt b/lib/src/main/java/com/smileidentity/compose/biometric/OrchestratedBiometricKYCScreen.kt index f982fd719..f24510255 100644 --- a/lib/src/main/java/com/smileidentity/compose/biometric/OrchestratedBiometricKYCScreen.kt +++ b/lib/src/main/java/com/smileidentity/compose/biometric/OrchestratedBiometricKYCScreen.kt @@ -46,14 +46,14 @@ fun OrchestratedBiometricKYCScreen( allowAgentMode: Boolean = false, showAttribution: Boolean = true, showInstructions: Boolean = true, - partnerParams: ImmutableMap = persistentMapOf(), + extraPartnerParams: ImmutableMap = persistentMapOf(), viewModel: BiometricKycViewModel = viewModel( factory = viewModelFactory { BiometricKycViewModel( idInfo = idInfo, userId = userId, jobId = jobId, - partnerParams = partnerParams, + extraPartnerParams = extraPartnerParams, ) }, ), diff --git a/lib/src/main/java/com/smileidentity/compose/selfie/OrchestratedSelfieCaptureScreen.kt b/lib/src/main/java/com/smileidentity/compose/selfie/OrchestratedSelfieCaptureScreen.kt index 3ee302282..1b101436f 100644 --- a/lib/src/main/java/com/smileidentity/compose/selfie/OrchestratedSelfieCaptureScreen.kt +++ b/lib/src/main/java/com/smileidentity/compose/selfie/OrchestratedSelfieCaptureScreen.kt @@ -45,7 +45,7 @@ internal fun OrchestratedSelfieCaptureScreen( skipApiSubmission: Boolean = false, showAttribution: Boolean = true, showInstructions: Boolean = true, - partnerParams: ImmutableMap = persistentMapOf(), + extraPartnerParams: ImmutableMap = persistentMapOf(), viewModel: SelfieViewModel = viewModel( factory = viewModelFactory { SelfieViewModel( @@ -53,7 +53,7 @@ internal fun OrchestratedSelfieCaptureScreen( userId = userId, jobId = jobId, skipApiSubmission = skipApiSubmission, - partnerParams = partnerParams, + extraPartnerParams = extraPartnerParams, ) }, ), diff --git a/lib/src/main/java/com/smileidentity/viewmodel/BiometricKycViewModel.kt b/lib/src/main/java/com/smileidentity/viewmodel/BiometricKycViewModel.kt index dec0117a5..f09f091f2 100644 --- a/lib/src/main/java/com/smileidentity/viewmodel/BiometricKycViewModel.kt +++ b/lib/src/main/java/com/smileidentity/viewmodel/BiometricKycViewModel.kt @@ -35,7 +35,7 @@ class BiometricKycViewModel( private val idInfo: IdInfo, private val userId: String, private val jobId: String, - private val partnerParams: ImmutableMap = persistentMapOf(), + private val extraPartnerParams: ImmutableMap = persistentMapOf(), ) : ViewModel() { private val _uiState = MutableStateFlow(BiometricKycUiState()) val uiState = _uiState.asStateFlow() @@ -95,7 +95,7 @@ class BiometricKycViewModel( val authResponse = SmileID.api.authenticate(authRequest) val prepUploadRequest = PrepUploadRequest( - partnerParams = authResponse.partnerParams.copy(extras = partnerParams), + partnerParams = authResponse.partnerParams.copy(extras = extraPartnerParams), signature = authResponse.signature, timestamp = authResponse.timestamp, ) diff --git a/lib/src/main/java/com/smileidentity/viewmodel/SelfieViewModel.kt b/lib/src/main/java/com/smileidentity/viewmodel/SelfieViewModel.kt index ba546b82d..9096a5d60 100644 --- a/lib/src/main/java/com/smileidentity/viewmodel/SelfieViewModel.kt +++ b/lib/src/main/java/com/smileidentity/viewmodel/SelfieViewModel.kt @@ -82,7 +82,7 @@ class SelfieViewModel( private val userId: String, private val jobId: String, private val skipApiSubmission: Boolean, - private val partnerParams: ImmutableMap = persistentMapOf(), + private val extraPartnerParams: ImmutableMap = persistentMapOf(), ) : ViewModel() { private val _uiState = MutableStateFlow(SelfieUiState()) @@ -277,7 +277,7 @@ class SelfieViewModel( val authResponse = SmileID.api.authenticate(authRequest) val prepUploadRequest = PrepUploadRequest( - partnerParams = authResponse.partnerParams.copy(extras = partnerParams), + partnerParams = authResponse.partnerParams.copy(extras = extraPartnerParams), signature = authResponse.signature, timestamp = authResponse.timestamp, ) diff --git a/lib/src/main/java/com/smileidentity/viewmodel/document/OrchestratedDocumentViewModel.kt b/lib/src/main/java/com/smileidentity/viewmodel/document/OrchestratedDocumentViewModel.kt index 338f55cd9..df2c74461 100644 --- a/lib/src/main/java/com/smileidentity/viewmodel/document/OrchestratedDocumentViewModel.kt +++ b/lib/src/main/java/com/smileidentity/viewmodel/document/OrchestratedDocumentViewModel.kt @@ -50,7 +50,7 @@ internal abstract class OrchestratedDocumentViewModel( private val documentType: String? = null, private val captureBothSides: Boolean, private var selfieFile: File? = null, - private var partnerParams: ImmutableMap = persistentMapOf(), + private var extraPartnerParams: ImmutableMap = persistentMapOf(), ) : ViewModel() { private val _uiState = MutableStateFlow(OrchestratedDocumentUiState()) val uiState = _uiState.asStateFlow() @@ -128,7 +128,7 @@ internal abstract class OrchestratedDocumentViewModel( val authResponse = SmileID.api.authenticate(authRequest) val prepUploadRequest = PrepUploadRequest( - partnerParams = authResponse.partnerParams.copy(extras = partnerParams), + partnerParams = authResponse.partnerParams.copy(extras = extraPartnerParams), signature = authResponse.signature, timestamp = authResponse.timestamp, ) @@ -216,7 +216,7 @@ internal class DocumentVerificationViewModel( documentType: String? = null, captureBothSides: Boolean, selfieFile: File? = null, - partnerParams: ImmutableMap = persistentMapOf(), + extraPartnerParams: ImmutableMap = persistentMapOf(), ) : OrchestratedDocumentViewModel( jobType = jobType, userId = userId, @@ -225,7 +225,7 @@ internal class DocumentVerificationViewModel( documentType = documentType, captureBothSides = captureBothSides, selfieFile = selfieFile, - partnerParams = partnerParams, + extraPartnerParams = extraPartnerParams, ) { override fun getJobStatus( @@ -257,7 +257,7 @@ internal class EnhancedDocumentVerificationViewModel( documentType: String? = null, captureBothSides: Boolean, selfieFile: File? = null, - partnerParams: ImmutableMap = persistentMapOf(), + extraPartnerParams: ImmutableMap = persistentMapOf(), ) : OrchestratedDocumentViewModel( jobType = jobType, @@ -267,7 +267,7 @@ internal class EnhancedDocumentVerificationViewModel( documentType = documentType, captureBothSides = captureBothSides, selfieFile = selfieFile, - partnerParams = partnerParams, + extraPartnerParams = extraPartnerParams, ) { override fun getJobStatus(