Migration Guide

Library Dependency

Gradle/Maven

The package and module names were updated. So you need to change them in your build.gradle file:

from

implementation("io.github.brightwellpayments:ReadyRemitSDK:10.2.0")

to

implementation("com.paymitto.android:PayMittoSDK:11.0.0")

After you sync Gradle, your project will show build errors since the SDK core package name has changed.
This is covered in the next section.


Kotlin Imports

All imports need to be updated from com.brightwell.readyremit.* to com.paymitto.android.*.

import com.brightwell.readyremit.sdk.AccessTokenDetails
import com.brightwell.readyremit.sdk.AuthenticationResult
import com.brightwell.readyremit.sdk.Localization
import com.brightwell.readyremit.sdk.ReadyRemit
import com.brightwell.readyremit.sdk.ReadyRemitConfiguration
import com.brightwell.readyremit.sdk.ReadyRemitEnvironment
import com.brightwell.readyremit.sdk.ReadyRemitError
import com.brightwell.readyremit.sdk.ReadyRemitEvent
import com.brightwell.readyremit.sdk.ReadyRemitTransferRequest

...
import com.paymitto.android.sdk.AccessTokenDetails
import com.paymitto.android.sdk.AuthenticationResult
import com.paymitto.android.sdk.Localization
import com.paymitto.android.sdk.PayMitto
import com.paymitto.android.sdk.PayMittoConfiguration
import com.paymitto.android.sdk.PayMittoEnvironment
import com.paymitto.android.sdk.PayMittoError
import com.paymitto.android.sdk.PayMittoEvent
import com.paymitto.android.sdk.PayMittoTransferRequest

...

SDK Entry Point

The SDK entry point has also been updated. The old ReadyRemit object was replaced by PayMitto:

ReadyRemit.startSdk(
    activity = activity,
    readyRemitConfiguration = ReadyRemitConfiguration( ... )
)

to

PayMitto.startSdk(
    activity = activity,
    readyRemitConfiguration = PayMittoConfiguration( ... )
)

Note: readyRemitConfiguration is not a typo. This property will be renamed in a future release.


The Configuration object

The Configuration object has been renamed but the structure remains the same. Some of the returned objects in callbacks have been renamed as well:

fun createSdkConfig(): PayMittoConfiguration {
    return PayMittoConfiguration(
        defaultCountry = null, // CountryIso3Code.USA
        environment = PayMittoEnvironment.SANDBOX,
        fixedRemittanceServiceProvider = null, // RemittanceServiceProvider.VISA
        fixedTransferMethod = null, // allows any transfer method
        localization = Localization.enUS,
        sourceAccounts = listOf(),
        idleTimeoutInterval = 3 * 60, // measured in seconds
        appearance = "", // pass JSON value for appearance
        supportedAppearance = SupportedAppearance.Device, // adapts to light or dark mode
        authenticateIntoTheSdk = {
            withContext(Dispatchers.IO) {
                try {
                    // if success
                    withContext(Dispatchers.Main) {
                        AuthenticationResult.Success(
                            AccessTokenDetails(
                                accessToken = authResponse.token,
                                expiresIn = authResponse.expiresIn,
                                scope = authResponse.scope,
                                tokenType = authResponse.tokenType
                            )
                        )
                    }
                } catch (e: Exception) {
                    // if failure
                    withContext(Dispatchers.Main) {
                        AuthenticationResult.Error(
                            PayMittoError(
                                code = "",
                                message = e.message.orEmpty(),
                                description = e.message.orEmpty()
                            )
                        )
                    }
                }
            }
        },
        submitTransfer = { transferRequest ->
            // submits transfer
        },
        sdkEventListener = { event: PayMittoEvent ->
            // do something
        }
    )
}

For more information about the Configuration object, please visit the PayMittoConfiguration page.


Renamed Symbols

OldNew
com.brightwell.readyremit.sdk.*com.paymitto.android.sdk.*
ReadyRemitPayMitto
ReadyRemitConfigurationPayMittoConfiguration
ReadyRemitEnvironmentPayMittoEnvironment
ReadyRemitErrorPayMittoError