Configuration
Control which elements render, how payment methods behave, and which methods appear in the Universal checkout form.
Universal checkout accepts several top-level options on
checkout.universal() that go beyond visual styling. Use these to
control what the checkout displays, how payment method selection
works, and which methods are available to the customer.
Checkout-level toggles
Pass a toggles object at the top level of checkout.universal()
to control form-wide display options. These are separate from the
card-form-specific toggles described on the
Card form page.
| Key | Default | Description |
|---|---|---|
submitButton | true | Set to false to hide the built-in submit button. |
title | None | A title string to display above the entire checkout form. |
savedCardsBins | false | Show the card BIN alongside the last 4 digits on saved cards. Set to true to show the default number of digits, or a number between 2 and 6 to control how many BIN digits appear. |
savedPaymentMethodInlineCvv | false | Render the CVV field inline on a saved payment method row. |
allowOnlyExistingPaymentMethods | false | Show only the customer's saved payment sources. New card entry and other payment methods are hidden. |
disablePaymentMethodDeletion | false | Prevent the customer from removing saved payment sources. |
checkout.universal({
container: '#pay-com-checkout',
toggles: {
title: 'Complete your purchase',
savedCardsBins: 4,
disablePaymentMethodDeletion: true,
}
})Payment method options
These top-level options on checkout.universal() control which
payment methods appear and how the customer selects them.
| Key | Type | Default | Description |
|---|---|---|---|
paymentMethods | string[] | None | Restrict the payment methods shown in the form. Only the payment method types you list appear, for example ['card', 'applepay', 'googlepay']. |
selectedPaymentMethod | string | None | Preselect a payment method when the form renders. The customer can still switch to another method. |
alternatives | 'button' | 'radio' | 'button' | Layout style for alternative payment method options. 'button' renders each as a clickable button. 'radio' renders radio inputs. |
onValidateSession | (data) => Promise<boolean> | None | An async function called when the customer starts a payment with any method. Return true to let the payment proceed, or false to block it. Replaces the deprecated apmsOnClickValidation. |
checkout.universal({
container: '#pay-com-checkout',
paymentMethods: ['card', 'applepay', 'googlepay'],
selectedPaymentMethod: 'card',
alternatives: 'radio',
})Validate before a payment starts
Use onValidateSession to run custom checks when the customer
starts a payment, for example to make sure a shipping address is
filled in.
checkout.universal({
container: '#pay-com-checkout',
onValidateSession: async ({ paymentMethodType }) => {
const addressComplete = await validateShippingAddress()
return addressComplete
},
})If the function returns false, the payment doesn't proceed. See
Validate a session
for the data it receives and when it runs.
Next steps
- Card form: Card form toggles, field styling, and custom submit buttons.
- Localization: Override display text for multiple languages.
- Style object reference: Full list of every accepted style key and CSS property.