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.

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 eligible card registered in the wallet
  • Apple Pay domain not verified (Apple Pay only)
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.
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.
rinne-js only supports tokenized Google Pay payments with 3DS cryptogram authentication. Non-tokenized (PAN-only) payment methods are not accepted and will not be available for payment.

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