Manage Device Settings
This guide explains how to adjust the runtime configuration of the Get Smart SDK Payment Service using the SettingsRepository. You can control user experience elements such as the native transaction result pop-up and the service language.
Prerequisites
Before modifying settings, ensure that you have:
- Imported the
redsys-tpv-business-liblibrary into your project. - Successfully initialized the TPV using
InitializationRepository.initTpv(). - Obtained an instance of
SettingsRepository(via Dagger Hilt or manual instantiation).
Controlling the Transaction Result Pop-up
By default, the Get Smart SDK Payment Service may display a native pop-up message upon the completion of a transaction. You can enable or disable this behavior to rely solely on your application’s UI for feedback.
- Access the Repository: Use your instance of
SettingsRepository. - Call
updateShowTransactionResult: Pass a boolean value to the function.true: The service shows the native result message.false: The service hides the result message, allowing you to show your own.
Code Example
suspend fun configureResultUi(showNativePopup: Boolean) {
// repository is an instance of SettingsRepository
val result = settingsRepository.updateShowTransactionResult(
showTransactionResult = showNativePopup
)
if (result is RepositoryResult.Success) {
// The boolean data confirms the new state
println("✅ UI Preference Updated: Native popup is now ${if (result.data) "enabled" else "disabled"}")
} else {
println("❌ Failed to update UI preference")
}
}This setting applies to future transactions executed after the method call.
Changing the Service Language
You can update the language used by the Get Smart SDK Payment Service UI (e.g., for system messages or PIN entry screens).
- Access the Repository: Use your instance of
SettingsRepository. - Call
updateLanguage: Pass a value from theLanguageIso6391enum.
Code Example
suspend fun setServiceLanguage(lang: LanguageIso6391) {
// repository is an instance of SettingsRepository
val result = settingsRepository.updateLanguage(
language = lang
)
if (result is RepositoryResult.Success) {
println("✅ Language Updated to ${lang.name}")
} else {
println("❌ Failed to update language")
}
}Summary
- Use
updateShowTransactionResult(false)to suppress native success/failure screens. - Use
updateLanguage()to localize the service UI. - Both methods return a
RepositoryResult<Boolean>indicating success or failure.
Next Steps
- Tokenize Card Credentials: Learn how to manage tokens.
English › Documentation › Documentation › Local Processor (Spain) › Get Smart › Get Smart SDK › Device and Quality Assurance