StripeAchUserDetailsComponent
to initiate Stripe ACH payments.
KOTLIN
Copy
Ask AI
fun <T : PrimerHeadlessAchComponent<out PrimerCollectableData, out PrimerHeadlessStep>> provide(paymentMethodType: String): T
Parameters
Hide Parameters
Hide Parameters
A unique string identifier for the payment method. Supported payment methods for current client session are returned in onAvailablePaymentMethodsLoaded callback.
Type parameters
Hide Type parameters
Hide Type parameters
The type of the PrimerHeadlessAchComponent
implementation to
return.
Hide Supported types
Hide Supported types
Type | paymentMethodType |
---|---|
StripeAchUserDetailsComponent | STRIPE_ACH |
Returns
An instance of the passed generic typeT
, which could be any of the following available components:
Hide Common API and available components
Hide Common API and available components
Show Common API
Show 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
of PrimerError objects that represent errors emitted by this component.
Subscribers can observe and handle errors using this Flow.
Hide Supported types
Hide Supported types
StripeAchUserDetailsComponent
PrimerHeadlessAchComponent<AchUserDetailsCollectableData, AchUserDetailsStep>
Show API
Show 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
and receive the validation status when it’s updated.
Show sealed interface AchUserDetailsCollectableData
Show sealed interface AchUserDetailsCollectableData
FirstName
A data class representing the customer’s first name.
Hide Properties
Hide Properties
The customer’s first name.
LastName
A data class representing the customer’s last name.
Hide Properties
Hide Properties
The customer’s last name.
componentStep: Flow<AchUserDetailsStep>
AchUserDetailsStep
is a class holding different output data for specific steps. Whenever
start or submit methods are
called, componentStep
will trigger the next step in case the call to the mentioned method was successful.
Show sealed interface AchUserDetailsStep
Show sealed interface AchUserDetailsStep
UserDetailsRetrieved
UserDetailsCollected
Object representing the collected user details.
componentValidationStatus: Flow<PrimerValidationStatus<AchUserDetailsCollectableData>>
The
PrimerValidationStatus
interface encompasses a range of validation statuses.Show sealed interface PrimerValidationStatus
Show sealed interface PrimerValidationStatus
Validating<AchUserDetailsCollectableData>
Indicates that data is currently in the process of being validated.
Hide Properties
Hide Properties
The data being validated.
Valid<AchUserDetailsCollectableData>
Indicates that the data has successfully been validated.
Hide Properties
Hide Properties
The successfully validated data.
Invalid<AchUserDetailsCollectableData>
Indicates that the data has been considered invalid after validation.
Hide Properties
Hide Properties
List of
PrimerValidationError
objects that represent data validation errors emitted by this component.The data that failed validation.
Error<AchUserDetailsCollectableData>
Represents the status when an error occurred during the validation process.
Hide Properties
Hide Properties
The specific
PrimerError
that occurred during validation.Show PrimerValidationError
Show PrimerValidationError
A unique error identifier.
A unique error code.
A error description.
A recovery suggestion for the given error. In case it’s present, use it to try
to recover from error.
A unique diagnostics id for the given error.
The data for which the error occurred.
Example
KOTLIN
Copy
Ask AI
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")
}
}