Configure Universal Checkout using this method. Based on the use case, set different settings that can be passed to Universal Checkout. Set the Primer Checkout listener in order to receive different events from the SDK. Please refer to the section below for more information.

KOTLIN
fun configure(
    settings: PrimerSettings? = null,
    listener: PrimerCheckoutListener? = null,
)

Parameters

Example

KOTLIN
val listener = object : PrimerCheckoutListener {
  override fun onCheckoutCompleted(checkoutData: PrimerCheckoutData) {

  }
}

val settings = PrimerSettings(
  paymentHandling = PrimerPaymentHandling.AUTO,
  paymentMethodOptions = PrimerPaymentMethodOptions(
    redirectScheme = "deeplink_scheme",
    klarnaOptions = PrimerKlarnaOptions("RECURRING_PAYMENT_DESCRIPTION"),
    googlePayOptions = PrimerGooglePayOptions(captureBillingAddress = true),
  ),
  uiOptions = PrimerUIOptions(
    isInitScreenEnabled = true,
    isSuccessScreenEnabled = true,
    isErrorScreenEnabled = true,
  ),
  debugOptions = PrimerDebugOptions(is3DSSanityCheckEnabled = false),
  threeDsOptions = PrimerThreeDsOptions("APP_LINK")
)

Primer.instance.configure(settings, listener)