PaymentMethodElementInitConfig

PaymentMethodElementInitConfig object

Configuration options for initializing the PaymentMethodElement, including appearance customization, error handling, and element reference.

PropertyTypeRequiredDescription
typestringrequiredSupported payment method types for payment buttons.
refany | stringrequiredReference to the HTML element where the payment methods selector will be mounted.
appearanceobjectoptionalAppearance customization for a single payment method button.
▶ 4 properties
PropertyTypeRequiredDescription
settingsobjectoptionalComponent-level behavioural configuration that is not expressible through CSS.
▶ 7 properties
PropertyTypeRequiredDescription
googlePayButtonConfigobjectoptionalOptions passed to Google’s own button, applied only when googlePayStyle is ‘google’. Google renders and owns this button, so these are the only customisations available — its logo and card art placement are theirs and cannot be changed, and it always fills the payment method it sits in. See https://developers.google.com/pay/api/web/guides/brand-guidelines#custom-button
▶ 3 properties
PropertyTypeRequiredDescription
buttonColorstringoptionalWhich of Google’s two button styles to render. ‘black’ is the dark button, ‘white’ the light one, and ‘default’ lets Google choose (currently the dark button). Google’s brand guidelines ask for whichever contrasts with the surface behind it — dark on light backgrounds, light on dark or colourful ones. Left unset, the button follows the background it is painted on.
buttonRadiusnumberoptionalCorner radius in pixels. Google’s brand guidelines allow the roundness to be tuned to match your other buttons, but not the button’s proportions.
buttonTypestringoptionalThe button’s caption. ‘plain’ is the Google Pay mark on its own with no wording; every other value pairs the mark with that call to action. Google translates the caption to the shopper’s browser language. Defaults to ‘plain’.
googlePayFlowstringoptionalHow Google Pay opens its payment sheet. ‘handoff’ (the default) opens a gateway-hosted window that makes the call from an already-registered origin, so it works for any merchant domain at the cost of a popup and an extra click. ‘in-page’ calls Google directly from the merchant’s page — one click and no popup, but it requires that domain to be registered against the gateway’s Google Pay merchant ID, and otherwise fails with OR_BIBED_11.
googlePayStylestringoptionalHow Google Pay is presented in the payment method list. ’tile’ renders a themed tile matching the other payment methods, styled by your appearance configuration. ‘google’ renders Google’s own payment button, which takes no styling beyond Google’s supported options but is what Google’s brand guidelines require.
hideDetailedInfobooleanoptionalHides the info icon and popup content giving additional details about the payment method.
hideHeaderbooleanoptionalHides the payment method header text/logo.
hideLogosbooleanoptionalHides logos displayed adjacent to the payment method header i.e. supported banks or card types.
hideSummarybooleanoptionalHides the payment method summary text thats below the header.
stylesobjectoptionalPer-component CSS overrides keyed by selector name.
▶ 15 properties
PropertyTypeRequiredDescription
PaymentMethodStylesoptional
PaymentMethodApplePayHeaderIconStylesoptional
PaymentMethodBodyStylesoptional
PaymentMethodCardLogoIconStylesoptional
PaymentMethodGooglePayHeaderIconStylesoptional
PaymentMethodHeaderStylesoptional
PaymentMethodHoveredStylesoptional
PaymentMethodInfoIconStylesoptional
PaymentMethodMasterPassHeaderIconStylesoptional
PaymentMethodMobicredHeaderIconStylesoptional
PaymentMethodOttVoucherHeaderIconStylesoptional
PaymentMethodOzowBankLogoIconStylesoptional
PaymentMethodOzowHeaderIconStylesoptional
PaymentMethodSummaryStylesoptional
PaymentMethodZapperHeaderIconStylesoptional
theme"light" | "dark"optionalBuilt-in theme to use as a baseline. Explicit variables, styles, and settings override theme defaults.
variablesobjectoptionalGlobal design tokens exposed as CSS custom properties on the element container.
▶ 16 properties
PropertyTypeRequiredDescription
borderRadiusstring | numberoptionalGlobal corner radius applied to inputs, buttons, and cards.
boxShadowstringoptionalDefault box shadow.
colorBackgroundPrimarystringoptionalPrimary surface/background colour.
colorBackgroundSecondarystringoptionalSecondary surface colour used for cards and grouped areas.
colorErrorstringoptionalColour applied to error states and validation messages.
colorFocusedstringoptionalColour applied to focused input borders and focus rings.
colorLabelstringoptionalDefault colour for input labels.
colorOutlinestringoptionalOutline/border colour for inputs.
colorPlaceholderstringoptionalColour for input placeholder text.
colorPrimarystringoptionalPrimary brand accent colour used for buttons and interactive elements.
colorSelectedstringoptionalColour applied to selected/active elements.
colorTextstringoptionalDefault text colour.
fontFamilystringoptionalFont stack for all text.
fontSizeBasestringoptionalBase font size.
paddingHorizontalInputstring | numberoptionalHorizontal padding inside input fields.
spacingUnitstring | numberoptionalBase spacing unit used for consistent margins and gaps between elements.
onError(message: string) => voidoptionalCallback function invoked when an error occurs during payment method operations.
On this page: