Web SDK
- Getting started
- Primer
- PrimerCheckout
- PrimerHeadlessCheckout
- CheckoutStyle
- Common objects
- Constants
showVaultManager(
clientToken: string,
options: VaultManagerOptions
): Promise<PrimerVaultManager>
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
Hide Parameters
A string containing a client token as returned by the Primer API when you create a client session.
An interface for configuring the behavior and appearance of the Vault Manager UI.
Hide Properties
Hide Properties
The container element in which the checkout should be rendered.
This option forces the locale. By default, the locale will be set to the browser’s locale.
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.
Whether the Vault Manager should only show saved payment methods.
Whether deleting a vaulted payment method is disabled or enabled.
Hide Payment method option
Hide Payment method option
Customize the appearance and behavior of the card fields in the checkout form.
Hide Properties
Hide Properties
Options for the cardholder name input field.
Hide Properties
Hide Properties
Whether the cardholder name is required. Only works if the cardholder name is visible.
Whether the cardholder name input field should be visible. This property is deprecated, set it on your Dashboard instead.
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.
Customize the placeholder of the card number field.
Hide Properties
Hide Properties
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.
Customize the placeholder of the expiry date field.
Hide Properties
Hide Properties
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.
Customize the placeholder of the CVV field.
Hide Properties
Hide Properties
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.
Options for using PayPal as a payment method.
Hide Properties
Hide Properties
The color of the PayPal button.
The shape of the PayPal button.
The size of the PayPal button.
The height of the PayPal button, in pixels.
The label displayed on the PayPal button.
Whether to display the PayPal tagline beneath the button.
A function to be called when the PayPal button is clicked.
Options for customizing the 3D Secure verification flow.
Hide Properties
Hide Properties
The order details used for 3D Secure verification.
Hide Properties
Hide Properties
The email address associated with the transaction.
The billing address for the transaction.
Hide Properties
Hide Properties
The first name of the customer associated with the transaction.
The last name of the customer associated with the transaction.
The first line of the billing address for the transaction.
The second line of the billing address for the transaction.
The third line of the billing address for the transaction.
The city of the billing address for the transaction.
The state or province of the billing address for the transaction.
The ISO 3166-1 alpha-2 code of the country of the billing address for the transaction.
The postal code of the billing address for the transaction.
The unique identifier for the transaction.
A string specifying a test scenario for use in testing 3D Secure.
Hide Customization options
Hide Customization options
See the CheckoutStyle page.
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.
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
Show or hide your custom submit button.
Hide context
Hide context
An identifier for the current scene.
Disable or enable your custom submit button.
Hide context
Hide context
An identifier for the current scene.
Put your submit button in a loading state.
Hide context
Hide context
An identifier for the current scene.
Hide Properties
Hide Properties
Choose whether a processing indicator overlay should be shown on form submission.
Hide Properties
Hide Properties
Choose whether to allow Universal Checkout to show error messages.
Hide Lifecycle Callbacks
Hide Lifecycle Callbacks
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
Indicates which PaymentMethodType will be tokenized.
Called when the tokenization process is about to start, but is canceled for some reason.
Called when the tokenization process starts.
Called when the tokenization process is successful.
Called when the tokenization process fails.
Hide PrimerClientError
Hide PrimerClientError
A human-readable error message.
A unique identifier for the error instance, used for troubleshooting purposes.
Optional additional data associated with the error.
Whether the error was generated by the developer.
Returns
Hide Promise<PrimerVaultManager>
Hide Promise<PrimerVaultManager>
Example
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...
});
}