Skip to content

Latest commit

 

History

History
75 lines (50 loc) · 1.62 KB

klarnav2paymentinitializeoptions.md

File metadata and controls

75 lines (50 loc) · 1.62 KB

@bigcommerce/checkout-sdkKlarnaV2PaymentInitializeOptions

Interface: KlarnaV2PaymentInitializeOptions

A set of options that are required to initialize the KlarnaV2 payment method.

When KlarnaV2 is initialized, a list of payment options will be displayed for the customer to choose from. Each one with its own widget.

<!-- This is where the widget will be inserted -->
<div id="container"></div>
service.initializePayment({
    methodId: 'klarnav2',
    klarnav2: {
        container: 'container'
    },
});

An additional event callback can be registered.

service.initializePayment({
    methodId: 'klarnav2',
    klarnav2: {
        container: 'container',
        onLoad(response) {
            console.log(response);
        },
    },
});

Hierarchy

  • KlarnaV2PaymentInitializeOptions

Index

Properties

Methods

Properties

container

container: string

The ID of a container which the payment widget should insert into.

Methods

Optional onLoad

onLoad(response: KlarnaLoadResponse_2): void

A callback that gets called when the widget is loaded and ready to be interacted with.

Parameters:

Name Type Description
response KlarnaLoadResponse_2 The result of the initialization. It indicates whether or not the widget is loaded successfully.

Returns: void