Interface GooglePayManager

Error codes of the ApiException:

  • 15002: No active wallet
  • 15003: Token not found
  • 15004: Invalid token state
  • 15005: Attestation error
  • 15009: Unavailable
  • 15019: Save card error
  • 15021: Ineligible for tokenization
  • 15022: Tokenization declined
  • 15023: Check eligibility error
  • 15024: Tokenize error
  • 15025: Token activation required
  • 15026: Payment credentials delivery timeout
  • 15027: User canceled flow
  • 15028: Enroll for virtual cards failed
interface GooglePayManager {
    createWallet(): Promise<void>;
    getActiveWalletId(): Promise<null | string>;
    getEnvironment(): Promise<string>;
    getStableHardwareId(): Promise<string>;
    getTokenStatus(tokenServiceProvider: GooglePayTokenServiceProvider, tokenId: string): Promise<null | GooglePayTokenStatus>;
    isTokenized(fpanLastFour: string, network: GooglePayCardNetwork, tokenServiceProvider: GooglePayTokenServiceProvider): Promise<boolean>;
    listTokens(): Promise<GooglePayTokenInfo[]>;
    pushTokenize(request: GooglePayPushTokenizeRequest): Promise<null | string>;
    requestDeleteToken(tokenId: string, tokenServiceProvider: GooglePayTokenServiceProvider): Promise<void>;
    requestSelectToken(tokenId: string, tokenServiceProvider: GooglePayTokenServiceProvider): Promise<void>;
    subscribe(listener: (() => void)): Unsubscribe;
    tokenize(request: GooglePayTokenizeRequest): Promise<null | string>;
    viewToken(tokenId: string, tokenServiceProvider: GooglePayTokenServiceProvider): Promise<boolean>;
}

Methods

  • Some issuers may need the active wallet ID before creating an opaque payment card for push provisioning. If the wallet ID does not need to be included in the opaque payment card, simply let the tokenize and pushTokenize manage wallet creation automatically.

    Note: This operation requires the user interaction, consider using ActivityManager.runUserInteraction to ensure that consequent UI-related operations are suspended until this one is completed.

    Returns Promise<void>

    ApiException

    Android Push Provisioning API

  • Get the stable hardware ID of the device.

    Each physical Android device has a stable hardware ID which is consistent between wallets for a given device. This ID will change as a result of a factory reset.

    The stable hardware ID may only be used for the following purposes:

    • To encrypt inside OPC and provide back to Google Pay for push provisioning;
    • To make a risk decision (without storing the value) before the start of a Push Provisioning flow.

    The stable hardware ID received through the client API must not be used for the following purposes:

    • Stored by the issuer locally or at the backend;
    • Track user activity.

    The stable hardware ID may not be accessed by the issuer outside the Push Provisioning flow.

    Returns Promise<string>

    ApiException

    Android Push Provisioning API

  • Returns the token status for a token in the active wallet, or null if there's no active wallet or no such token.

    The Push Provisioning API caches status values retrieved from the networks and makes a best effort to keep these cached values up-to-date. However, in some cases the values returned here may be different from the network values. For example, if a user has cleared data so that the token is no longer on the device, then null is returned.

    Parameters

    Returns Promise<null | GooglePayTokenStatus>

    ApiException

    Android Push Provisioning API

  • Searches the wallet for a token and returns true if found, or false otherwise.

    Parameters

    Returns Promise<boolean>

    true if it finds a token with same last four FPAN digits as the identifier, as well as matches on the other fields. False positives may be returned since the last four FPAN digits are not necessarily unique among tokens.

    ApiException

    Android Push Provisioning API

  • Get all tokens available in the wallet. An empty list if there's no active wallet.

    The API only returns token details for tokens with metadata matching your app package name. You can check if your tokens have this linking by tapping on the card in the Google Wallet app to see the card details view.

    Returns Promise<GooglePayTokenInfo[]>

    ApiException

    Android Push Provisioning API

  • Brings up a dialog asking the user to confirm the deletion of the indicated token.

    Deleting the token does not affect the card-on-file on the user's Google account if one exists. To delete a card-on-file, the user would need to go to the Google Payments Center or use the Google Wallet app.

    Note: This operation requires the user interaction, consider using ActivityManager.runUserInteraction to ensure that consequent UI-related operations are suspended until this one is completed.

    Parameters

    Returns Promise<void>

    ApiException

    Android Push Provisioning API

  • The Push Provisioning API will immediately call a listener whenever the following events occur:

    • The active wallet changes (by changing the active account);
    • The selected card of the active wallet changes;
    • Tokenized cards are added or removed from the active wallet;
    • The status of a token in the active wallet changes.

    Registering for these broadcasts allows an app to re-query information about their digitized cards whenever the user makes a change.

    Parameters

    • listener: (() => void)
        • (): void
        • Returns void

    Returns Unsubscribe

  • Starts the manual tokenization flow in which the user needs to scan the card or enter all card details manually in a form. Tokens added using this method are added to the active wallet.

    Important: This method is primarily used for activating tokens pending yellow path activation. It can also be used as a fallback in error handling (e.g. if the app cannot retrieve an OPC because your server is down). However, it should not be used as a substitute for a proper push provisioning integration.

    Note: This operation requires the user interaction, consider using ActivityManager.runUserInteraction to ensure that consequent UI-related operations are suspended until this one is completed.

    Parameters

    Returns Promise<null | string>

    The token ID, or null if tokenization wasn't completed.

    ApiException

    Android Push Provisioning API