> ## 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 collectableData = "AchUserDetailsCollectableData";

This method allows you get a new instance of `StripeAchUserDetailsComponent` to initiate Stripe ACH payments.

```kotlin KOTLIN theme={"dark"}
fun <T : PrimerHeadlessAchComponent<out PrimerCollectableData, out PrimerHeadlessStep>> provide(paymentMethodType: String): T
```

## 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 [onAvailablePaymentMethodsLoaded](/sdk/android/v2.x.x/primer-headless-checkout/listeners/PrimerHeadlessUniversalCheckoutListener#onavailablepaymentmethodsloaded) callback.
  </ResponseField>
</Expandable>

## Type parameters

<Expandable title="Type parameters" defaultOpen>
  <ResponseField name="T" type="PrimerHeadlessAchComponent<out PrimerCollectableData, out PrimerHeadlessStep>" required>
    <p>
      The type of the <code>PrimerHeadlessAchComponent</code> implementation to
      return.
    </p>

    <Expandable title="Supported 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={`#param-stripe-ach-user-details-component`}>
              StripeAchUserDetailsComponent
            </a>
          </td>

          <td style={{padding: "10px", width: "100%"}}>
            <a style={{color: "#0070f3", fontSize: "14px", textDecoration: "none", fontWeight: "500"}} href="/sdk/android/v2.x.x/primer-headless-checkout/ach-headless-manager/provide">
              STRIPE\_ACH
            </a>
          </td>
        </tr>
      </table>
    </Expandable>
  </ResponseField>
</Expandable>

## Returns

An instance of the passed generic type `T`, which could be any of the following available components:

<Expandable title="Common API and available components" defaultOpen>
  <ResponseField name="PrimerHeadlessAchComponent" type="Implemented by all components">
    <Expandable title="Common API">
      <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="componentError: Flow<PrimerError>">
        Get a [Flow](https://kotlinlang.org/api/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.flow/-flow/)
        of [PrimerError](/sdk/android/v2.x.x/common-objects/PrimerError) objects that represent errors emitted by this component.
        Subscribers can observe and handle errors using this Flow.
      </ResponseField>
    </Expandable>
  </ResponseField>

  <Expandable title="Supported types" defaultOpen>
    <ResponseField name="StripeAchUserDetailsComponent" type="PrimerHeadlessAchComponent<AchUserDetailsCollectableData, AchUserDetailsStep>">
      <Expandable title="API">
        <ResponseField name="updateCollectedData(collectableData: AchUserDetailsCollectableData)">
          Update component with collected data by passing implementations of sealed interface.
          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
          [componentValidationStatus](#component-validation-status-flow-primer-validation-status-ach-user-details-collectable-data)
          and receive the validation status when it's updated.

          <Expandable title="sealed interface AchUserDetailsCollectableData">
            <ResponseField name="FirstName">
              A data class representing the customer's first name.

              <Expandable title="Properties" defaultOpen>
                <ResponseField name="value" type="String">
                  The customer's first name.
                </ResponseField>
              </Expandable>
            </ResponseField>

            <ResponseField name="LastName">
              A data class representing the customer's last name.

              <Expandable title="Properties" defaultOpen>
                <ResponseField name="value" type="String">
                  The customer's last name.
                </ResponseField>
              </Expandable>
            </ResponseField>

            <ResponseField name="EmailAddress">
              A data class representing the customer's email address.

              <Expandable title="Properties" defaultOpen>
                <ResponseField name="value" type="String">
                  The customer's email address.
                </ResponseField>
              </Expandable>
            </ResponseField>
          </Expandable>
        </ResponseField>

        <ResponseField name="componentStep: Flow<AchUserDetailsStep>">
          <p>
            <code>AchUserDetailsStep</code> is a class holding different output data for specific steps. Whenever{' '}
            <a href={`#param-start`}>start</a> or <a href={`#param-submit`}>submit</a> methods are
            called, <code>componentStep</code> will trigger the next step in case the call to the mentioned method was successful.
          </p>

          <Expandable title="sealed interface AchUserDetailsStep">
            <ResponseField name="UserDetailsRetrieved">
              Data class representing the retrieved user details.

              <Expandable title="Properties" defaultOpen>
                <ResponseField name="firstName" type="String">
                  The first name previously sent on client session creation.
                </ResponseField>

                <ResponseField name="lastName" type="String">
                  The first name previously sent on client session creation.
                </ResponseField>

                <ResponseField name="emailAddress" type="String">
                  The email address previously sent on client session creation.
                </ResponseField>
              </Expandable>
            </ResponseField>

            <ResponseField name="UserDetailsCollected">
              Object representing the collected user details.
            </ResponseField>
          </Expandable>
        </ResponseField>

        <ResponseField name={`componentValidationStatus: Flow<PrimerValidationStatus<${collectableData}>>`}>
          The `PrimerValidationStatus` interface encompasses a range of validation statuses.

          <Expandable title="sealed interface PrimerValidationStatus">
            <ResponseField name={`Validating<${collectableData}>`}>
              Indicates that data is currently in the process of being validated.

              <Expandable title="Properties" defaultOpen>
                <ResponseField name="collectableData" type={`${collectableData}`}>
                  The data being validated.
                </ResponseField>
              </Expandable>
            </ResponseField>

            <ResponseField name={`Valid<${collectableData}>`}>
              Indicates that the data has successfully been validated.

              <Expandable title="Properties" defaultOpen>
                <ResponseField name="collectableData" type={`${collectableData}`}>
                  The successfully validated data.
                </ResponseField>
              </Expandable>
            </ResponseField>

            <ResponseField name={`Invalid<${collectableData}>`}>
              Indicates that the data has been considered invalid after validation.

              <Expandable title="Properties" defaultOpen>
                <ResponseField name="validationErrors" type="List<PrimerValidationError>">
                  List of `PrimerValidationError` objects that represent data validation errors emitted by this component.

                  <Expandable title="PrimerValidationError">
                    <ResponseField name="List<PrimerValidationError>">
                      <Expandable title="Type">
                        <ResponseField name="PrimerValidationError">
                          <Expandable title="Properties">
                            <ResponseField name="errorId" type="String" required>
                              A unique error identifier.
                            </ResponseField>

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

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

                <ResponseField name="collectableData" type={`${collectableData}`}>
                  The data that failed validation.
                </ResponseField>
              </Expandable>
            </ResponseField>

            <ResponseField name={`Error<${collectableData}>`}>
              Represents the status when an error occurred during the validation process.

              <Expandable title="Properties" defaultOpen>
                <ResponseField name="error" type="PrimerError">
                  The specific `PrimerError` that occurred during validation.

                  <Expandable title="PrimerValidationError">
                    <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" required>
                      A unique diagnostics id for the given error.
                    </ResponseField>
                  </Expandable>
                </ResponseField>

                <ResponseField name="collectableData" type={`${collectableData}`}>
                  The data for which the error occurred.
                </ResponseField>
              </Expandable>
            </ResponseField>
          </Expandable>
        </ResponseField>
      </Expandable>
    </ResponseField>
  </Expandable>
</Expandable>

## Example

```kotlin KOTLIN theme={"dark"}
class CheckoutActivity : AppCompatActivity() {
  // 👇 Add this
  private val stripeAchUserDetailsComponent by lazy {
	  /**
	  Note: Although the component focuses on collecting user details pertaining to ACH,
	  it  also kicks off the tokenization and payment processes and because of that it should
	  be kept in memory until the checkout is completed. This component implements
	  Android's ViewModel class, therefore keeping a reference to it is not enough. Instead,
	  pass a long lifecycle ViewModelStoreOwner when you initialize PrimerHeadlessUniversalCheckoutAchManager,
	  such as that of your activity or parent fragment.
	  */
	  PrimerHeadlessUniversalCheckoutAchManager(viewModelStoreOwner)
        .provide<StripeAchUserDetailsComponent>(paymentMethodType = "STRIPE_ACH")
  }
}
```
