Optional
Readonly
paymentRequestId?: stringUnique identifier of this payment request
Readonly
state: PaymentRequestStateCurrent state of the payment request
Optional
Readonly
stateContext?: PaymentRequestStateContextContext for the current state of the payment request
Optional
Readonly
stateReason?: PaymentRequestStateReasonReason why the payment request is in its current state
Fetch the latest information from the backend, this discards any local modifications.
Initiate the Payment Request.
This triggers the consumer interactive payment flow.
Payment Request data and Payment Request options can be passed to patch the payment request before submission.
Optional
data: () => PaymentRequestData | Promise<PaymentRequestData>A context, either a purchase, a token or both. It can be a function returning a promise that resolves to a PaymentRequestData. The function returning the promise is mainly used for the case where AccountID is needed to be updated in runtime.
Optional
options: PaymentRequestOptionsPayment Request options
Prepare a Payment Request.
Equivalent to an initiate, but guarantees that the Payment Request can be updated after the consumer has gone through the payment flow. This can be used for multi-step express checkouts, or in checkout flows where it is desired to complete the Klarna flow as early as possible.
Context and Payment Request options can be passed to patch the payment request before submission.
Note that an initiate() must be called to complete the flow, if the underlying funding source requires interaction or the payment amount is substantially increased a secondary user interaction is triggered.
Optional
data: PaymentRequestData | Promise<PaymentRequestData>A payment context, either a purchase, a token or both. It can be a promise that resolves to a PaymentRequestData. The promise is mainly used for the case where AccountID is needed to be updated in runtime.
Optional
options: PaymentRequestOptionsPayment Request options
Manually submit a Payment Request to Klarna. Context and Payment Request options can be passed to patch the payment request before submission.
This is typically not needed as the payment request is automatically submitted as part of initiate/prepare.
Optional
data: PaymentRequestDataA payment context, either a purchase, a token or both
Optional
options: PaymentRequestOptionsPayment Request options
Update the payment request with the given context. This operation can only be performed when the state of the payment request is SUBMITTED
.
Optional
data: PaymentRequestData
A Payment Request represents a request for a payment. The Payment Request lifecycle is defined in PaymentRequestState.
A Payment Request is created by the integrator using
Klarna.Payment.request()
.Payment requests can be created with initial data (PurchaseContext/TokenContext, options and paymentRequestId). If a payment request is created without initial data that data is required to be provided when calling a method on the payment request (initiate, prepare, submit, patch).
The initial payment request is also passed in the click handler for buttons. In the click handler, you can modify the request and choose whether you want to initiate the request.
Example of how to programmatically create and initiate a payment request without the Klarna payment button.