This method allows you get a new instance of a component implementation.
1
async provide(props: AchManagerProps): Promise<StripeAchUserDetailsComponent | any>
Parameters
Properties
A unique string identifier for the payment method. Supported payment methods for current client session are returned in onAvailablePaymentMethodLoad
callback.
Called whenever the component emits a new step. This usually happens when calling start or submit or whenever the component collects data.
Parameters
Properties
Properties
Called to indicate that a PrimerError occurred during the component's operation.
Parameters
The specific PrimerError
that occurred during the component's operation.
Parameters
Interface that indicates that the data has been considered invalid after validation.
Properties
Properties
Properties
Properties
A list of PrimerValidationError
explaining why the data is considered invalid.
Properties
Parameters
Interface that indicates that the data has been successfully validated.
Properties
Properties
Properties
Properties
Parameters
Interface that indicates that data is currently in the process of being validated.
Properties
Properties
Properties
Properties
Parameters
Interface that represents an error that occurred during the validation process.
Properties
Properties
Properties
Properties
The PrimerError
that ocurred during the validation attempt.
Properties
Supported payment method types
Type | paymentMethodType |
---|---|
StripeAchUserDetailsComponent | STRIPE_ACH |
Returns
An instance of a component, depending on the paymentMethodType
:
Common API and available components
Common API
Initialize the component by calling the start
function. This method should be called only once.
Call submit
function in order to process collected data and move component to next state.
Supported types
API
To validate the collected data, you can refer to the appropriate AchManagerProps callback functions.
To validate the collected data, you can refer to the appropriate AchManagerProps callback functions.
To validate the collected data, you can refer to the appropriate AchManagerProps callback functions.
Example
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
// 👇 Add thisconst achManagerProps: AchManagerProps = { paymentMethodType: "STRIPE_ACH", onStep: (data: AchStep) => { switch (data.stepName) { case "userDetailsRetrieved": // Pre-populate your form with first name, last name and email address. break; case "userDetailsCollected": // Form can be hidden (eg.: pop the backstack). Start listening for DisplayStripeAchMandateAdditionalInfo events. break; } }, onError: (error: PrimerError) => { // An error that occurred during the component's operation. }, onInvalid: (data: PrimerInvalidComponentData<AchValidatableData>) => { // Data was considered invalid during validation. switch(data.data.validatableDataName) { case "firstName": // ... break; case "lastName": // ... break; case "emailAddress": // ... break; } }, onValid: (data: PrimerValidComponentData<AchValidatableData>) => { // Data was successfully validated. switch(data.data.validatableDataName) { case "firstName": // ... break; case "lastName": // ... break; case "emailAddress": // ... break; } }, onValidating: (data: PrimerValidatingComponentData<AchValidatableData>) => { // Data is in the process of being validated. switch(data.data.validatableDataName) { case "firstName": // ... break; case "lastName": // ... break; case "emailAddress": // ... break; } }, onValidationError: (data: PrimerComponentDataValidationError<AchValidatableData>) => { // Error occurred during data validation. switch(data.data.validatableDataName) { case "firstName": // ... break; case "lastName": // ... break; case "emailAddress": // ... break; } },};const achManager = new AchManager();const stripeAchUserDetailsComponent: StripeAchUserDetailsComponent = await achManager.provide(achManagerProps);