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

export const parameterType = "BanksValidatableData";

export const properties = "adyen-ideal";

export const startUrl = "/sdk/react-native/2.x.x/primerHeadlessUniversalCheckout/componentWithRedirect/componentWithRedirectManagerProvide#common-api-and-available-components-common-api.start()";

export const submitUrl = "/sdk/react-native/2.x.x/primerHeadlessUniversalCheckout/componentWithRedirect/componentWithRedirectManagerProvide#common-api-and-available-components-common-api.submit()";

export const parameters = "adyen-ideal";

This method allows you get a new instance of a component implementation.

```typescript TYPESCRIPT theme={"dark"}
async provide(props: ComponentWithRedirectManagerProps): Promise<BanksComponent | any>
```

## Parameters

<Expandable title="Parameters" defaultOpen>
  <ResponseField name="props" type="ComponentWithRedirectManagerProps" required>
    Object that provides the payment menthod type and callback functions for
    handling steps, errors and validation.

    <Expandable title="Properties" 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 `onAvailablePaymentMethodLoad` callback.
      </ResponseField>

      <ResponseField name="onStep" type={`(data: BankStep) => void`}>
        Called whenever the component emits a new step. This usually happens when calling <a href={`#param-start`}>start</a> or <a href={`#param-submit`}>submit</a> or whenever the component collects data.

        <Expandable title="Parameters">
          <ResponseField name="BanksLoading">
            A type representing the loading of the bank list.

            <Expandable title="Properties">
              <ResponseField name="stepName" type="banksLoading">
                The name of this component step.
              </ResponseField>
            </Expandable>
          </ResponseField>

          <ResponseField name="BanksRetrieved">
            A type representing the list of retrieved banks.

            <Expandable title="Properties">
              <ResponseField name="stepName" type="banksRetrieved">
                The name of this component step.
              </ResponseField>

              <ResponseField name="banks" type="IssuingBank[]" required>
                <Expandable>
                  <ResponseField name="IssuingBank">
                    <Expandable title="Properties">
                      <ResponseField name="id" type="string" required>
                        The bank's identifier.
                      </ResponseField>

                      <ResponseField name="name" type="string" required>
                        The bank's name.
                      </ResponseField>

                      <ResponseField name="iconUrl" type="string" required>
                        The bank's icon url.
                      </ResponseField>

                      <ResponseField name="disabled" type="boolean" required>
                        A boolean representing the bank's state.
                      </ResponseField>
                    </Expandable>
                  </ResponseField>
                </Expandable>
              </ResponseField>
            </Expandable>
          </ResponseField>
        </Expandable>
      </ResponseField>

      <ResponseField name="onError" type="(error: PrimerError) => void">
        Called to indicate that a [PrimerError](/docs/sdk/react-native/v2.x.x/common-objects/PrimerError) occurred during the component's operation.

        <Expandable title="Parameters">
          <ResponseField name="PrimerError">
            The specific `PrimerError` that occurred during the component's operation.

            <Expandable>
              <ResponseField name="errorId" type="string" required>
                A unique error identifier.
              </ResponseField>

              <ResponseField name="errorCode" type="string">
                A unique error code.
              </ResponseField>

              <ResponseField name="description" type="string" required>
                A error description.
              </ResponseField>

              <ResponseField name="recoverySuggestion" type="string">
                A recovery suggestion for the given error. In case it's present, use it to try
                to recover from error.
              </ResponseField>

              <ResponseField name="diagnosticsId" type="string">
                A unique diagnostics id for the given error.
              </ResponseField>
            </Expandable>
          </ResponseField>
        </Expandable>
      </ResponseField>

      <ResponseField name="onInvalid" type={`(data: PrimerInvalidComponentData<${parameterType}>) => void`}>
        Called to indicate that the component data was considered invalid during validation.
        xx

        <Expandable title="Parameters">
          <ResponseField name={`PrimerInvalidComponentData<${parameterType}>`}>
            Interface that indicates that the data has been considered invalid after validation.

            <Expandable title="Properties">
              <ResponseField name="data" type={parameterType}>
                The data that failed validation.

                <Expandable>
                  <ResponseField name="BankId">
                    <Expandable title="Properties">
                      <ResponseField name="validatableDataName" type={props.value}>
                        The name of this component-validatable data.
                      </ResponseField>

                      <ResponseField name="id" type="string" required>
                        The id of the selected bank.
                      </ResponseField>
                    </Expandable>
                  </ResponseField>

                  <ResponseField name="BankListFilter">
                    <Expandable title="Properties">
                      <ResponseField name="validatableDataName" type={props.value}>
                        The name of this component-validatable data.
                      </ResponseField>

                      <ResponseField name="text" type="string" required>
                        The text to filter the bank list by.
                      </ResponseField>
                    </Expandable>
                  </ResponseField>
                </Expandable>
              </ResponseField>

              <ResponseField name="errors" type="PrimerValidationError[]">
                A list of `PrimerValidationError` explaining why the data is considered invalid.

                <ResponseField name="PrimerValidationError[]">
                  <Expandable>
                    <ResponseField name="PrimerValidationError">
                      <Expandable title="Properties">
                        <ResponseField name="errorId" type="string">
                          A unique error identifier.
                        </ResponseField>

                        <ResponseField name="description" type="string">
                          A error description.
                        </ResponseField>

                        <ResponseField name="diagnosticsId" type="string">
                          A unique diagnostics id for the given error.
                        </ResponseField>
                      </Expandable>
                    </ResponseField>
                  </Expandable>
                </ResponseField>
              </ResponseField>
            </Expandable>
          </ResponseField>
        </Expandable>
      </ResponseField>

      <ResponseField name="onValid" type={`(data: PrimerValidComponentData<${parameterType}>) => void`}>
        Called to indicate that the component data was successfully validated.

        <Expandable title="Parameters">
          <ResponseField name={`PrimerValidComponentData<${parameterType}>`}>
            Interface that indicates that the data has been successfully validated.

            <Expandable title="Properties">
              <ResponseField name="data" type={parameterType}>
                <Expandable>
                  <ResponseField name="BankId">
                    <Expandable title="Properties">
                      <ResponseField name="validatableDataName" type={props.value}>
                        The name of this component-validatable data.
                      </ResponseField>

                      <ResponseField name="id" type="string" required>
                        The id of the selected bank.
                      </ResponseField>
                    </Expandable>
                  </ResponseField>

                  <ResponseField name="BankListFilter">
                    <Expandable title="Properties">
                      <ResponseField name="validatableDataName" type={props.value}>
                        The name of this component-validatable data.
                      </ResponseField>

                      <ResponseField name="text" type="string" required>
                        The text to filter the bank list by.
                      </ResponseField>
                    </Expandable>
                  </ResponseField>
                </Expandable>
              </ResponseField>
            </Expandable>
          </ResponseField>
        </Expandable>
      </ResponseField>

      <ResponseField name="onValidating" type={`(data: PrimerValidatingComponentData<${parameterType}>) => void`}>
        Called to indicate that the component data is in the process of being validated.

        <Expandable title="Parameters">
          <ResponseField name={`PrimerValidatingComponentData<${parameterType}>`}>
            Interface that indicates that data is currently in the process of being validated.

            <Expandable title="Properties">
              <ResponseField name="data" type={parameterType}>
                The data being validated.

                <Expandable>
                  <ResponseField name="BankId">
                    <Expandable title="Properties">
                      <ResponseField name="validatableDataName" type={props.value}>
                        The name of this component-validatable data.
                      </ResponseField>

                      <ResponseField name="id" type="string" required>
                        The id of the selected bank.
                      </ResponseField>
                    </Expandable>
                  </ResponseField>

                  <ResponseField name="BankListFilter">
                    <Expandable title="Properties">
                      <ResponseField name="validatableDataName" type={props.value}>
                        The name of this component-validatable data.
                      </ResponseField>

                      <ResponseField name="text" type="string" required>
                        The text to filter the bank list by.
                      </ResponseField>
                    </Expandable>
                  </ResponseField>
                </Expandable>
              </ResponseField>
            </Expandable>
          </ResponseField>
        </Expandable>
      </ResponseField>

      <ResponseField name="onValidationError" type={`(data: PrimerComponentDataValidationError<${parameterType}>) => void`}>
        Called to indicated an error that occurred during component data validation.

        <Expandable title="Parameters">
          <ResponseField name={`PrimerComponentDataValidationError<${parameterType}>`}>
            Interface that represents an error that occurred during the validation process.

            <Expandable title="Properties">
              <ResponseField name="data" type={parameterType}>
                The data for which an error ocurred during validation.

                <Expandable>
                  <ResponseField name="BankId">
                    <Expandable title="Properties">
                      <ResponseField name="validatableDataName" type={props.value}>
                        The name of this component-validatable data.
                      </ResponseField>

                      <ResponseField name="id" type="string" required>
                        The id of the selected bank.
                      </ResponseField>
                    </Expandable>
                  </ResponseField>

                  <ResponseField name="BankListFilter">
                    <Expandable title="Properties">
                      <ResponseField name="validatableDataName" type={props.value}>
                        The name of this component-validatable data.
                      </ResponseField>

                      <ResponseField name="text" type="string" required>
                        The text to filter the bank list by.
                      </ResponseField>
                    </Expandable>
                  </ResponseField>
                </Expandable>
              </ResponseField>

              <ResponseField name="error" type="PrimerError">
                The `PrimerError` that ocurred during the validation attempt.

                <ResponseField name="PrimerError">
                  <Expandable title="Properties">
                    <ResponseField name="errorId" type="string" required>
                      A unique error identifier.
                    </ResponseField>

                    <ResponseField name="errorCode" type="string">
                      A unique error code.
                    </ResponseField>

                    <ResponseField name="description" type="string" required>
                      A error description.
                    </ResponseField>

                    <ResponseField name="recoverySuggestion" type="string">
                      A recovery suggestion for the given error. In case it's present, use it to try
                      to recover from error.
                    </ResponseField>

                    <ResponseField name="diagnosticsId" type="string">
                      A unique diagnostics id for the given error.
                    </ResponseField>
                  </Expandable>
                </ResponseField>
              </ResponseField>
            </Expandable>
          </ResponseField>
        </Expandable>
      </ResponseField>
    </Expandable>
  </ResponseField>
</Expandable>

## Supported payment method types

<Expandable title="Supported payment method types" defaultOpen>
  <table style={{width: "100%", borderCollapse: "collapse", borderSpacing: "0"}}>
    <tr style={{backgroundColor: "#f1f1f1", width: "100%"}}>
      <th style={{padding: "10px", textAlign: "left", width: "100%"}}>Type</th>
      <th style={{padding: "10px", textAlign: "left", width: "100%"}}>paymentMethodType</th>
    </tr>

    <tr style={{width: "100%"}}>
      <td style={{padding: "10px"}}>
        <a style={{color: "#0070f3", fontSize: "14px", textDecoration: "none", fontWeight: "500"}} href={`/docs/sdk/react-native/v2.x.x/primer-headless-checkout/component-with-redirect-manager/provide#param-banks-component`}>
          BanksComponent
        </a>
      </td>

      <td style={{padding: "10px", width: "100%"}}>
        <a style={{color: "#0070f3", fontSize: "14px", textDecoration: "none", fontWeight: "500"}} href="/docs/sdk/react-native/v2.x.x/primer-headless-checkout/component-with-redirect-manager/provide">
          ADYEN\_IDEAL
        </a>
      </td>
    </tr>
  </table>
</Expandable>

## Returns

An instance of a component, depending on the `paymentMethodType`:

<Expandable title="Common API and available components" defaultOpen>
  <Expandable title="Common API" 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>
  </Expandable>

  <Expandable title="Supported types" defaultOpen>
    <ResponseField name="BanksComponent">
      <Expandable title="API">
        <ResponseField name="handleBankChange(bankId: string)">
          Update component with the selected bank id.

          To validate the collected data, you can refer to the appropriate
          [ComponentWithRedirectManagerProps](#param-props)
          callback functions.
        </ResponseField>

        <ResponseField name="handleBankFilterChange(filter: string)">
          Update component with the given bank filter. Doing so will cause a call to [onStep](#param-on-step) with the filtered bank list.

          To validate the collected data, you can refer to the appropriate
          [ComponentWithRedirectManagerProps](#param-props)
          callback functions.
        </ResponseField>
      </Expandable>
    </ResponseField>
  </Expandable>
</Expandable>

## Example

```typescript TYPESCRIPT theme={"dark"}
// 👇 Add this
const componentWithRedirectManagerProps: ComponentWithRedirectManagerProps = {
  paymentMethodType: "ADYEN_IDEAL",
  onStep: (data: BanksStep) => {
    switch (data.stepName) {
      case "banksLoading":
        // Show loading indicator
        break;
      case "banksRetrieved":
        // Render banks
        break;
    }
  },
  onError: (error: PrimerError) => {
    // An error that occurred during the component's operation.
  },
  onInvalid: (data: PrimerInvalidComponentData<BanksValidatableData>) => {
    // Data was considered invalid during validation.
    switch (data.data.validatableDataName) {
      case "bankListFilter":
        // ...
        break;
      case "bankId":
        // ...
        break;
    }
  },
  onValid: (data: PrimerValidComponentData<BanksValidatableData>) => {
    // Data was successfully validated.
    switch (data.data.validatableDataName) {
      case "bankListFilter":
        // ...
        break;
      case "bankId":
        // ...
        break;
    }
  },
  onValidating: (data: PrimerValidatingComponentData<BanksValidatableData>) => {
    // Data is in the process of being validated.
    switch (data.data.validatableDataName) {
      case "bankListFilter":
        // ...
        break;
      case "bankId":
        // ...
        break;
    }
  },
  onValidationError: (
    data: PrimerComponentDataValidationError<BanksValidatableData>
  ) => {
    // Error occurred during data validation.
    switch (data.data.validatableDataName) {
      case "bankListFilter":
        // ...
        break;
      case "bankId":
        // ...
        break;
    }
  },
};
const componentWithRedirectManager = new ComponentWithRedirectManager();
const banksComponent: BanksComponent =
  await componentWithRedirectManager.provide(componentWithRedirectManagerProps);
```
