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

# provideComponent

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 <code>provideComponent</code> is compatible with Objective-C.

```swift SWIFT theme={"dark"}
@objc public func provideComponent(paymentMethodType: String) -> PrimerHeadlessBanksComponentWrapper
```

## Parameters

<Expandable title="Parameters" defaultOpen>
  <ResponseField name="paymentMethodType" type="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.
  </ResponseField>
</Expandable>

## Returns

An instance of type `PrimerHeadlessBanksComponentWrapper`.
The `PrimerHeadlessBanksComponentWrapper` conforms to `PrimerHeadlessBanksComponentWrapperDelegate`.

```swift SWIFT theme={"dark"}
@objc public final class PrimerHeadlessBanksComponentWrapper: NSObject, PrimerHeadlessBanksComponentWrapperDelegate
```

<Expandable title="PrimerHeadlessBanksComponentWrapper" defaultOpen>
  <Expandable title="PrimerHeadlessBanksComponentWrapperDelegate" defaultOpen>
    <ResponseField name="start">
      Initialize the component by calling the start function. This method should be called only once.
    </ResponseField>

    <ResponseField name="submit">
      Call `submit` function in order to process collected data and move component to next state.
    </ResponseField>

    <ResponseField name="selectBankById" type="selectBankById(_ bankdId: String)">
      Instance method to use in order to select a bank by id.

      ```swift SWIFT theme={"dark"}
        @objc func selectBankById(_ bankdId: String)
      ```
    </ResponseField>

    <ResponseField name="filterBankByName" type="filterBankByName(_ text: String)">
      Instance method to use in order to filter a bank by name.

      ```swift SWIFT theme={"dark"}
        @objc func filterBankByName(_ text: String)
      ```
    </ResponseField>

    <ResponseField name="errorDelegate" type="BanksComponentErrorable">
      Error delegate will be triggered every time an error is thrown in the process.

      ```swift theme={"dark"}
        @objc func didReceiveError(_ error: NSError)
      ```
    </ResponseField>

    <ResponseField name="stepDelegate" type="BanksComponentSteppable">
      <p>
        <code>BanksComponentSteppable</code> is a protocol that processes different
        output data for specific steps. Whenever{" "}
        <span><a href="#param-submit">submit</a></span> method is called,{" "}
        <code>stepDelegate</code> will trigger the next step in case the call to the
        mentioned method was successful.
      </p>

      <p>
        This is provided for the payment method type ADYEN\_IDEAL and Objective-C
        backward compatibility.
      </p>

      <ResponseField name="didStartLoading">
        Protocol method notifying of banks loading.
      </ResponseField>

      <ResponseField name="didReceiveBanks(banks: [IssuingBank])">
        Protocol method processing issuing banks retrieved.

        <Expandable title="Properties" defaultOpen>
          <ResponseField name="banks" type="[IssuingBank]">
            The issuing banks array associated with this payment flow.
          </ResponseField>
        </Expandable>
      </ResponseField>

      ```swift SWIFT theme={"dark"}
      @objc func didStartLoading()
      @objc func didReceiveBanks(_ banks: [IssuingBank])
      ```
    </ResponseField>
  </Expandable>
</Expandable>

## Throws

<Expandable title="Throws" defaultOpen>
  <ResponseField name="unsupportedPaymentMethod">
    An error that will be thrown in case the provide method has been called using unsupported `paymentMethodType`.

    <p>
      Supported payment methods for current client session are returned in the `onAvailablePaymentMethodsLoaded` delegate.
    </p>

    Currently, the supported payment method types are:

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

  <ResponseField name="genericError">
    An error that will be thrown in case the provide method fails because of sdk not correctly used.
  </ResponseField>
</Expandable>
