iOS SDK
- Installation
- Primer
- PrimerHeadlessUniversalCheckout
- Properties
- Methods
- Delegates
- Assets manager
- Native UI manager
- Raw data manager
- Raw data manager delegate
- NOL pay manager
- Component with redirect manager
- Klarna headless manager
- ACH headless manager
- Vault manager
- Common objects
After creating an instance of the PrimerHeadlessUniversalCheckout.ComponentWithRedirectManager
you must use one of the compatible provide methods
which will provide the component that can be used to build the flow.
The method provide is compatible with iOS 13 and above.
@available(iOS 13, *)
public func provide<PrimerHeadlessMainComponent>(paymentMethodType: String) throws -> PrimerHeadlessMainComponent? where PrimerCollectableData: Any, PrimerHeadlessStep: Any
Parameters
Hide Parameters
Hide Parameters
A unique string identifier for the payment method. Supported payment methods for current client session are returned in primerHeadlessUniversalCheckoutDidLoadAvailablePaymentMethods
.
For Component with redirect manager, the supported payment method is ADYEN_IDEAL.
Type parameters
Hide Type Parameters
Hide Type Parameters
The type of the PrimerHeadlessMainComponent
implementation to
return.
Hide Supported types
Hide Supported types
Type | paymentMethodType |
---|---|
BanksComponent | ADYEN_IDEAL |
Returns
An instance conforming to the PrimerHeadlessMainComponent
protocol.
The PrimerHeadlessMainComponent
protocol conforms to the PrimerHeadlessCollectDataComponent
protocol.
Hide PrimerHeadlessMainComponent
Hide PrimerHeadlessMainComponent
Hide PrimerHeadlessCollectDataComponent
Hide PrimerHeadlessCollectDataComponent
The Data associated type
The Step associated type
Initialize the component by calling the start function. This method should be called only once.
Call submit
function in order to process collected data and move component to next state.
Error delegate will be triggered every time an error is thrown in the process.
func didReceiveError(error: PrimerError)
Validation delegate will be triggered every time collected data is updated.
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 enum PrimerValidationStatus
Enum case representing the ongoing validation state. This indicates that the validation process is currently in progress.
Enum case representing a successful validation state. This indicates that the validation process has completed successfully and the data is valid.
Enum case representing an unsuccessful validation state due to validation errors. This indicates that the validation process has completed but has found one or more errors in the data.
Hide Associated Value
Hide Associated Value
An array of PrimerValidationError
representing the specific validation errors found.
BanksStep
is a enum class holding different output data for
specific steps. Whenever submit
method is called, stepDelegate
will trigger the next step in case
the call to the mentioned method was successful.
In the case of ADYEN_IDEAL, the steps return will be of type
BanksStep
Show enum BanksStep
Show enum BanksStep
Enum member representing the step of loading data for the form redirect component.
Enum member representing the step of issuing banks retrieved.
Hide Properties
Hide Properties
The issuing banks array associated with this payment flow.
func didReceiveStep(step: PrimerHeadlessStep)
Update component with collected data by passing an enum representing collectable data. This method can be called at any point, even if you have only partially collected data. To validate the partially collected data, you can refer to the validationDelegate.
In case of ADYEN_IDEAL, the Data will be of type BanksCollectableData
Hide Supported types
Hide Supported types
The BanksComponent
provides a protocol extending the PrimerHeadlessMainComponent
protocol where Data is of type BanksCollectableData
and Step is of type BanksStep
public protocol BanksComponent: PrimerHeadlessMainComponent where Data == BanksCollectableData, Step == BanksStep { }
Throws
Hide Throws
Hide Throws
An error that will be thrown in case the provide method has been called using unsupported paymentMethodType
.
Supported payment methods for current client session are returned in the onAvailablePaymentMethodsLoaded
delegate.
Currently, the supported payment method types are:
- ADYEN_IDEAL
An error that will be thrown in case the provide method fails because of sdk not correctly used.