Show the vault at the specified container, and get an instance of PrimerVaultManager,
which is used to manage the customer’s payment methods stored in the Primer Vault.
Parameters
Hide Parameters
string
A string containing a client token as returned by the Primer API when you
create a client session.
object
An interface for configuring the behavior and appearance of the Vault Manager UI.
Hide Properties
string | Element
required
The container element in which the checkout should be rendered.
string
This option forces the locale. By default, the locale will be set to the browser’s locale.
"legacy" | "2.4"
Default: "2.4"
Specifies the API version to use when interacting with the Primer backend.
If not explicitly set, defaults to version '2.4'.
Set this to 'legacy' if you encounter compatibility issues with the latest API version and wish to revert to the previous stable behavior.
boolean
Whether the Vault Manager should only show saved payment methods.
boolean
Whether deleting a vaulted payment method is disabled or enabled.
Hide Payment method option
object
Customize the appearance and behavior of the card fields in the checkout form.
Hide Properties
object
Options for the cardholder name input field.
Hide Properties
boolean
Whether the cardholder name is required. Only works if the cardholder
name is visible.
boolean
Whether the cardholder name input field should be visible.
string | (options: { locale: string }) => string
The placeholder text to display in the cardholder name input field. It
can be either a string or a function that returns a string. The
function receives an options object as first argument.
object
Customize the placeholder of the card number field.
Hide Properties
string | (options: { locale: string }) => string
The placeholder text to display in the cardholder number input field.
It can be either a string or a function that returns a string. The
function receives an options object as first argument.
object
Customize the placeholder of the expiry date field.
Hide Properties
string | (options: { locale: string }) => string
The placeholder text to display in the expiry date input field. It can
be either a string or a function that returns a string. The function
receives an options object as first argument.
object
Customize the placeholder of the CVV field.
Hide Properties
string | (options: { locale: string }) => string
The placeholder text to display in the CVV input field. It can be
either a string or a function that returns a string. The function
receives an options object as first argument.
Drop-In Checkout allows you to use your own submit button for submitting forms. By default, the built-in submit button will be favored.Note that when disabling the built-in submit button and using your own custom submit button, it is required to implement the submit function in order to notify Drop-In Checkout of form submissions.When using your own custom submit button, it’s important to use the following callbacks to ensure that your submit button is in the correct state and in sync with the checkout as your customers interact with it.
TS
const options = { /* Other options ... */ submitButton: { useBuiltInButton: false, // Default to true // Callback for receiving the submit button's visible state in the current scene onVisible(isVisible, context: { currentSceneId }) { // Show or hide your custom submit button }, // Callback for receiving the submit button's disabled state in the current scene onDisable(isDisabled, context: { currentSceneId }) { // Disable or enable your custom submit button }, // Callback for receiving the submit button's loading state in the current scene onLoading(isLoading, context: { currentSceneId }) { // Show your submit button in a loading state }, // Callback for receiving the submit button's content in the current scene onContentChange(content, context: { currentSceneId }) { // Set your submit button's content with either the content provided or your own custom content }, },};
Hide Properties
boolean
Set whether to use built-in submit button or to display your own custom
button.
boolean
Set whether the total order amount should be displayed in the submit button
content.
Hide Callbacks
(isVisible: boolean, context: object) => void
Show or hide your custom submit button.
Hide context
string
An identifier for the current scene.
(isDisabled: boolean, context: object) => void
Disable or enable your custom submit button.
Hide context
string
An identifier for the current scene.
(isLoading: boolean, context: object) => void
Put your submit button in a loading state.
Hide context
string
An identifier for the current scene.
(content: string, context: object) => void
Set your submit button’s content with either the content provided or your
own custom content.
Hide context
string
An identifier for the current scene.
object
Hide Properties
boolean
Choose whether a processing indicator overlay should be shown on form
submission.
object
Hide Properties
boolean
Choose whether to allow Universal Checkout to show error messages.
Hide Callbacks
(message: string) => void
A callback for when the error message should be displayed, you can choose to
use the provided message for your own purposes.
() => void
A callback for when the error message should be hidden, update own UI
accordingly.
Hide Lifecycle Callbacks
(data: Data) => boolean | Promise<boolean>
Called when the tokenization process is about to start. Return a boolean indicating whether or not to proceed
with the process.