1
configure(options: HeadlessUniversalCheckoutOptions): void
ts
copy
Configure the Headless Checkout instance with the provided options.
Parameters
optionsobject
Options for a Headless Universal Checkout, its properties can be defined to configure the checkout experience.Callbacks
onAvailablePaymentMethodsLoad(paymentMethods: PaymentMethodInfo[]) => voidRequired
Called when the available payment methods have been loaded. Takes an array of objects as its argument.PaymentMethodInfo
typePaymentMethodTypeRequired
The type of payment method, one of PaymentMethodType.
managerType"CARD" | "NATIVE" | "REDIRECT"Required
The type of payment manager to use.Properties
containerstring | ElementRequired
A CSS selector or an element where the UI will be mounted.localestring
Specifies the locale to use for the checkout experience. See list of ISO 639 codes.
styleCheckoutStyle
Define the styling for the checkout experience.sceneobject
Options for customizing the transition animations between payment form scenes.Properties
onEntering(sceneId: string) => void
Called when entering a new scene. The function is passed the ID of the new scene as an argument.transitionobject | false
errorMessageobject
Options for customizing the display of error messages.Properties
disabledboolean
Whether error messages should be disabled.Callbacks
onErrorMessageShow(message: string) => void
Called when an error message is shown. The function is passed the error message as an argument.onErrorMessageHide() => void
Called when an error message is hidden.formobject
Options for customizing the form fields.Properties
inputLabelsVisibleboolean
Whether the labels for form inputs should be visible.submitButtonobject
Options for configuring the submit button.Properties
amountVisibleboolean
Whether to show the amount on the submit button.useBuiltInButtonboolean
Whether to use the built-in submit button.Callbacks
onVisible(isVisible: boolean, context: Context) => void
Called whenever the visibility of the submit button changes.contextobject
currentSceneIdstring
previousSceneIdstring
onContentChange(content: string, context: Context) => void
Called whenever the content of the submit button changes.contextobject
currentSceneIdstring
onDisable(isDisabled: boolean, context: Context) => void
Called whenever the disable state of the submit button changes.contextobject
currentSceneIdstring
onLoading(isLoading: boolean, context: Context) => void
Called whenever the loading state of the submit button changes.contextobject
currentSceneIdstring
processingIndicatorobject
A configuration object for the processing indicator.Properties
visibleboolean
Whether the processing indicator should be visible or not.allowedCardNetworksCardNetwork[]
Allowed card networks for credit card payments, one of CardNetwork.