Skip to main content
The Therius JS SDK provides createWalletButton to add Apple Pay and Google Pay to your checkout. When the shopper taps the button, the native payment sheet — handled entirely by Apple or Google — appears. The shopper selects their card and authenticates with Face ID, Touch ID, or their device PIN. Therius decrypts the resulting payment token server-side so you never touch the raw encrypted payload.

Basic usage

Import createWalletButton and mount it into a container element. The onToken callback fires after the shopper completes the native payment sheet.
The button renders inside the container element and is automatically hidden if the device or browser does not support that wallet method. You do not need to write your own availability checks.

Google Pay

Swap type: 'googlepay' to render a Google Pay button. The rest of the API is identical.

Saving a wallet card for future use

To vault the wallet card for future merchant-initiated transactions (MIT), include walletData.tokenize: true and a shopper.id on the server-side charge:
The vaulted token can be used for subsequent charges via sdk.authorizeToken() without requiring another wallet interaction. See Saved Cards for details.

Prerequisites

Apple Pay

Requires a valid Apple Merchant ID and a domain verification file served at /.well-known/apple-developer-merchantid-domain-association on your domain. Configure this in your Therius dashboard under Connections.

Google Pay

Requires your Google Merchant ID, registered with Google Pay & Wallet Console. Configure this in your Therius dashboard under Connections.
Apple Pay will not render on non-HTTPS pages or on devices that do not have a compatible card added to Wallet. Always test on a real device with a supported card.

Further reading

See Apple Pay — applepay and Google Pay — googlepay in the Connections tab for the server-side request shape, including how to handle recurring billing agreements.