ACH
warning
Before you start integrating ACH, please contact support. You won't get a success response without domain registration.
ACH in Advanced mode connects the bank account through Plaid.
Key requirements
config.achselects the ACH flow.config.ach.redirectURL: string | URL(required)config.sandbox: boolean(optional; enables the Plaid sandbox)
Configuration Reference
| Option | Type | Default | Required | Description |
|---|---|---|---|---|
ach.redirectURL | string | URL | - | Yes | Plaid redirect URL used during bank account verification. |
ach.fields.email.id | string | - | No/Yes | ID of your own email input element. Required when strictMode: true. |
ach.fields.email.required | boolean | false | No | Marks email as required. |
ach.fields.email.value | string | - | No | Default email value. Also mirrored to reverePay.email. |
ach.fields.email.placeholder | string | - | No | Not applied at init. Set it on your own input, or use updateFields. |
sandbox | boolean | false | No | Enables the Plaid sandbox environment. |
strictMode | boolean | false | No | Enables the email duplication check. Requires ach.fields.email. |
The email input is an element you own. Keep its value in sync, on every change, through the instance's email setter or updateFields({ email: { value } }).
AdvancedACHOptions
type AdvancedACHOptions = {
redirectURL: URL | string;
fields?: {
email?: FieldConfigBase & { placeholder?: string; value?: string; required?: boolean };
};
};See FieldConfigBase.
Example (TypeScript)
- TypeScript
import { AdvancedReverePay } from '@revere_payments/tokenizer';
import type { SuccessResponse, ErrorResponse, Validation } from '@revere_payments/tokenizer/types';
const reverePay = new AdvancedReverePay({
merchantId: 'yourMerchantId',
publicAPIKey: 'yourPublicAPIKey',
config: {
sandbox: true,
ach: {
redirectURL: 'https://merchant.example.com'
}
},
onLoaded: () => console.log('Tokenizer loaded - ACH'),
onSuccess: (res: SuccessResponse) => console.log('SUCCESS', res),
onError: (status: number, validation: Validation, err?: ErrorResponse) => {
console.log('ERROR', status, validation, err);
}
});
reverePay.submit();Validation and callbacks
submit() starts the bank verification. Each call ends in exactly one onSuccess or onError,
and a submit() made while a verification is in progress is ignored with a console warning.
- Email: when an
emailfield is configured,submit()checks it first (required and format). If it is invalid, Plaid does not open andonError(422, validation, { error: 'Validation error' })is called.onCheckValidity(validation)is called first, when you passed it. - Success:
onSuccessreceives the ACH details and a token. - The customer closes Plaid:
onError(400, validation, { error: 'user-cancelled' }). - Plaid reports an error:
onError(400, validation, { error: '<Plaid error code>' }), for example'INVALID_CREDENTIALS'. - The bank link can't be loaded or started:
onError(500, validation, error), with acorrelationIdfor support.
See When onError fires for the full list.
Response Types
For detailed information about response types, see Response Types.
Playgrounds
- TypeScript
- JavaScript