TYPESCRIPT
async provide(props: AchManagerProps): Promise<StripeAchUserDetailsComponent | any>
Parameters
Hide Parameters
Hide Parameters
AchManagerProps
required
Object that provides the payment menthod type and callback functions for
handling steps, errors and validation.
Show Properties
Show Properties
string
required
A unique string identifier for the payment method. Supported payment methods for current client session are returned in
onAvailablePaymentMethodLoad callback.This method will be called when an error occurs. It may return
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
PrimerError
required
PrimerCheckoutData
Hide Properties
Hide Properties
IPrimerCheckoutDataPayment
Show Properties
Show Properties
string
Primer’s unique identifier for the payment.
string
Your order identifier as provided in the client session.
PrimerPaymentErrorCode
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.Called to indicate that the component data was considered invalid during validation.
Show Parameters
Show Parameters
Interface that indicates that the data has been considered invalid after validation.
Show Properties
Show Properties
AchValidatableData
The data that failed validation.
Show child attributes
Show child attributes
Called to indicate that the component data was successfully validated.
Show Parameters
Show Parameters
Interface that indicates that the data has been successfully validated.
Show Properties
Show Properties
AchValidatableData
The successfully validated data.
Show child attributes
Show child attributes
Called to indicate that the component data is in the process of being validated.
Show Parameters
Show Parameters
Interface that indicates that data is currently in the process of being validated.
Show Properties
Show Properties
AchValidatableData
The data being validated.
Show child attributes
Show child attributes
Called to indicated an error that occurred during component data validation.
Show Parameters
Show Parameters
Interface that represents an error that occurred during the validation process.
Show Properties
Show Properties
AchValidatableData
The data for which an error ocurred during validation.
Show child attributes
Show child attributes
PrimerError
The
PrimerError that ocurred during the validation attempt.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
Show API
Show API
Sets the customer’s first name.To validate the collected data, you can refer to the appropriate
AchManagerProps
callback functions.
Sets the customer’s last name.To validate the collected data, you can refer to the appropriate
AchManagerProps
callback functions.
Sets the customer’s email address.To validate the collected data, you can refer to the appropriate
AchManagerProps
callback functions.
Example
TYPESCRIPT
// 👇 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);