KlarnaOnDemand Class
Manages application-wide settings and allows access to the SDK's views.
Item Index
Methods
openPreferencesView
-
userToken
-
onError
-
[locale='en']
Presents the preferences view in an iframe that covers the entirety of the current document.
Parameters:
-
userToken
StringThe token of the user whose preferences are to be changed.
-
onError
FunctionA callback that will be activated if an error occurs while setting the user's preferences. This callback will be passed an error code related to the error. This code should not be presented to the user and is mainly for debugging purposes.
-
[locale='en']
String optionalThe locale in which to present the view, in ISO 639-1 form.
openRegistrationView
-
onSuccess
-
onError
-
[confirmedUserDataId=null]
-
[locale='en']
Presents the registration view in an iframe that covers the entirety of the current document.
Parameters:
-
onSuccess
FunctionA callback that will be activated upon successful registration. This callback will be passed the user token received during the registration process.
-
onError
FunctionA callback that will be activated if an error occurs during registration. This callback will be passed an error code related to the error. This code should not be presented to the user and is mainly for debugging purposes.
-
[confirmedUserDataId=null]
String optionalID for pre-confirmed user data that allows the registration view to already know the user's identity without requesting a phone number.
-
[locale='en']
String optionalThe locale in which to present the view, in ISO 639-1 form.
setApiKey
-
apiKey
Sets the API key to use in following calls.
Parameters:
-
apiKey
StringMerchant’s public API key for this application.