TYPESCRIPT
Copy
Ask AI
async provide(props: AchManagerProps): Promise<StripeAchUserDetailsComponent | any>
Parameters
Hide Parameters
Hide Parameters
Object that provides the payment menthod type and callback functions for
handling steps, errors and validation.
This method will be called when an error occurs. It may return
Show Properties
Show Properties
A unique string identifier for the payment method. Supported payment methods for current client session are returned in
onAvailablePaymentMethodLoad
callback.PrimerCheckoutData
if the error occurs after the payment creation.Please note, that if you
override
this method, you must call the errorHandler
to finalize the flow.Show Properties
Show Properties
Hide Properties
Hide Properties
Show Properties
Show Properties
Primer’s unique identifier for the payment.
Your order identifier as provided in the client session.
Can be either
payment-failed
which is an error from the PSP side, or cancelled-by-customer
which means the failure initiated on the customer side. I.e. cancelling a 3DS flow.Custom information, that depends on the payment method.
Show Variations
Show Variations
XenditCheckoutVoucherAdditionalInfo
PromptPayCheckoutAdditionalInfo
Called to indicate that the component data was considered invalid during validation.
Show Parameters
Show Parameters
PrimerInvalidComponentData<AchValidatableData>
Interface that indicates that the data has been considered invalid after validation.
Show Properties
Show Properties
The data that failed validation.
Show child attributes
Show child attributes
AchFirstName
AchLastName
A list of
PrimerValidationError
explaining why the data is considered invalid.Called to indicate that the component data was successfully validated.
Show Parameters
Show Parameters
PrimerValidComponentData<AchValidatableData>
Interface that indicates that the data has been successfully validated.
Show Properties
Show Properties
The successfully validated data.
Show child attributes
Show child attributes
AchFirstName
AchLastName
Called to indicate that the component data is in the process of being validated.
Show Parameters
Show Parameters
PrimerValidatingComponentData<AchValidatableData>
Interface that indicates that data is currently in the process of being validated.
Show Properties
Show Properties
The data being validated.
Show child attributes
Show child attributes
AchFirstName
AchLastName
Called to indicated an error that occurred during component data validation.
Show Parameters
Show Parameters
PrimerComponentDataValidationError<AchValidatableData>
Interface that represents an error that occurred during the validation process.
Show Properties
Show Properties
The data for which an error ocurred during validation.
Show child attributes
Show child attributes
AchFirstName
AchLastName
The
PrimerError
that ocurred during the validation attempt.PrimerError
Show Properties
Show Properties
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.
Supported payment method types
Hide child attributes
Hide child attributes
Type | paymentMethodType |
---|---|
StripeAchUserDetailsComponent | STRIPE_ACH |
Returns
An instance of a component, depending on thepaymentMethodType
:
Hide Common API and available components
Hide Common API and available components
Hide Common API
Hide Common API
Hide Supported types
Hide Supported types
StripeAchUserDetailsComponent
Show API
Show API
handleFirstNameChange(value: string)
Sets the customer’s first name.To validate the collected data, you can refer to the appropriate
AchManagerProps
callback functions.
handleLastNameChange(value: string)
Sets the customer’s last name.To validate the collected data, you can refer to the appropriate
AchManagerProps
callback functions.
handleEmailAddressChange(value: string)
Sets the customer’s email address.To validate the collected data, you can refer to the appropriate
AchManagerProps
callback functions.
Example
TYPESCRIPT
Copy
Ask AI
// 👇 Add this
const 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);