Hints
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:
-
you get
tokenId
, then one of this:tokenState
isGooglePayTokenState.TOKEN_STATE_NEEDS_IDENTITY_VERIFICATION
, then you need to showAdd to Google Pay
button (yellow path
).tokenState
is NOTGooglePayTokenState.TOKEN_STATE_NEEDS_IDENTITY_VERIFICATION
, then card added to wallet. Do NOT showAdd to Google Pay
button.
-
you need to show
Add to Google Pay
button.
Add card to wallet
We have 2 methods to add card to wallet:
- Do NOT have
tokenId
-> basic flow. Just useMeaPushProvisioning.GooglePay.pushCard(...)
- Have
tokenId
, buttokenState
isGooglePayTokenState.TOKEN_STATE_NEEDS_IDENTITY_VERIFICATION
-> yellow flow. UseMeaPushProvisioning.GooglePay.tokenize(...)
Subscribe to wallet data change events
Simply 2 methods to manage it:
MeaPushProvisioning.GooglePay.registerDataChangedListener
MeaPushProvisioning.GooglePay.removeDataChangedListener
Updated about 1 year ago