Skip to content

Commit

Permalink
Rename partnerParams to extraPartnerParams (#260)
Browse files Browse the repository at this point in the history
* renamed partnerParams to extraPartnerParams

* updated CHANGELOG.md
  • Loading branch information
jumaallan authored Nov 16, 2023
1 parent 486c9ec commit 5f695e5
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 29 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
30 changes: 15 additions & 15 deletions lib/src/main/java/com/smileidentity/compose/SmileIDExt.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -65,7 +65,7 @@ fun SmileID.SmartSelfieEnrollment(
allowAgentMode: Boolean = false,
showAttribution: Boolean = true,
showInstructions: Boolean = true,
partnerParams: ImmutableMap<String, String> = persistentMapOf(),
extraPartnerParams: ImmutableMap<String, String> = persistentMapOf(),
colorScheme: ColorScheme = SmileID.colorScheme,
typography: Typography = SmileID.typography,
onResult: SmileIDCallback<SmartSelfieResult> = {},
Expand All @@ -79,7 +79,7 @@ fun SmileID.SmartSelfieEnrollment(
allowAgentMode = allowAgentMode,
showAttribution = showAttribution,
showInstructions = showInstructions,
partnerParams = partnerParams,
extraPartnerParams = extraPartnerParams,
onResult = onResult,
)
}
Expand All @@ -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
Expand All @@ -116,7 +116,7 @@ fun SmileID.SmartSelfieAuthentication(
allowAgentMode: Boolean = false,
showAttribution: Boolean = true,
showInstructions: Boolean = true,
partnerParams: ImmutableMap<String, String> = persistentMapOf(),
extraPartnerParams: ImmutableMap<String, String> = persistentMapOf(),
colorScheme: ColorScheme = SmileID.colorScheme,
typography: Typography = SmileID.typography,
onResult: SmileIDCallback<SmartSelfieResult> = {},
Expand All @@ -130,7 +130,7 @@ fun SmileID.SmartSelfieAuthentication(
allowAgentMode = allowAgentMode,
showAttribution = showAttribution,
showInstructions = showInstructions,
partnerParams = partnerParams,
extraPartnerParams = extraPartnerParams,
onResult = onResult,
)
}
Expand Down Expand Up @@ -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
Expand All @@ -184,7 +184,7 @@ fun SmileID.DocumentVerification(
allowAgentMode: Boolean = false,
allowGalleryUpload: Boolean = false,
showInstructions: Boolean = true,
partnerParams: ImmutableMap<String, String> = persistentMapOf(),
extraPartnerParams: ImmutableMap<String, String> = persistentMapOf(),
colorScheme: ColorScheme = SmileID.colorScheme,
typography: Typography = SmileID.typography,
onResult: SmileIDCallback<DocumentVerificationResult> = {},
Expand All @@ -211,7 +211,7 @@ fun SmileID.DocumentVerification(
documentType = documentType,
captureBothSides = captureBothSides,
selfieFile = bypassSelfieCaptureWithFile,
partnerParams = partnerParams,
extraPartnerParams = extraPartnerParams,
)
},
),
Expand Down Expand Up @@ -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
Expand All @@ -265,7 +265,7 @@ fun SmileID.EnhancedDocumentVerificationScreen(
allowAgentMode: Boolean = false,
allowGalleryUpload: Boolean = false,
showInstructions: Boolean = true,
partnerParams: ImmutableMap<String, String> = persistentMapOf(),
extraPartnerParams: ImmutableMap<String, String> = persistentMapOf(),
colorScheme: ColorScheme = SmileID.colorScheme,
typography: Typography = SmileID.typography,
onResult: SmileIDCallback<EnhancedDocumentVerificationResult> = {},
Expand All @@ -291,7 +291,7 @@ fun SmileID.EnhancedDocumentVerificationScreen(
countryCode = countryCode,
documentType = documentType,
captureBothSides = captureBothSides,
partnerParams = partnerParams,
extraPartnerParams = extraPartnerParams,
)
},
),
Expand Down Expand Up @@ -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
Expand All @@ -340,7 +340,7 @@ fun SmileID.BiometricKYC(
allowAgentMode: Boolean = false,
showAttribution: Boolean = true,
showInstructions: Boolean = true,
partnerParams: ImmutableMap<String, String> = persistentMapOf(),
extraPartnerParams: ImmutableMap<String, String> = persistentMapOf(),
colorScheme: ColorScheme = SmileID.colorScheme,
typography: Typography = SmileID.typography,
onResult: SmileIDCallback<BiometricKycResult> = {},
Expand All @@ -358,7 +358,7 @@ fun SmileID.BiometricKYC(
allowAgentMode = allowAgentMode,
showAttribution = showAttribution,
showInstructions = showInstructions,
partnerParams = partnerParams,
extraPartnerParams = extraPartnerParams,
onResult = onResult,
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,14 @@ fun OrchestratedBiometricKYCScreen(
allowAgentMode: Boolean = false,
showAttribution: Boolean = true,
showInstructions: Boolean = true,
partnerParams: ImmutableMap<String, String> = persistentMapOf(),
extraPartnerParams: ImmutableMap<String, String> = persistentMapOf(),
viewModel: BiometricKycViewModel = viewModel(
factory = viewModelFactory {
BiometricKycViewModel(
idInfo = idInfo,
userId = userId,
jobId = jobId,
partnerParams = partnerParams,
extraPartnerParams = extraPartnerParams,
)
},
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,15 @@ internal fun OrchestratedSelfieCaptureScreen(
skipApiSubmission: Boolean = false,
showAttribution: Boolean = true,
showInstructions: Boolean = true,
partnerParams: ImmutableMap<String, String> = persistentMapOf(),
extraPartnerParams: ImmutableMap<String, String> = persistentMapOf(),
viewModel: SelfieViewModel = viewModel(
factory = viewModelFactory {
SelfieViewModel(
isEnroll = isEnroll,
userId = userId,
jobId = jobId,
skipApiSubmission = skipApiSubmission,
partnerParams = partnerParams,
extraPartnerParams = extraPartnerParams,
)
},
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class BiometricKycViewModel(
private val idInfo: IdInfo,
private val userId: String,
private val jobId: String,
private val partnerParams: ImmutableMap<String, String> = persistentMapOf(),
private val extraPartnerParams: ImmutableMap<String, String> = persistentMapOf(),
) : ViewModel() {
private val _uiState = MutableStateFlow(BiometricKycUiState())
val uiState = _uiState.asStateFlow()
Expand Down Expand Up @@ -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,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ class SelfieViewModel(
private val userId: String,
private val jobId: String,
private val skipApiSubmission: Boolean,
private val partnerParams: ImmutableMap<String, String> = persistentMapOf(),
private val extraPartnerParams: ImmutableMap<String, String> = persistentMapOf(),
) : ViewModel() {
private val _uiState = MutableStateFlow(SelfieUiState())

Expand Down Expand Up @@ -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,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ internal abstract class OrchestratedDocumentViewModel<T : Parcelable>(
private val documentType: String? = null,
private val captureBothSides: Boolean,
private var selfieFile: File? = null,
private var partnerParams: ImmutableMap<String, String> = persistentMapOf(),
private var extraPartnerParams: ImmutableMap<String, String> = persistentMapOf(),
) : ViewModel() {
private val _uiState = MutableStateFlow(OrchestratedDocumentUiState())
val uiState = _uiState.asStateFlow()
Expand Down Expand Up @@ -128,7 +128,7 @@ internal abstract class OrchestratedDocumentViewModel<T : Parcelable>(
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,
)
Expand Down Expand Up @@ -216,7 +216,7 @@ internal class DocumentVerificationViewModel(
documentType: String? = null,
captureBothSides: Boolean,
selfieFile: File? = null,
partnerParams: ImmutableMap<String, String> = persistentMapOf(),
extraPartnerParams: ImmutableMap<String, String> = persistentMapOf(),
) : OrchestratedDocumentViewModel<DocumentVerificationResult>(
jobType = jobType,
userId = userId,
Expand All @@ -225,7 +225,7 @@ internal class DocumentVerificationViewModel(
documentType = documentType,
captureBothSides = captureBothSides,
selfieFile = selfieFile,
partnerParams = partnerParams,
extraPartnerParams = extraPartnerParams,
) {

override fun getJobStatus(
Expand Down Expand Up @@ -257,7 +257,7 @@ internal class EnhancedDocumentVerificationViewModel(
documentType: String? = null,
captureBothSides: Boolean,
selfieFile: File? = null,
partnerParams: ImmutableMap<String, String> = persistentMapOf(),
extraPartnerParams: ImmutableMap<String, String> = persistentMapOf(),
) :
OrchestratedDocumentViewModel<EnhancedDocumentVerificationResult>(
jobType = jobType,
Expand All @@ -267,7 +267,7 @@ internal class EnhancedDocumentVerificationViewModel(
documentType = documentType,
captureBothSides = captureBothSides,
selfieFile = selfieFile,
partnerParams = partnerParams,
extraPartnerParams = extraPartnerParams,
) {

override fun getJobStatus(
Expand Down

0 comments on commit 5f695e5

Please sign in to comment.