> ## Documentation Index
> Fetch the complete documentation index at: https://primer.io/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# provide

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.

```swift SWIFT theme={"dark"}
@available(iOS 13, *)
public func provide<PrimerHeadlessMainComponent>(paymentMethodType: String) throws -> PrimerHeadlessMainComponent? where PrimerCollectableData: Any, PrimerHeadlessStep: Any
```

## Parameters

**Parameters**

**paymentMethodType** `String` *required*

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

**Type Parameters**

**Data,Step** `PrimerHeadlessMainComponent where Data == BanksCollectableData, Step == BanksStep` *required*

The type of the `PrimerHeadlessMainComponent` implementation to
return.

**Supported types**

<table>
  <tr>
    <th>Type</th>
    <th>paymentMethodType</th>
  </tr>

  <tr>
    <td>
      [BanksComponent](https://primer.io/docs/sdk/ios/v2.x.x/primer-headless-checkout/component-with-redirect-manager/provide.md#param-banks-component)
    </td>

    <td>
      [ADYEN\_IDEAL](https://primer.io/docs/sdk/ios/v2.x.x/primer-headless-checkout/component-with-redirect-manager/provide.md)
    </td>
  </tr>
</table>

## Returns

An instance conforming to the `PrimerHeadlessMainComponent` protocol.
The `PrimerHeadlessMainComponent` protocol conforms to the `PrimerHeadlessCollectDataComponent` protocol.

**PrimerHeadlessMainComponent**

**PrimerHeadlessCollectDataComponent**

**Data** `PrimerCollectableData`

The Data associated type

**Step** `PrimerHeadlessStep`

The Step associated type

**start**

Initialize the component by calling the start function. This method should be called only once.

**submit**

Call `submit` function in order to process collected data and move component to next state.

**errorDelegate** `PrimerHeadlessErrorableDelegate`

Error delegate will be triggered every time an error is thrown in the process.

```swift SWIFT theme={"dark"}
  func didReceiveError(error: PrimerError)
```

**validationDelegate** `PrimerHeadlessValidatableDelegate`

Validation delegate will be triggered every time collected data is updated.

```swift SWIFT theme={"dark"}
  func didUpdate(validationStatus: PrimerValidationStatus, for data: PrimerCollectableData?)
```

**PrimerValidationStatus** `Enum`

`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.

**enum PrimerValidationStatus**

**validating**

Enum case representing the ongoing validation state.
This indicates that the validation process is currently in progress.

**valid**

Enum case representing a successful validation state.
This indicates that the validation process has completed successfully and the data is valid.

**invalid**

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.

**Associated Value**

**errors** `[PrimerValidationError]`

An array of `PrimerValidationError` representing the specific validation errors found.

**error**

Enum case representing an error state due to an unexpected issue.
This indicates that an unexpected error has occurred during the validation process.

**Associated Value**

**error** `PrimerError`

A `PrimerError` representing the unexpected error that occurred.

**stepDelegate** `PrimerHeadlessSteppableDelegate`

`BanksStep` is a enum class holding different output data for
specific steps. Whenever [submit](#param-submit)&#x20;
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&#x20;
`BanksStep`

**enum BanksStep**

**loading**

Enum member representing the step of loading data for the form redirect component.

**banksRetrieved(banks: \[IssuingBank])**

Enum member representing the step of issuing banks retrieved.

**Properties**

**banks** `[IssuingBank]`

The issuing banks array associated with this payment flow.

**IssuingBank**

The `IssuingBank` class provides properties to hold bank details.

**Properties**

**id** `String`

The string bank id

**name** `String`

The bank name string

**iconUrlStr** `String`

The bank icon url string

**isDisabled** `String`

Boolean indicating whether the bank is disabled

```swift SWIFT theme={"dark"}
  func didReceiveStep(step: PrimerHeadlessStep)
```

**updateCollectedData(collectableData: Data)**

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](#param-validation-delegate).

In case of ADYEN\_IDEAL, the Data will be of type `BanksCollectableData`

**enum BanksCollectableData**

**bankId**

Enum member representing the bank id.

**Properties**

**bankId** `String`

The string bank id

**bankFilterText** `String`

Enum member representing the text used for filtering the list of banks by name.

**Properties**

**text**

The text used for filtering the list of banks by name.

**Supported types**

**BanksComponent** `PrimerHeadlessMainComponent\<BanksCollectableData, BanksStep\>`

The `BanksComponent` provides a protocol extending the `PrimerHeadlessMainComponent` protocol where Data is of  type `BanksCollectableData` and Step is of type `BanksStep`

```swift SWIFT theme={"dark"}
public protocol BanksComponent: PrimerHeadlessMainComponent where Data == BanksCollectableData, Step == BanksStep { }
```

## Throws

**Throws**

**unsupportedPaymentMethod**

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:

<ul>
  <li>ADYEN\_IDEAL</li>
</ul>

**genericError**

An error that will be thrown in case the provide method fails because of sdk not correctly used.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.