KlarnaComponent
to manage payments for Klarna.
public func provideKlarnaComponent(with intent: PrimerSessionIntent) throws -> (any KlarnaComponent)? { }
Hide Parameters
KlarnaComponent
.
Hide KlarnaComponent
Show enum KlarnaCollectableData
Hide Properties
Show child attributes
Show Properties
Show enum KlarnaStep
clientToken
string, which is used for validation purposes and paymentCategories
of type KlarnaPaymentCategory
, representing the available payment options for the user.Hide Properties
Show child attributes
Show Properties
height
parameter specifies the new height of the view.view
parameter represents the klarna view.authToken
string for subsequent operations that require authorization and checkoutData
for showing the checkout results, after the merchant finishes the payment.authToken
string for subsequent operations that require authorization and checkoutData
for showing the checkout results, after the merchant finishes the payment.submit
function in order to process collected data and move component to next state. func didReceiveError(error: PrimerError)
func didUpdate(validationStatus: PrimerValidationStatus, for data: PrimerCollectableData?)
PrimerValidationStatus
is an enum that represents the different validation statuses in the Primer SDK. It helps to communicate the state of validation for a particular process, providing clear categorization of validation states.Hide enum PrimerValidationStatus
Hide Associated Value
PrimerValidationError
representing the specific validation errors found.Whenever start or submit methods are
called, stepDelegate
will trigger the next step in case the call to the mentioned method was successful.
In the case of KLARNA, the steps will be of type KlarnaStep
.
KlarnaStep
is an enum holding different output data for specific steps.
Show enum KlarnaStep
clientToken
string, which is used for validation purposes and paymentCategories
of type KlarnaPaymentCategory
, representing the available payment options for the user.Hide Properties
Show child attributes
Show Properties
height
parameter specifies the new height of the view.view
parameter represents the klarna view.authToken
string for subsequent operations that require authorization and checkoutData
for showing the checkout results, after the merchant finishes the payment.authToken
string for subsequent operations that require authorization and checkoutData
for showing the checkout results, after the merchant finishes the payment. func didReceiveStep(step: KlarnaStep)
KlarnaCollectableData
.Show enum KlarnaCollectableData
Hide Properties
Show child attributes
Show Properties
func updateCollectedData(collectableData: KlarnaCollectableData)
do {
manager = PrimerHeadlessUniversalCheckout.KlarnaManager()
klarnaComponent = try manager.provideKlarnaComponent(with: sessionIntent)
} catch {
// Catch errors here
}