Skip to main content
Wallet Elements provide Apple Pay and Google Pay buttons backed by the same transaction object and callback contract. Use them to collect tokenized wallet payment data and forward encrypted payloads to your backend for transaction processing.

Supported Wallet Elements

Both elements support the same core options (button, onCapture, onError, onCancel). googlePay() also supports colorScheme and allowedAuthMethods.

Options

Event Lifecycle

Button Behavior

Wallet Availability

Apple Pay and Google Pay buttons are not rendered when the environment does not support them. This happens silently — mount() resolves without rendering any visible element. Conditions that prevent rendering include:
  • Non-HTTPS origin
  • Browser or device without wallet support
  • No card in the wallet that is eligible under your configuration
  • Apple Pay domain not verified (Apple Pay only)
  • Google Pay wallet holding only account-saved cards, on the default allowedAuthMethods: ['THREE_DS'] — enabling UNAUTHENTICATED removes this case
Design your checkout layout so it gracefully handles an empty wallet button slot, or check support before mounting.

Apple Pay Domain Verification

Apple Pay only appears on domains that are verified with Apple. If your domain is not verified, the Apple Pay button will not render.
Before going live:
  1. Download the Apple Pay domain association file. Keep the filename exactly as it downloads — apple-developer-merchantid-domain-association with no extension.
  2. Host it on every domain and subdomain where Apple Pay is used, at the exact path /.well-known/apple-developer-merchantid-domain-association, served over HTTPS.
  3. Let Rinne know which domains and subdomains to register so they can be submitted to Apple for verification.
If the file is removed, replaced, or becomes unavailable, Apple can invalidate the domain and Apple Pay will stop working until the domain is verified again.

onCapture Contract

onCapture gives you encrypted wallet card data, payment method, and the transaction object you created.
card_data is a discriminated union, not a single flat interface. wallet_type separates the wallets, and for Google Pay authentication_type separates its two shapes:
Fields absent from a member are left off instead of typed as optional, so reading one before narrowing is a compile error rather than a silent undefined:
Narrow on wallet_type before authentication_type. Apple Pay sets authentication_type to '3DS' only on some captures, so one that arrives without it would otherwise fall into the branch you wrote for the unauthenticated Google Pay shape.
GooglePayMountOptions is generic in the methods you allow, so onCapture receives only the shapes your selection can produce. With allowedAuthMethods omitted or set to ['THREE_DS'], you get GooglePayThreeDsCardData directly and no narrowing is needed.
payment_method is inferred from wallet funding data and defaults to CREDIT_CARD when funding type is not provided by the provider.
If backend processing fails, call fail() inside onCapture. Without it, the wallet may stay in a processing state.

allowedAuthMethods (Google Pay)

allowedAuthMethods selects which card credentials Google Pay may return. It defaults to ['THREE_DS'] — only device-tokenized cards carrying a 3DS cryptogram. Leave the option out and that is what you get, so nothing widens what you accept unless you ask for it.
Enable UNAUTHENTICATED only if your organization has made that call, and consider running 3DS on those payments.
Accepting UNAUTHENTICATED means no liability shift — the same risk profile as a keyed card without 3DS. The upside is that shoppers whose wallet holds only account-saved cards (common on desktop) can pay instead of seeing an empty Google Pay sheet.
THREE_DS and UNAUTHENTICATED are the only values the option accepts. Note that the THREE_DS option value is not the same string as authentication_type: '3DS' in the captured card_data, which is the API’s wire value.

Payload differences

The two methods return different card_data shapes: The missing authentication_type is the marker to branch on server-side if you apply different risk rules to unauthenticated payments. Both shapes go to the standard API host — the PAN is already encrypted before it reaches the SDK, so the PCI endpoints are not involved.
A malformed payload now fails the payment instead of being downgraded. A Google Pay token missing tokenServiceProvider throws Google Pay network token is missing tokenServiceProvider rather than falling back to the PAN shape, and a payload with no card at all throws Google Pay response must contain either a network token or a card number. Both surface through fail() like any other capture error.

colorScheme (Google Pay)

Use colorScheme to align the Google Pay iframe with your page theme.

Mount and Unmount

mount() accepts either a CSS selector or an HTMLElement.

Mount Errors

mount() throws if the target is missing or the provider cannot render the wallet button.

Full Wallet Example