Initialization - Fragment Transfer Experience
Open a specific transfer's status screen inside your own Activity as a Fragment.
Fragment Transfer Experience Initialization
The PayMitto SDK also allows you to open a specific transfer's status screen as a Fragment embedded inside your own Activity, without launching a new Activity. This mirrors openTransferDetailsScreen for hosts that prefer the Fragment integration model.
Like the standard experience, this is a two step process. First you configure the SDK, then you create the Fragment:
- Call
configureFragmentwith your PayMittoConfiguration object. This prepares the SDK internals and your authentication provider. It returns right away and does not start authentication. - Call
createTransferDetailsFragment, passing the transfer ID, then add the Fragment to yourFragmentManager. Authentication runs inside the Fragment, which shows the SDK loading view while it signs in and then opens the transfer's status screen.
PayMitto.configureFragment(
activity = this@MainActivity,
payMittoConfiguration = sdkConfiguration
)
val fragment = PayMitto.createTransferDetailsFragment(transferId = "transfer-id")
supportFragmentManager.beginTransaction()
.replace(R.id.container, fragment)
.addToBackStack(null)
.commit()
CallconfigureFragmentfirst
createTransferDetailsFragmentneeds the SDK to be configured. Always callconfigureFragmentbefore it, otherwise the SDK throws anIllegalStateException.
Edge-to-edgeWhen using the Fragment API, your Activity is responsible for calling
enableEdgeToEdge()if you want the SDK visuals to extend behind the system bars.
LocaleIn Fragment mode, display strings follow your host Activity's locale. The
localizationparameter inPayMittoConfigurationstill controls the API request language (Accept-Languageheader) and date formatting.
After process deathThe SDK internals do not survive the process being killed. When the system restores your Activity, call
configureFragmentagain before the Fragment is recreated, or detect that the SDK is not configured and route the user to a safe screen.
If you are using Jetpack ComposeDon't create the configuration object or call
PayMitto.configureFragmentandPayMitto.createTransferDetailsFragmentin the compose scope, since recompositions lead to runtime errors.Create the configuration object inside a
rememberclause or in an AndroidX ViewModel, and callconfigureFragmentbeforesetContent.
Updated 13 days ago

