TS
showVaultManager(
clientToken: string,
options: VaultManagerOptions
): Promise<PrimerVaultManager>
PrimerVaultManager,
which is used to manage the customer’s payment methods stored in the Primer Vault.
Parameters
Hide 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
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
Hide Payment method option
object
Customize the appearance and behavior of the card fields in the checkout form.
Hide Properties
Hide Properties
object
Options for the cardholder name input field.
Hide Properties
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
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
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
Options for using PayPal as a payment method.
Hide Properties
Hide Properties
"gold" | "blue" | "silver" | "white" | "black"
The color of the PayPal button.
"pill" | "rect"
The shape of the PayPal button.
"small" | "medium" | "large" | "responsive"
The size of the PayPal button.
number
The height of the PayPal button, in pixels.
"checkout" | "credit" | "pay" | "buynow" | "paypal" | "installment"
The label displayed on the PayPal button.
boolean
Whether to display the PayPal tagline beneath the button.
() => void
A function to be called when the PayPal button is clicked.
object
Options for customizing the 3D Secure verification flow.
Hide Properties
Hide Properties
object
required
The order details used for 3D Secure verification.
Hide Properties
Hide Properties
object
required
string
required
The email address associated with the transaction.
object
The billing address for the transaction.
Hide Properties
Hide Properties
string
The first name of the customer associated with the transaction.
string
The last name of the customer associated with the transaction.
string
The first line of the billing address for the transaction.
string
The second line of the billing address for the transaction.
string
The third line of the billing address for the transaction.
string
The city of the billing address for the transaction.
string
The state or province of the billing address for the transaction.
string
The ISO 3166-1 alpha-2 code of the country of the billing address for the transaction.
string
The postal code of the billing address for the transaction.
string
required
The unique identifier for the transaction.
string
A string specifying a test scenario for use in testing 3D Secure.
Hide Customization options
Hide Customization options
CheckoutStyle
See the CheckoutStyle page.
object
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
Hide Properties
Hide Callbacks
Hide Callbacks
(isVisible: boolean, context: object) => void
Show or hide your custom submit button.
Hide context
Hide context
string
An identifier for the current scene.
(isDisabled: boolean, context: object) => void
Disable or enable your custom submit button.
Hide context
Hide context
string
An identifier for the current scene.
(isLoading: boolean, context: object) => void
Put your submit button in a loading state.
Hide context
Hide context
string
An identifier for the current scene.
object
Hide Properties
Hide Properties
boolean
Choose whether a processing indicator overlay should be shown on form
submission.
object
Hide Properties
Hide Properties
boolean
Choose whether to allow Universal Checkout to show error messages.
Hide Lifecycle Callbacks
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.
Hide Data
Hide Data
PaymentMethodType
Indicates which PaymentMethodType will be tokenized.
(reason: string) => void
Called when the tokenization process is about to start, but is canceled for some reason.
() => void
Called when the tokenization process starts.
(data: PaymentMethodToken) => void
Called when the tokenization process is successful.
(message: PrimerClientError) => void
Called when the tokenization process fails.
Returns
Hide Promise<PrimerVaultManager>
Hide Promise<PrimerVaultManager>
Example
TS
import { Primer } from "@primer-io/checkout-web";
const clientToken = "YOUR_CLIENT_TOKEN";
async function showVaultManager() {
const primerVaultManager = await Primer.showVaultManager(clientToken, {
container: "#my-element",
// other options...
});
}