Initialization

enum class GoPayEnterpriseEnvironment {
    STAGING, PRODUCTION
}

enum class GoPayEnterpriseLocale {
    id, en
}

@Parcelize
data class GoPayEnterpriseConfiguration(
    val clientID: String,
    val environment: GoPayEnterpriseEnvironment,
    val enableDebugLogs: Boolean = false,
    val additionalData: Map<String, String>? = null,
    val locale: GoPayEnterpriseLocale,
) : Parcelable

data class GoPayEnterpriseError(
    val code: String,
    val message: String,
    val title: String
)

interface GoPayEnterpriseCallbackDelegate {
    fun onDismiss()
    fun onFailure(error: GoPayEnterpriseError)
}

object GoPayEnterpriseFactory {
    fun createEnterpriseSdk(
        context: Context,
        configuration: GoPayEnterpriseConfiguration,
        callbackDelegate: GoPayEnterpriseCallbackDelegate
    ): GoPayEnterpriseSdk
}

interface GoPayEnterpriseSdk {
    fun getFeatureManager(): FeatureManager
    fun getKycManager(): KycManager
    fun logout()
}

Specifications

Enterprise Factory

object GoPayEnterpriseFactory {
    fun createEnterpriseSdk(
        context: Context,
        configuration: GoPayEnterpriseConfiguration,
        callbackDelegate: GoPayEnterpriseCallbackDelegate,
    ): GoPayEnterpriseSdk
}

Description

Initializes the GoPay Enterprise SDK with the provided configuration and sets up a delegate to receive SDK events and responses.

Parameters

ParameterTypeDescription
contextContextAndroid application or activity context used for SDK initialization.
configurationGoPayEnterpriseConfigurationThe SDK configuration object contains clientID, environment, debug log settings, locale, and optional additionalData.
callbackDelegateGoPayEnterpriseCallbackDelegateAn object conforming to the GoPayEnterpriseCallbackDelegate protocol, used to receive dismissal callback, and any top-level errors [eg. initialization failure] from the SDK.

Return Value

Returns a GoPayEnterpriseSdk instance. Store this instance; it is the entry point for all subsequent SDK operations.

Usage Notes

  • Must be called once before invoking any other SDK method.
  • If initialization fails (e.g. invalid clientID or configuration), callbackDelegate.onFailure will be triggered with a GoPayEnterpriseError.
  • Ensure enableDebugLogs is set to false in production to avoid exposing sensitive information.
  • The returned GoPayEnterpriseSdk instance is not thread-safe; access it from a single thread (typically the main thread).

Example Usage

val configuration = GoPayEnterpriseConfiguration(
    clientID = "YOUR_CLIENT_ID",
    environment = GoPayEnterpriseEnvironment.STAGING,
    enableDebugLogs = true,
    locale = GoPayEnterpriseLocale.en,
)

val sdk = GoPayEnterpriseFactory.createEnterpriseSdk(
    context = applicationContext,
    configuration = configuration,
    callbackDelegate = object : GoPayEnterpriseCallbackDelegate {
        override fun onDismiss() {
            // Handle SDK dismissal
        }
        override fun onFailure(error: GoPayEnterpriseError) {
            // Handle initialization or runtime failure
        }
    }
)

Field Reference

GoPayEnterpriseConfiguration

An object containing configuration parameters required to initialize the GoPay Enterprise SDK

ParametersTypeDescription
clientIDStringUnique identifier provided by GoPay as part of the SDK integration.
environmentGoPayEnterpriseEnvironmentEnum value that determines the environment (STAGING or PRODUCTION) where the SDK should operate.
enableDebugLogsBooleanEnables or disables debug logging. Always set to false in production.
localeGoPayEnterpriseLocaleSets the display language of SDK UI. Supported values: GoPayEnterpriseLocale.en (English), GoPayEnterpriseLocale.id (Bahasa Indonesia).
additionalDataMap<String, String>?Optional. Key-value pairs forwarded to the backend for validations or security enhancements. Pass null if not required.

GoPayEnterpriseCallbackDelegate

A protocol/interface that must be implemented by the integrating application to receive SDK lifecycle and error callbacks.

Interface functionFunction description
onDismiss()Whenever the SDK gets closed or removed, this will get called.
onFailure()When we are unable to launch the feature we will send this callback, with the respective GoPayEnterpriseError.

GoPayEnterpriseError

Represents an error returned by the SDK.

Field nameTypeDescription
codeStringEnterprise Error constant specifying the exact error being observed during initialization etc.
messageStringLocalized Error message
titleStringLocalized Error Title

GoPayEnterpriseError.code

For a complete list of error codes and their meanings, see the Error Codes Reference.

GoPayEnterpriseSDK

GoPayEnterpriseSdk provides entry points for launching GoPay features, KYC verification, and session management in partner Android apps.


Function NameFunction Description
getFeatureManagerReturns a FeatureManager instance for launching the verify flow.
getKycManagerReturns a KycManager instance exposing KTP scan, selfie liveness, selfie verification, and full KYC verification flows.
logoutLogs out the current session and clears cached credential state.

logout

Clears any cached credential state from the SDK.

Parameters: None

Return Value: None

Usage Notes:

  • Call when the user signs out of your application or when session invalidation is required.
  • After calling logout(), you must re-initialize the SDK before making further calls.
sdk.logout()