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

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

**Parameters**

**paymentMethodType** `String` *required*

A unique string identifier for the payment method. Supported payment methods for current client session are returned in [onAvailablePaymentMethodsLoaded](https://primer.io/docs/sdk/android/v2.x.x/primer-headless-checkout/listeners/PrimerHeadlessUniversalCheckoutListener.md#onavailablepaymentmethodsloaded) callback.

## Type parameters

**Type parameters**

**T** `PrimerHeadlessAchComponent\<out PrimerCollectableData, out PrimerHeadlessStep\>` *required*

The type of the `PrimerHeadlessAchComponent` implementation to
return.

**Supported types**

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

  <tr>
    <td>
      [StripeAchUserDetailsComponent](#param-stripe-ach-user-details-component)
    </td>

    <td>
      [STRIPE\_ACH](https://primer.io/docs/sdk/android/v2.x.x/primer-headless-checkout/ach-headless-manager/provide.md)
    </td>
  </tr>
</table>

## Returns

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

**Common API and available components**

**PrimerHeadlessAchComponent** `Implemented by all components`

**Common API**

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

**componentError: Flow\<PrimerError>**

Get a [Flow](https://kotlinlang.org/api/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.flow/-flow/)
of [PrimerError](https://primer.io/docs/sdk/android/v2.x.x/common-objects/PrimerError.md) objects that represent errors emitted by this component.
Subscribers can observe and handle errors using this Flow.

**Supported types**

**StripeAchUserDetailsComponent** `PrimerHeadlessAchComponent\<AchUserDetailsCollectableData, AchUserDetailsStep\>`

**API**

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

**sealed interface AchUserDetailsCollectableData**

**FirstName**

A data class representing the customer's first name.

**Properties**

**value** `String`

The customer's first name.

**LastName**

A data class representing the customer's last name.

**Properties**

**value** `String`

The customer's last name.

**EmailAddress**

A data class representing the customer's email address.

**Properties**

**value** `String`

The customer's email address.

**componentStep: Flow\<AchUserDetailsStep>**

`AchUserDetailsStep` is a class holding different output data for specific steps. Whenever&#x20;
[start](#param-start) or [submit](#param-submit) methods are
called, `componentStep` will trigger the next step in case the call to the mentioned method was successful.

**sealed interface AchUserDetailsStep**

**UserDetailsRetrieved**

Data class representing the retrieved user details.

**Properties**

**firstName** `String`

The first name previously sent on client session creation.

**lastName** `String`

The first name previously sent on client session creation.

**emailAddress** `String`

The email address previously sent on client session creation.

**UserDetailsCollected**

Object representing the collected user details.

**componentValidationStatus: Flow\<PrimerValidationStatus\<AchUserDetailsCollectableData>>**

The `PrimerValidationStatus` interface encompasses a range of validation statuses.

**sealed interface PrimerValidationStatus**

**Validating\<AchUserDetailsCollectableData>**

Indicates that data is currently in the process of being validated.

**Properties**

**collectableData** `AchUserDetailsCollectableData`

The data being validated.

**Valid\<AchUserDetailsCollectableData>**

Indicates that the data has successfully been validated.

**Properties**

**collectableData** `AchUserDetailsCollectableData`

The successfully validated data.

**Invalid\<AchUserDetailsCollectableData>**

Indicates that the data has been considered invalid after validation.

**Properties**

**validationErrors** `List\<PrimerValidationError\>`

List of `PrimerValidationError` objects that represent data validation errors emitted by this component.

**PrimerValidationError**

**List\<PrimerValidationError>**

**Type**

**PrimerValidationError**

**Properties**

**errorId** `String` *required*

A unique error identifier.

**description** `String` *required*

A error description.

**diagnosticsId** `String` *required*

A unique diagnostics id for the given error.

**collectableData** `AchUserDetailsCollectableData`

The data that failed validation.

**Error\<AchUserDetailsCollectableData>**

Represents the status when an error occurred during the validation process.

**Properties**

**error** `PrimerError`

The specific `PrimerError` that occurred during validation.

**PrimerValidationError**

**errorId** `String` *required*

A unique error identifier.

**errorCode** `String?`

A unique error code.

**description** `String` *required*

A error description.

**recoverySuggestion** `String?`

A recovery suggestion for the given error. In case it's present, use it to try
to recover from error.

**diagnosticsId** `String` *required*

A unique diagnostics id for the given error.

**collectableData** `AchUserDetailsCollectableData`

The data for which the error occurred.

## 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")
  }
}
```


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