Create a session and start Headless Universal Checkout with its clientToken and your custom settings.

1234567
fun start(    context: Context,    clientToken: String,    settings: PrimerSettings? = null,    checkoutListener: PrimerHeadlessUniversalCheckoutListener? = null,    uiListener: PrimerHeadlessUniversalCheckoutUiListener? = null)
kotlin
copy

Parameters

contextContextRequired

Android Context of your Activity or Fragment.

clientTokenStringRequired

A client token as returned by the create client session call.

settingsPrimerSettings

⚠️ If no settings are provided, the SDK will initialize with its default settings.
Use PrimerSettings to provide different options based on your use case.

paymentHandlingPrimerPaymentHandlingDefault: PrimerPaymentHandling.AUTO

Force the payment handling in the SDK.

AUTO

By default, the SDK operates in PrimerPaymentHandling.AUTO mode. In this case the SDK is responsible for creating the payment.

MANUAL

You can use the PrimerPaymentHandling.MANUAL option in order to handle the payment creation by yourself.

localeLocale

Force the SDK locale. By default, the locale will be set to the device's locale.

paymentMethodOptionsPrimerPaymentMethodOptions

redirectSchemeString?

Sets the deeplink schema used when redirecting back from 3rd party applications to your application.

threeDsOptionsPrimerThreeDsOptions

Sets the 3DS options in the SDK.
Properties

threeDsAppRequestorUrlString?

Set the App link that's used to call your app after an out-of-band (OOB) authentication. Supported in 3D Secure protocol versions 2.2.0 and after.

googlePayOptionsPrimerGooglePayOptions

⚠️ Required when using Google Pay in your integration.
Properties

merchantNameString?

Set it the merchant name that you want to be shown on the Google Pay screen.

allowedCardNetworksList<String>Default: listOf("AMEX", "DISCOVER", "JCB", "MASTERCARD","VISA")

Sets the card networks that your application accepts.

buttonStyleGooglePayButtonStyleDefault: GooglePayButtonStyle.BLACK

Sets the style of the Google Pay button.
GooglePayButtonStyle

BLACK

Style of button to be used on light theme.

WHITE

Style of button to be used on dark theme.

captureBillingAddressBooleanDefault: false

Sets whether user's billing address should be captured from Google Pay.

klarnaOptionsPrimerKlarnaOptions

⚠️ Required when using Klarna in your integration.
Properties

recurringPaymentDescriptionString?

Set the payment description that will be shown on the Klarna screen.

webViewTitleString?Default: Klarna

⚠️ This option is Deprecated. Sets the toolbar title of the Activity displaying Klarna views.

apayaOptionsPrimerApayaOptions

⚠️ Required when using Apaya in your integration.
Properties

webViewTitleString?Default: Apaya

⚠️ This option is Deprecated. Sets the toolbar title of the Activity displaying Klarna views.

uiOptionsPrimerUIOptions

Sets the different UI options in the SDK.
Properties

isInitScreenEnabledBooleanDefault: true

Set to false to hide the loading screen before the Universal Checkout or the Vault Manager.

isSuccessScreenEnabledBooleanDefault: true

Set to false to hide the screen after a successful payment, or tokenization on the vault flow.

isErrorScreenEnabledBooleanDefault: true

Set to false to hide the error screen when an error occurs.

themePrimerTheme

Set a custom theme for Primer SDK.

debugOptionsPrimerDebugOptions

Sets the different debug options in the SDK.
Properties

is3DSSanityCheckEnabledBooleanDefault: false

Sets whether the security warnings returned when performing 3DS are ignored.

checkoutListenerPrimerHeadlessUniversalCheckoutListener

Set Primer SDK's Headless Checkout Listener and implement the required methods.

uiListenerPrimerHeadlessUniversalCheckoutUiListener

Set Primer SDK's Headless Checkout Ui Listener.