Main steps

Simple explanation how to use methods of the SDK.

Initialize SDK

Need to Initialize SDK by this method

Check the presence of the card in the wallet

At first we may try to use MeaPushProvisioning.GooglePay.checkWalletForCardToken(...) to get tokenId and tokenState.

If previous method did not find any then we may try with MeaPushProvisioning.GooglePay.getRegisteredTokens(...)

Possible cases:

  1. you get tokenId, then one of this:

    • tokenState is GooglePayTokenState.TOKEN_STATE_NEEDS_IDENTITY_VERIFICATION, then you need to show Add to Google Pay button (yellow path).
    • tokenState is NOT GooglePayTokenState.TOKEN_STATE_NEEDS_IDENTITY_VERIFICATION, then card added to wallet. Do NOT show Add to Google Pay button.
  2. you need to show Add to Google Pay button.

Add card to wallet

We have 2 methods to add card to wallet:

  1. Do NOT have tokenId -> basic flow. Just use MeaPushProvisioning.GooglePay.pushCard(...)
  2. Have tokenId, but tokenState is GooglePayTokenState.TOKEN_STATE_NEEDS_IDENTITY_VERIFICATION -> yellow flow. Use MeaPushProvisioning.GooglePay.tokenize(...)

Subscribe to wallet data change events

Simply 2 methods to manage it:

  • MeaPushProvisioning.GooglePay.registerDataChangedListener
  • MeaPushProvisioning.GooglePay.removeDataChangedListener

Read here about them