Wallets Availability

getWalletsAvailable

1. Overview

The DEUNA SDKs provide the getWalletsAvailable method to obtain the list of digital wallet providers (Google Pay, Apple Pay) that are available and ready to process payments on the current device, browser, or mobile platform.

Make sure to follow the Getting Started guide for our SDKs depending on your specific integration:

Method signatures by platform:

PlatformMethod signature
WebDeunaSDK.getWalletsAvailable(): Promise<WalletProvidersEnum[]>
iOSdeunaSdk.getWalletsAvailable { providers, error in }
AndroiddeunaSdk.getWalletsAvailable { providers, error -> }
React NativedeunaSdk.getWalletsAvailable(): Promise<WalletProvidersEnum[]>
type WalletProvidersEnum = "GOOGLE_PAY" | "APPLE_PAY";

What it does behind the scenes (by platform):

PlatformCapability checks performed
WebLoads pay.js / Apple Pay JS → calls isReadyToPay / canMakePayments → caches wallet instance
iOSChecks device via native frameworks (PassKit) → verifies valid card in Apple Wallet
AndroidChecks Google Play Services → verifies wallet via PaymentRequest API in WebView
React NativeBridges to native modules → performs iOS / Android specific checks

2. Use cases (all platforms)

Use caseHow to use
Show/hide wallet buttons on your custom checkout UICall getWalletsAvailable() on page load / app start → conditionally render buttons based on the returned array
Pre-warm the SDK before initializing payment elementsCall at startup → SDK caches the wallet instance → subsequent initElements calls are faster
Feature-flag which wallets to support in your appUse the returned array to determine if you should offer Google Pay, Apple Pay, both, or none

3. Environment

  • HTTPS — Both Apple Pay and Google Pay refuse to run on http:// (except localhost for development).
  • Supported browser — evergreen Chrome, Edge, Firefox, Safari. Apple Pay only surfaces in Safari (in‑device) or iOS 18+ (QR fallback). Google Pay requires a signed‑in Google account with a saved card.
  • Merchant configuration — the wallets you expect must be enabled for your merchant in the DEUNA Dashboard. A wallet that is disabled at the merchant level will never appear in the returned array.

3.1. Side effects to be aware of

  • Caching: the first call initializes DeunaSDK.wallet and caches it. Subsequent calls return the cached list without re‑running SSR or capability checks. If you need to re‑check (e.g. after the user signs into Google), you must create a fresh SDK instance via DeunaSDK.newInstance().

  • SSR state: when called via the SSR path, the SDK also stores resolvedWalletConfig, walletUserToken, and walletUserId internally — these are used by initElements for card tokenization.

4. Return value & handling empty results

The method returns an array containing only the providers that pass all platform-specific checks. An empty array [] means no wallet is available on the current device/platform.

Common reasons for empty results:

  • Device/browser does not support any wallet (e.g., desktop Firefox without Google account)
  • Merchant has no wallets enabled in DEUNA Dashboard
  • Platform check failed (e.g., no saved card in Google account, Apple Wallet empty)
  • SDK not initialized before calling getWalletsAvailable

Examples:

// Web / React Native
const available = await DeunaSDK.getWalletsAvailable();
if (available.length === 0) {
  showCardFormOnly();
  return;
}
// iOS
DeunaSDK.shared.getWalletsAvailable { providers, error in
    if let providers = providers, providers.contains(.applePay) {
        showApplePayButton()
    } else {
        showCardForm()
    }
}
// Android
DeunaSDK.getInstance().getWalletsAvailable { providers, error ->
    if (providers?.contains("GOOGLE_PAY") == true) {
        showGooglePayButton()
    } else {
        showCardForm()
    }
}

5. Platform-specific notes

PlatformGoogle Pay availabilityApple Pay availability
Web (desktop)Chrome, Edge, Opera (requires signed-in Google account + saved card)Safari only (macOS)
Web (mobile)Chrome, Safari (requires saved card)Safari only (iOS)
iOS (native)Not availableReal device with Wallet card
Android (native)Real device with Play Services + saved cardNot available
React NativeReal Android deviceReal iOS device

6. Common mistakes (by platform)

MistakeConsequence
All platforms: Calling before initialize()Missing publicApiKey → request fails / empty array
Web: Domain not registered in Google Pay Console (production)DEVELOPER_ERROR in payment sheet
Web: Serving checkout over HTTPGoogle Pay refuses to run
iOS: Merchant ID not configured in XcodeApple Pay check always fails
Android: Missing WebKit dependency or intent queriesGoogle Pay check fails silently
Android: PaymentRequest API not enabledGoogle Pay unavailable in WebView
React Native: Testing Apple Pay on simulatorAlways fails (requires real device)

7. When to use this method

Integration typeDo you need getWalletsAvailable?Why?
Payment Widget (drop-in DEUNA UI)Optional (for pre-warming only)The widget automatically shows/hides wallet buttons based on availability
Payment Vault (headless / custom UI)RequiredYou need to know which wallets to render in your own UI
Pre-warming the SDKRecommendedCalling it at startup caches the wallet, making subsequent calls faster