Migrating to 1.0
Tokenizer 1.0.0 reshapes the configuration object around one key per payment method (card
and ach), moves every callback into the constructor, and gives SimpleReverePay the same
onError signature as AdvancedReverePay.
Old configurations no longer work. The library throws an error at construction time that names the old option and tells you where it moved, so a missed change surfaces right away instead of failing at payment time.
Advanced or Simple?
The changes differ between the two integrations, so the steps below are split by class. Pick the
tab for the class you construct: new SimpleReverePay(…) or new AdvancedReverePay(…). If you
use both, follow both tabs.
An AdvancedReverePay instance handles exactly one payment method. To offer card and ACH, create
two instances. SimpleReverePay accepts one or both, and renders a tab for each.

// AdvancedReverePay: exactly one of `card` or `ach`
config: {
card: { fields: { /* … */ } }
// Adding `ach` here is a type error and throws at runtime.
}
// SimpleReverePay: `card`, `ach`, or both
config: {
elementId: 'payment',
card: {},
ach: { redirectURL }
}Upgrade steps
- SimpleReverePay
- AdvancedReverePay
Checklist
- Update the package:
npm install @revere_payments/tokenizer@^1.0.0. - Replace
paymentMethodswith acardand/orachkey, and movefields,redirectURLandsubmitModeunder the method they belong to (card and ACH, single method). - Pass
onSuccess,onError,onLoadedandonCheckValidityto the constructor (details). - Update your
onErrorhandler to the 3-argument signature (details). - TypeScript only: update renamed or removed type imports (details).
- Load your payment page and check the browser console. Any leftover old option throws a descriptive error.
1. Card and ACH
paymentMethods is gone. Each method has its own key, and adding the key turns the method on.
redirectURL and submitMode move under ach. Card field options move under card.fields.

config: {
elementId: 'payment',
paymentMethods: ['card', 'ach'],
defaultPaymentMethod: 'card',
redirectURL: 'https://example.com/return',
submitMode: 'inner',
fields: {
cardNumber: { placeholder: 'Card number' },
cardCVV: { required: true },
email: { required: true }
}
card: {
fields: {
cardNumber: { placeholder: 'Card number' },
cardCVV: { required: true },
email: { required: true }
}
},
ach: {
redirectURL: 'https://example.com/return',
submitMode: 'inner',
fields: { email: { required: true } }
}
}2. Single payment method
A one-item paymentMethods array becomes a single method key. card: {} is enough to enable the
card form with its defaults.

// Card only
config: {
elementId: 'payment',
paymentMethods: ['card']
card: {}
}
// ACH only
config: {
elementId: 'payment',
paymentMethods: ['ach'],
redirectURL: 'https://example.com/return'
ach: { redirectURL: 'https://example.com/return' }
}3. Callbacks move into the constructor
onSuccess and onError are required. onLoaded and onCheckValidity are optional.
Assigning a callback to the instance after construction now throws.

const tokenizer = new SimpleReverePay({
merchantId,
publicAPIKey,
config
config,
onSuccess: handleSuccess, // required
onError: handleError, // required
onLoaded: handleLoaded,
onCheckValidity: handleCheckValidity
});
tokenizer.onSuccess = handleSuccess;
tokenizer.onError = handleError;
tokenizer.onLoaded = handleLoaded;
tokenizer.onCheckValidity = handleCheckValidity; 4. onError signature
SimpleReverePay's onError now receives the same three arguments as AdvancedReverePay's:
the HTTP response status, the Validation object,
and the optional ErrorResponse.

const handleError = (error?: ErrorResponse) => {
console.error(error?.correlationId);
};
const handleError = (
responseStatus: number,
validation: Validation,
error?: ErrorResponse
) => {
console.error(responseStatus, validation, error?.correlationId);
}; Checklist
- Update the package:
npm install @revere_payments/tokenizer@^1.0.0. - Replace
paymentMethodwith acardorachkey, and movefields,formandredirectURLunder it (card, ACH). - Pass
onSuccess,onError,onLoadedandonCheckValidityto the constructor (details). - TypeScript only: update renamed or removed type imports (details).
- Load your payment page and check the browser console. Any leftover old option throws a descriptive error.
1. Card config
paymentMethod: 'card' is gone. The card key selects the card flow, and fields moves under it.
fields.form becomes card.form.

new AdvancedReverePay({
merchantId,
publicAPIKey,
config: {
paymentMethod: 'card',
fields: {
form: { id: 'paymentForm' },
cardNumber: { id: 'ccNumber' },
cardCVV: { id: 'ccCVV', required: true }
},
card: {
form: { id: 'paymentForm' },
fields: {
cardNumber: { id: 'ccNumber' },
cardCVV: { id: 'ccCVV', required: true }
}
},
sandbox: true
},
onSuccess,
onError
});2. ACH config
paymentMethod: 'ach' is gone. redirectURL and fields move under the ach key.

new AdvancedReverePay({
merchantId,
publicAPIKey,
config: {
paymentMethod: 'ach',
redirectURL: 'https://example.com/return',
fields: {
email: { id: 'email', required: true }
},
ach: {
redirectURL: 'https://example.com/return',
fields: {
email: { id: 'email', required: true }
}
},
sandbox: true
},
onSuccess,
onError
});3. Callbacks move into the constructor
onSuccess and onError are required. onLoaded and onCheckValidity are optional.
Assigning a callback to the instance after construction now throws.
const tokenizer = new AdvancedReverePay({
merchantId,
publicAPIKey,
config
config,
onSuccess: handleSuccess, // required
onError: handleError, // required
onLoaded: handleLoaded,
onCheckValidity: handleCheckValidity
});
tokenizer.onSuccess = handleSuccess;
tokenizer.onError = handleError;
tokenizer.onLoaded = handleLoaded;
tokenizer.onCheckValidity = handleCheckValidity; 4. New field options (non-breaking)
The Advanced card fields (cardNumber, cardExpiration, cardCVV, cardHolderName,
postalCode) also accept these new, optional options:
onFocus,onBlur,onInput,onChangeandonEnterKeyPressevent hooksdisabledandreadOnlyonInvalidnow receives{ message, validity }. Handlers that take no arguments keep working.cardNumber.allowedCardBrandslimits the accepted card brands, andcardNumber.onBrandChangefires when the detected brand changes.

See Advanced card configuration for the full list.
Type exports
This applies to both classes.
Type imports from @revere_payments/tokenizer/types changed. Config and DefaultConfig are
kept as deprecated aliases of AdvancedConfig and DefaultAdvancedConfig. They still compile,
but will be removed in a future major version.

| Old type | Replacement |
|---|---|
Config (deprecated alias) | AdvancedConfig |
DefaultConfig (deprecated alias) | DefaultAdvancedConfig |
CardFieldsConfig | AdvancedCardOptions['fields'] or SimpleCardOptions['fields'] |
ACHFieldsConfig | AdvancedACHOptions['fields'] or SimpleACHOptions['fields'] |
DefaultFieldsConfig | Removed (internal). |
InitTokenRequest, MessageEventDataType, UnionOmit | Removed (internal). |
New exports: AdvancedConfig, DefaultAdvancedConfig, AdvancedCardOptions,
AdvancedACHOptions, SimpleConfig, SimpleCardOptions, SimpleACHOptions, CallbackOptions
and AllowableCardBrand. See Types.
Errors you may see after upgrading
Old options are rejected at construction time with these messages:
| Old usage | Error message |
|---|---|
config.paymentMethods | `config.paymentMethods` was removed. Configure methods by presence instead: `config.card = {}` and/or `config.ach = { redirectURL }`. |
config.paymentMethod | `config.paymentMethod` was removed. Configure the method by presence instead: `config.card = {}` or `config.ach = { redirectURL }`. |
config.fields | `config.fields` was removed. Options moved under the method: `config.card.*` / `config.card.fields.*` (Simple/Advanced), `config.ach.*` / `config.ach.fields.*`. |
config.redirectURL | `config.redirectURL` was removed. Moved to `config.ach.redirectURL`. |
config.submitMode | `config.submitMode` was removed. Moved to `config.ach.submitMode`. |
tokenizer.onSuccess = … (and similar) | `onSuccess` must be passed to the SimpleReverePay constructor: new SimpleReverePay({ …, onSuccess }). (AdvancedReverePay reports the same, with its own name) |
No onSuccess / onError passed | `onSuccess` is required: new SimpleReverePay({ …, onSuccess }). |
Stricter validation
AdvancedReverePaynow rejects unknown options. Earlier versions silently ignored misspelled or unsupported keys. Now each one is reported, for exampleUnexpected option `config.card.fields.cardNumber.placholder`.SimpleReverePayalready worked this way.initRequestOriginis only accepted whensandbox: true. Earlier versions ignored it outside sandbox mode. Now the constructor throws`config.initRequestOrigin` is only accepted in `sandbox` mode.defaultPaymentMethodmust name a configured method. For example,defaultPaymentMethod: 'ach'without anachkey throws.- Advanced needs exactly one method, Simple at least one. A config with neither (or, for Advanced, with both) throws.
Behavior changes
These apply to both classes and need no code change, but check them against your handlers.
checkValidity()only validates. Earlier versions also tokenized the card when every field was valid, so callingcheckValidity()and thensubmit()could create the card twice. Now onlysubmit()tokenizes.- One submission at a time. A
submit()made while a submission is in progress is ignored and a warning is logged to the console. Eachsubmit()ends in exactly oneonSuccessoronError. Failures that previously never reachedonError, such as a bank link that failed to load, now report one. - ACH email validation always applies. An invalid or missing required email stops the
verification and calls
onError(422, validation, { error: 'Validation error' }), like the card flow. Earlier versions only stopped when anonCheckValiditycallback was passed. - Closing Plaid reports
400. When the customer exits the bank login,onErrornow receives status400and{ error: 'user-cancelled' }. When Plaid reports an error,errorholds its code (for example'INVALID_CREDENTIALS'). Earlier versions reported500, orNaNfor Plaid errors.
See When onError fires for every status.