Class MeaTokenPlatform
- java.lang.Object
-
- com.meawallet.mtp.MeaTokenPlatform
-
public final class MeaTokenPlatform extends java.lang.Object
Provides API for interaction with the MeaTokenPlatform library using static methods.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
MeaTokenPlatform.CdCvm
Consumer Device Cardholder Verification Method class.static class
MeaTokenPlatform.Configuration
MeaTokenPlatform library configuration information.static class
MeaTokenPlatform.Rns
Remote Notification Service interface.static class
MeaTokenPlatform.StepUpAuth
Step-Up Authentication methods class.
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static void
addTransactionLimit(MeaTransactionLimit transactionLimit, MeaListener listener)
Add or update currency transaction limit.static void
addTransactionLimits(java.util.List<MeaTransactionLimit> transactionLimits, MeaListener listener)
Add or update multiple currency transaction limits.static void
authenticateWithDeviceUnlock()
Informs MTP library that user was successfully authenticated using Device Unlock method.static void
authenticateWithFingerprint(android.app.FragmentManager fragmentManager, MeaListener listener)
Authenticate user for payment using biometric (fingerprint) authenticationstatic void
authenticateWithWalletPin(java.lang.String pin, MeaWalletPinAuthenticationListener listener)
Authenticate user for payment using wallet PIN.static void
changeWalletPin(java.lang.String oldPin, java.lang.String newPin)
Initiates Wallet PIN change.static void
clearAllTransactionLimits(MeaListener listener)
Clear both currency specific transaction limits and default transaction limit value.static void
clearAuthenticationForPayment()
Resets the current authentication state.static void
clearListeners()
Remove all library listeners, including all card listeners.static void
completeAdditionalAuthenticationForDigitization(java.lang.String cardId, java.lang.String authenticationCode, MeaCompleteAuthenticationListener listener)
Completes authentication, if the digitization decision wasMeaDigitizationDecision.REQUIRE_ADDITIONAL_AUTHENTICATION
.static void
completeDigitization(java.lang.String eligibilityReceiptValue, java.lang.String termsAndConditionsAssetId, long termsAndConditionsAcceptTimestamp, java.lang.String securityCode, MeaCompleteDigitizationListener listener)
Proceeds with the card eligibility checks and digitization.static void
delete(MeaListener listener)
Deletes all local MTP storage files.static void
deleteAllCards(MeaListener listener)
Delete all cards, network has to be available when invoke this method.static void
deleteAllPaymentTokens()
Clears payment tokens from all cards in the wallet.static boolean
getAllowPaymentsWhenLocked()
Return current value of allow payments when phone is locked setting.static void
getAsset(java.lang.String assetId, MeaGetAssetListener listener)
Gets static Assets from MDESs and VTSs repositories, such as: Card art, Brand logos, Issuers logos, Terms and Conditions.static MeaCard
getCardByEligibilityReceipt(java.lang.String eligibilityReceipt)
Returns a card for the provided card Eligibility Receipt value.static MeaCard
getCardById(java.lang.String cardId)
Returns a card for the provided card ID.static java.util.List<MeaCard>
getCards()
Returns all digitized cards.static MeaCard
getCardSelectedForContactlessPayment()
Returns selected card for contactless payments.static MeaCard
getDefaultCardForContactlessPayments()
Returns default card for contactless payments.static MeaCard
getDefaultCardForRemotePayments()
Returns default card for digital secure remote payments (DSRP).static java.lang.Integer
getDefaultTransactionLimit()
Returns default transaction limit amount, amount value includes decimals.static void
getPaymentAppInstanceId(MeaGetPaymentAppInstanceIdListener listener)
Returns identifier for the current Mobile Payment App instance, unique across a given Wallet Identifier.static MeaTransactionLimit
getTransactionLimit(java.util.Currency currency)
Get transaction limit for the currency.static java.util.List<MeaTransactionLimit>
getTransactionLimits()
Get saved currency transaction limits.static void
initialize(android.content.Context context)
Initializes the MeaTokenPlatform library.static void
initialize(android.content.Context context, MeaListener listener)
Initializes the MeaTokenPlatform library, initialization is done on a background thread.static void
initializeAdditionalAuthenticationForDigitization(java.lang.String cardId, java.lang.String authenticationMethodId, MeaListener listener)
In situations where the Issuer is not sure about users presences during digitization, the Issuer can choose to request additional authentication.static void
initializeDigitization(MeaInitializeDigitizationParameters params, MeaInitializeDigitizationListener listener)
Initializes the card digitization process.static boolean
isDefaultPaymentApplication(android.content.Context context)
Check if the application is set as default application for payments.static boolean
isInitialized()
Indicates whether the MeaTokenPlatform library has been initialized.static boolean
isMainProcess(android.content.Context context)
Deprecated.static boolean
isRegistered()
Checks if application instance is registered with wallet server.static boolean
isSecureNfcEnabled()
Checks Secure NFC feature is enabled.static boolean
isSecureNfcSupported()
Checks if the device supports Secure NFC functionality.static boolean
isWalletPinSet()
Returns wallet pin state.static void
markAllCardsForDeletion(MeaListener listener)
Changes all cards states to MeaCardState.MARKED_FOR_DELETION and schedules card deletion job.static void
openSecureNfcSettings(android.app.Activity activity)
Starts Android system activity to change Secure NFC settings.static void
register(java.lang.String pushServiceInstanceIdToken, java.lang.String consumerLanguage, MeaListener listener)
Checks device eligibility and registers app to Wallet Service Provider.static void
registerDeviceUnlockReceiver()
Starts android service which registers BroadcastReceiver to detect ACTION_USER_PRESENT (device unlock) broadcast intent, required only for wallets using device unlock authentication.static void
registerPinRequestReceiver(android.content.Context context, MeaPinRequestReceiver pinRequestReceiver)
Registers BroadcastReceiver to handle request for PIN reset or change events.static void
registerTransactionReceiver(android.content.Context context, MeaTransactionReceiver transactionReceiver)
Registers BroadcastReceiver to allow the application to react to the transaction events even when it is not in the foreground.static void
removeAuthenticationListener()
Removes cardholder authentication listener.static void
removeCardProvisionListener()
Removes cards provision listener.static void
removeCardReplenishListener()
Removes card replenish payment tokens listener.static void
removeDefaultTransactionLimit(MeaListener listener)
Removes default transaction limit.static void
removeDeleteStorageDirectoryListener()
Removes delete storage directory listener.static void
removeDigitizedCardStateChangeListener()
Removes digitized card state change listener.static void
removeTransactionLimit(java.util.Currency currency, MeaListener listener)
Remove transaction limit for the currency.static void
removeWalletPinListener()
Removes wallet PIN reset event listener.static void
requestCardholderAuthentication()
Requests cardholder authentication.static void
setAccessToken(java.lang.String accessToken)
Sets access token value.static void
setAllowPaymentsWhenLocked(boolean enabled)
Change the allow payments when phone is locked setting (disabled by default).static void
setAuthenticationListener(MeaAuthenticationListener listener)
Sets cardholder authentication listener class from the wallet level.static void
setCardProvisionListener(MeaCardProvisionListener listener)
Sets listener to receive card Provision events.static void
setCardReplenishListener(MeaCardReplenishListener listener)
Sets listener to receive card replenish payment tokens events.static void
setDefaultPaymentApplication(android.app.Activity activity, int requestCode)
Starts Android system activity to set default application for payments.static void
setDefaultTransactionLimit(int amount, MeaListener listener)
Set default transaction limit.static void
setDeleteStorageDirectoryListener(MeaDeleteStorageDirectoryListener listener)
Sets listener to receive delete storage directory events.static void
setDigitizedCardStateChangeListener(MeaDigitizedCardStateChangeListener listener)
Sets listener to receive digitized card state change events.static void
setWalletPin(java.lang.String pin)
Sets wallet PIN.static void
setWalletPinListener(MeaWalletPinListener listener)
Sets listener to receive wallet PIN events.static void
unregisterPinRequestReceiver(android.content.Context context, MeaPinRequestReceiver pinRequestReceiver)
Unregisters previously registeredMeaPinRequestReceiver
from listening request for PIN reset or change events.static void
unregisterTransactionReceiver(android.content.Context context, MeaTransactionReceiver transactionReceiver)
Unregisters previously registeredMeaTransactionReceiver
from listening transaction events.static void
updateDeviceInfo(java.lang.String pushServiceInstanceIdToken, java.lang.String consumerLanguage, MeaListener listener)
Updates device information after registration, for example when Remote Notification Service token is refreshed.
-
-
-
Method Detail
-
initialize
public static void initialize(@NonNull android.content.Context context) throws InitializationFailedException
Initializes the MeaTokenPlatform library. It is required to call this method before interacting with any other of the MeaTokenPlatform API's.- Parameters:
context
- The Application Context.- Throws:
InitializationFailedException
- if the library initialization fails. UseMeaCheckedException.getErrorCode()
to get failure reason error code.
-
initialize
public static void initialize(@NonNull android.content.Context context, @Nullable MeaListener listener)
Initializes the MeaTokenPlatform library, initialization is done on a background thread. It is required to call this method before interacting with any other of the MeaTokenPlatform API's.Event callbacks are invoked on the Main / UI thread after the initialization on background thread finishes.
- Parameters:
context
- The Application Context.listener
- The listener asMeaListener
interface.
-
isInitialized
public static boolean isInitialized()
Indicates whether the MeaTokenPlatform library has been initialized.- Returns:
- true if initialized, false if not initialized.
-
register
public static void register(@NonNull java.lang.String pushServiceInstanceIdToken, @NonNull java.lang.String consumerLanguage, @Nullable MeaListener listener)
Checks device eligibility and registers app to Wallet Service Provider. Device eligibility check includes whether or not the device is a Mastercard type-approved device, hardware and software compatibility and any applicable Issuer policies related to the device.- Parameters:
pushServiceInstanceIdToken
- Remote Notification Service ID to be used to deliver credentials to the target application instance.consumerLanguage
- Language preference selected by the consumer. Formatted as an ISO-639-1 two-letter language code. Length 2.listener
- The listener asMeaListener
interface.
-
initializeDigitization
public static void initializeDigitization(@NonNull MeaInitializeDigitizationParameters params, @Nullable MeaInitializeDigitizationListener listener)
Initializes the card digitization process. During digitization process the Wallet Service Provider verifies eligibility of the card and returns eligibility receipt.- Parameters:
params
- Instance ofMeaInitializeDigitizationListener
object containing all info for initialising card digitization.listener
- The listener asMeaInitializeDigitizationListener
interface.
-
completeDigitization
public static void completeDigitization(@NonNull java.lang.String eligibilityReceiptValue, @Nullable java.lang.String termsAndConditionsAssetId, long termsAndConditionsAcceptTimestamp, @Nullable java.lang.String securityCode, @Nullable MeaCompleteDigitizationListener listener)
Proceeds with the card eligibility checks and digitization. In response returns digitized card with final digitization decision, which will be one ofMeaDigitizationDecision
:MeaDigitizationDecision.APPROVED
,MeaDigitizationDecision.DECLINED
,MeaDigitizationDecision.REQUIRE_ADDITIONAL_AUTHENTICATION
.For any digitization requests that
MeaDigitizationDecision.REQUIRE_ADDITIONAL_AUTHENTICATION
, Wallet Service Provider will provision the card in an Inactive state and will return a list of availableMeaAuthenticationMethod
.If digitization decision is Approved,
MeaCardState
is set toMeaCardState.DIGITIZED
. If digitization decision is Require Additional Authentication,MeaCardState
is set toMeaCardState.DIGITIZED
andMeaCardYellowPathState
is set toMeaCardYellowPathState.REQUIRE_ADDITIONAL_AUTHENTICATION
.- Parameters:
eligibilityReceiptValue
- TheMeaEligibilityReceipt
value as provided byinitializeDigitization method
. Max length 64.termsAndConditionsAssetId
- The Terms and Conditions to be presented to the Cardholder. Provided as an Asset ID.termsAndConditionsAcceptTimestamp
- The date/time stamp when the Cardholder accepted the Terms and Conditions. Must be expressed in the difference, measured in milliseconds, between the current time and midnight, January 1, 1970 UTC(coordinated universal time). Can be obtained by calling System.currentTimeMillis() method.securityCode
- Conditional. If isSecurityCodeApplicable was set to true in InitializeDigitization response, then it's required.If CVC2 is not used then 000 should be provided. This value is mandatory in MDES, but it's not mandatory for the Issuer to verify it.
listener
- The listener asMeaCompleteDigitizationListener
interface.
-
initializeAdditionalAuthenticationForDigitization
public static void initializeAdditionalAuthenticationForDigitization(@NonNull java.lang.String cardId, @NonNull java.lang.String authenticationMethodId, @Nullable MeaListener listener)
In situations where the Issuer is not sure about users presences during digitization, the Issuer can choose to request additional authentication. Method requests an 'Activation Code' to be sent to authenticate the Card Holder. This can be done for any Authentication Method involving a user-entered Authentication Code.When additional authentication is initialized,
MeaCardYellowPathState
is set toMeaCardYellowPathState.AUTHENTICATION_INITIALIZED
.- Parameters:
cardId
- Card Id (Token Unique Reference).authenticationMethodId
- ID of the Authentication Method selected by the user.listener
- The listener asMeaListener
interface.
-
completeAdditionalAuthenticationForDigitization
public static void completeAdditionalAuthenticationForDigitization(@NonNull java.lang.String cardId, @NonNull java.lang.String authenticationCode, @Nullable MeaCompleteAuthenticationListener listener)
Completes authentication, if the digitization decision wasMeaDigitizationDecision.REQUIRE_ADDITIONAL_AUTHENTICATION
. Note that the user is only given a limited number of attempts to enter a correct Authentication Code (typically 3 attempts), after which the Authentication Code becomes invalid.When additional authentication is completed,
MeaCardYellowPathState
is set toMeaCardYellowPathState.AUTHENTICATION_COMPLETE
.- Parameters:
cardId
- Card Id (Token Unique Reference).authenticationCode
- The Authentication Code as entered by the Cardholder (or entered by other means) to activate the Card.listener
- The listener asMeaCompleteAuthenticationListener
interface.
-
getAsset
public static void getAsset(@NonNull java.lang.String assetId, @Nullable MeaGetAssetListener listener)
Gets static Assets from MDESs and VTSs repositories, such as: Card art, Brand logos, Issuers logos, Terms and Conditions. Every Asset in the repository is referenced using an Asset ID. Once an Asset has been assigned to an Asset ID, the contents of the Asset will not change.- Parameters:
assetId
- Asset ID value used to reference an Asset.listener
- The listener asMeaGetAssetListener
interface.
-
isRegistered
public static boolean isRegistered() throws NotInitializedException
Checks if application instance is registered with wallet server.- Returns:
- Mea Token Platform registration status value as Boolean.
- Throws:
NotInitializedException
- if library is not initialized.
-
getCardById
@Nullable public static MeaCard getCardById(@NonNull java.lang.String cardId) throws NotInitializedException, NotRegisteredException, InvalidInputException
Returns a card for the provided card ID. In the case of an MDES solution the unique card ID to be used is the Token Unique Reference for the card.- Parameters:
cardId
- Unique Card Id as String.- Returns:
MeaCard
object instance for provided card ID.- Throws:
NotInitializedException
- if library is not initialized.NotRegisteredException
- if library is not registered.InvalidInputException
- if invalid input data is provided.
-
getCardByEligibilityReceipt
@Nullable public static MeaCard getCardByEligibilityReceipt(@NonNull java.lang.String eligibilityReceipt) throws NotInitializedException, NotRegisteredException, InvalidInputException
Returns a card for the provided card Eligibility Receipt value.- Parameters:
eligibilityReceipt
- Unique card Eligibility Receipt value as String.- Returns:
MeaCard
object instance for provided card Eligibility Receipt.- Throws:
NotInitializedException
- if library is not initialized.NotRegisteredException
- if library is not registered.InvalidInputException
- if invalid input data is provided.
-
getCards
@NonNull public static java.util.List<MeaCard> getCards() throws NotInitializedException, NotRegisteredException, MeaException
Returns all digitized cards.- Returns:
- list of
MeaCard
object instances. - Throws:
NotInitializedException
- if library is not initialized.NotRegisteredException
- if library is not registered.MeaException
- if any other error occurred while processing method.
-
markAllCardsForDeletion
public static void markAllCardsForDeletion(@Nullable MeaListener listener)
Changes all cards states to MeaCardState.MARKED_FOR_DELETION and schedules card deletion job. When network connection will be available card deletion job will be executed and all cards with state MeaCardState.MARKED_FOR_DELETION will be deleted.- Parameters:
listener
- The listener asMeaListener
interface, success callback is invoked when cards are marked for deletion.
-
deleteAllCards
public static void deleteAllCards(@Nullable MeaListener listener)
Delete all cards, network has to be available when invoke this method.- Parameters:
listener
- The listener asMeaListener
interface, success callback is invoked when cards are deleted both remotely and from local storage.
-
getCardSelectedForContactlessPayment
@Nullable public static MeaCard getCardSelectedForContactlessPayment() throws NotInitializedException, NotRegisteredException
Returns selected card for contactless payments.- Returns:
- selected for contactless payment
MeaCard
object instance. - Throws:
NotInitializedException
- if library is not initialized.NotRegisteredException
- if library is not registered.
-
getDefaultCardForContactlessPayments
@Nullable public static MeaCard getDefaultCardForContactlessPayments() throws NotInitializedException, NotRegisteredException
Returns default card for contactless payments.- Returns:
- default card for contactless payments
MeaCard
object instance. - Throws:
NotInitializedException
- if library is not initialized.NotRegisteredException
- if library is not registered.
-
getDefaultCardForRemotePayments
@Nullable public static MeaCard getDefaultCardForRemotePayments() throws NotInitializedException, NotRegisteredException
Returns default card for digital secure remote payments (DSRP).- Returns:
- default card for digital secure remote payments
MeaCard
object instance. - Throws:
NotInitializedException
- if library is not initialized.NotRegisteredException
- if library is not registered.
-
isDefaultPaymentApplication
public static boolean isDefaultPaymentApplication(@NonNull android.content.Context context)
Check if the application is set as default application for payments.- Parameters:
context
- Context instance- Returns:
- True/False if the application is set as default application for payments.
-
setDefaultPaymentApplication
public static void setDefaultPaymentApplication(@NonNull android.app.Activity activity, int requestCode)
Starts Android system activity to set default application for payments.- Parameters:
activity
- Calling activity.requestCode
- Request Code to be used in onActivityResult.
-
deleteAllPaymentTokens
public static void deleteAllPaymentTokens() throws NotInitializedException, NotRegisteredException, MeaCardException, MeaException
Clears payment tokens from all cards in the wallet.- Throws:
NotInitializedException
- if library is not initialized.NotRegisteredException
- if library is not registered.MeaCardException
- if exception occurred while executing Card operation.MeaException
- if any other error occurred while processing method.
-
isWalletPinSet
public static boolean isWalletPinSet() throws NotInitializedException
Returns wallet pin state.- Returns:
- True/False if wallet PIN is set.
- Throws:
NotInitializedException
- if library is not initialized.
-
setWalletPin
public static void setWalletPin(@NonNull java.lang.String pin) throws NotInitializedException, InvalidInputException
Sets wallet PIN. Applies to Wallet PIN wallets only. A wallet PIN is set once and is then used across all cards.- Parameters:
pin
- Wallet PIN to be set- Throws:
NotInitializedException
- if library is not initialized.InvalidInputException
- if invalid input data is provided.
-
changeWalletPin
public static void changeWalletPin(@NonNull java.lang.String oldPin, @NonNull java.lang.String newPin) throws NotInitializedException, InvalidInputException
Initiates Wallet PIN change.- Parameters:
oldPin
- Old card Mobile PIN as StringnewPin
- New card Mobile PIN as String- Throws:
NotInitializedException
- if library is not initialized.InvalidInputException
- if invalid input data is provided.
-
setAuthenticationListener
public static void setAuthenticationListener(@Nullable MeaAuthenticationListener listener)
Sets cardholder authentication listener class from the wallet level.- Parameters:
listener
- Authentication callback listener.
-
removeAuthenticationListener
public static void removeAuthenticationListener()
Removes cardholder authentication listener.
-
requestCardholderAuthentication
public static void requestCardholderAuthentication() throws NotInitializedException
Requests cardholder authentication. This can be called before or during the transaction to determine the correct authentication. This method will trigger one ofMeaAuthenticationListener
method callbacks.- Throws:
NotInitializedException
- if library is not initialized.
-
registerDeviceUnlockReceiver
public static void registerDeviceUnlockReceiver() throws NotInitializedException, MeaException
Starts android service which registers BroadcastReceiver to detect ACTION_USER_PRESENT (device unlock) broadcast intent, required only for wallets using device unlock authentication.Starting from Android 8.0 or higher apps can no longer register broadcast receivers for implicit broadcasts (ACTION_USER_PRESENT) in the Android Manifest, apps have to register receiver at runtime to receive broadcast.
Service should be started in app activity onResume() method, because starting from Android 8.0 service can be stopped even if app its self is not stopped.
- Throws:
NotInitializedException
- if library is not initialized.MeaException
- if any other error occurred while processing method.
-
authenticateWithDeviceUnlock
public static void authenticateWithDeviceUnlock() throws NotInitializedException
Informs MTP library that user was successfully authenticated using Device Unlock method.- Throws:
NotInitializedException
- if library is not initialized.
-
authenticateWithWalletPin
public static void authenticateWithWalletPin(@NonNull java.lang.String pin, @Nullable MeaWalletPinAuthenticationListener listener)
Authenticate user for payment using wallet PIN.- Parameters:
pin
- Wallet PIN.listener
- Wallet PIN authentication listener.
-
authenticateWithFingerprint
public static void authenticateWithFingerprint(@NonNull android.app.FragmentManager fragmentManager, @Nullable MeaListener listener)
Authenticate user for payment using biometric (fingerprint) authentication- Parameters:
fragmentManager
- Fragment manager - used to show fingerprint dialog fragment.listener
- Listen for fingerprint authentication results.
-
clearAuthenticationForPayment
public static void clearAuthenticationForPayment() throws NotInitializedException
Resets the current authentication state. If authentication was previously granted, this will remove it.- Throws:
NotInitializedException
- if library is not initialized.
-
delete
public static void delete(@Nullable MeaListener listener)
Deletes all local MTP storage files.- Parameters:
listener
-MeaListener
object instance.
-
setCardProvisionListener
public static void setCardProvisionListener(@Nullable MeaCardProvisionListener listener)
Sets listener to receive card Provision events.- Parameters:
listener
-MeaCardProvisionListener
listener
-
removeCardProvisionListener
public static void removeCardProvisionListener()
Removes cards provision listener.
-
setCardReplenishListener
public static void setCardReplenishListener(@Nullable MeaCardReplenishListener listener)
Sets listener to receive card replenish payment tokens events.- Parameters:
listener
-MeaCardReplenishListener
listener
-
removeCardReplenishListener
public static void removeCardReplenishListener()
Removes card replenish payment tokens listener.
-
setDigitizedCardStateChangeListener
public static void setDigitizedCardStateChangeListener(@Nullable MeaDigitizedCardStateChangeListener listener)
Sets listener to receive digitized card state change events.MeaDigitizedCardStateChangeListener.onStateChanged(MeaCard, MeaCardState)
callback is triggered when card state is changed to PROVISIONED, PROVISION_FAILED, ACTIVE, SUSPENDED, DEACTIVATED and MARKED_FOR_DELETION.- Parameters:
listener
-MeaDigitizedCardStateChangeListener
listener
-
removeDigitizedCardStateChangeListener
public static void removeDigitizedCardStateChangeListener()
Removes digitized card state change listener.
-
setDeleteStorageDirectoryListener
public static void setDeleteStorageDirectoryListener(@Nullable MeaDeleteStorageDirectoryListener listener)
Sets listener to receive delete storage directory events.MeaDeleteStorageDirectoryListener.onStorageDirectoryDeleted(int)
callback is triggered when App or internal SDK process initiates deletion of storage directory.- Parameters:
listener
-MeaDeleteStorageDirectoryListener
listener
-
removeDeleteStorageDirectoryListener
public static void removeDeleteStorageDirectoryListener()
Removes delete storage directory listener.
-
setWalletPinListener
public static void setWalletPinListener(@Nullable MeaWalletPinListener listener)
Sets listener to receive wallet PIN events.- Parameters:
listener
- Wallet PIN listener asMeaWalletPinListener
interface.
-
removeWalletPinListener
public static void removeWalletPinListener()
Removes wallet PIN reset event listener.
-
clearListeners
public static void clearListeners()
Remove all library listeners, including all card listeners.
-
registerTransactionReceiver
public static void registerTransactionReceiver(android.content.Context context, MeaTransactionReceiver transactionReceiver)
Registers BroadcastReceiver to allow the application to react to the transaction events even when it is not in the foreground. The MTP library contains abstractMeaTransactionReceiver
helper class, which application developers should extend and override abstract methods to simplify intent data handling.- Parameters:
context
- Context instancetransactionReceiver
- instance of class extendingMeaTransactionReceiver
-
registerPinRequestReceiver
public static void registerPinRequestReceiver(android.content.Context context, MeaPinRequestReceiver pinRequestReceiver)
Registers BroadcastReceiver to handle request for PIN reset or change events. The MTP library contains abstractMeaPinRequestReceiver
helper class, which application developers should extend and override abstract methods to listen for events.- Parameters:
context
- Context instancepinRequestReceiver
- instance of class extendingMeaPinRequestReceiver
-
unregisterTransactionReceiver
public static void unregisterTransactionReceiver(android.content.Context context, MeaTransactionReceiver transactionReceiver)
Unregisters previously registeredMeaTransactionReceiver
from listening transaction events.- Parameters:
context
- Context instancetransactionReceiver
- instance of class extendingMeaTransactionReceiver
-
unregisterPinRequestReceiver
public static void unregisterPinRequestReceiver(android.content.Context context, MeaPinRequestReceiver pinRequestReceiver)
Unregisters previously registeredMeaPinRequestReceiver
from listening request for PIN reset or change events.- Parameters:
context
- Context instancepinRequestReceiver
- instance of class extendingMeaPinRequestReceiver
-
getPaymentAppInstanceId
public static void getPaymentAppInstanceId(@Nullable MeaGetPaymentAppInstanceIdListener listener)
Returns identifier for the current Mobile Payment App instance, unique across a given Wallet Identifier. Identifier is deleted whendelete(MeaListener)
method is invoked and new value is generated when nextinitialize(android.content.Context)
method is invoked.- Parameters:
listener
-MeaGetPaymentAppInstanceIdListener
object instance.
-
setAllowPaymentsWhenLocked
public static void setAllowPaymentsWhenLocked(boolean enabled) throws NotInitializedException, MeaDeviceLockedException
Change the allow payments when phone is locked setting (disabled by default). If this is enabled, payments which do not require on-device authentication can be performed even if the screen is locked.Although this has no impact in device state when the screen of the device is turned off, because current Android implementations turn the NFC controller and the application processor off completely.
- Parameters:
enabled
- value for contactless payment availability when device screen is locked as Boolean.- Throws:
NotInitializedException
- if library is not initialized.MeaDeviceLockedException
- if device is locked.
-
getAllowPaymentsWhenLocked
public static boolean getAllowPaymentsWhenLocked() throws NotInitializedException
Return current value of allow payments when phone is locked setting.- Returns:
- value for contactless payment availability when device screen is locked as Boolean.
- Throws:
NotInitializedException
- if library is not initialized.
-
updateDeviceInfo
public static void updateDeviceInfo(@Nullable java.lang.String pushServiceInstanceIdToken, @Nullable java.lang.String consumerLanguage, @Nullable MeaListener listener)
Updates device information after registration, for example when Remote Notification Service token is refreshed.- Parameters:
pushServiceInstanceIdToken
- Remote Notification Service ID to be used to deliver credentials to the target application instance.consumerLanguage
- Language preference selected by the consumer. Formatted as an ISO-639-1 two-letter language code. Length 2.listener
- The listener asMeaListener
interface.
-
isSecureNfcSupported
public static boolean isSecureNfcSupported() throws NotInitializedException
Checks if the device supports Secure NFC functionality.- Returns:
- boolean True if device supports Secure NFC, false otherwise
- Throws:
NotInitializedException
- if library is not initialized.
-
isSecureNfcEnabled
public static boolean isSecureNfcEnabled() throws NotInitializedException
Checks Secure NFC feature is enabled.- Returns:
- boolean True if Secure NFC is enabled, false otherwise
- Throws:
NotInitializedException
- if library is not initialized.
-
openSecureNfcSettings
public static void openSecureNfcSettings(@NonNull android.app.Activity activity)
Starts Android system activity to change Secure NFC settings.- Parameters:
activity
- Calling activity.
-
setAccessToken
public static void setAccessToken(@Nullable java.lang.String accessToken)
Sets access token value.- Parameters:
accessToken
- access token value as String.
-
addTransactionLimit
public static void addTransactionLimit(@NonNull MeaTransactionLimit transactionLimit, @Nullable MeaListener listener)
Add or update currency transaction limit.- Parameters:
transactionLimit
- Transaction limit.listener
- The listener asMeaListener
interface.
-
addTransactionLimits
public static void addTransactionLimits(@NonNull java.util.List<MeaTransactionLimit> transactionLimits, @Nullable MeaListener listener)
Add or update multiple currency transaction limits.- Parameters:
transactionLimits
- Transaction limits.listener
- The listener asMeaListener
interface.
-
getTransactionLimit
@Nullable public static MeaTransactionLimit getTransactionLimit(@NonNull java.util.Currency currency) throws NotInitializedException
Get transaction limit for the currency.- Parameters:
currency
- Currency as instance ofCurrency
object to get limit for.- Returns:
- The transaction limit as instance of
MeaTransactionLimit
object. - Throws:
NotInitializedException
- if library is not initialized.
-
getTransactionLimits
@NonNull public static java.util.List<MeaTransactionLimit> getTransactionLimits() throws NotInitializedException
Get saved currency transaction limits.- Returns:
- List of transaction limits.
- Throws:
NotInitializedException
- if library is not initialized.
-
removeTransactionLimit
public static void removeTransactionLimit(@NonNull java.util.Currency currency, @Nullable MeaListener listener)
Remove transaction limit for the currency.- Parameters:
currency
- The currency, which limit should be removed.listener
- The listener asMeaListener
interface.
-
getDefaultTransactionLimit
@Nullable public static java.lang.Integer getDefaultTransactionLimit() throws NotInitializedException
Returns default transaction limit amount, amount value includes decimals. The last two digits of value are decimals. 10000 = 100.00 EUR. Default transaction limit is used always when currency don't have its explicitly defined transaction limit. If both currency specific limit and default limit are not set, then for this currency library will not check transaction amount.- Returns:
- Returns default transaction limit max amount, amount value includes decimals.
- Throws:
NotInitializedException
- if library is not initialized.
-
setDefaultTransactionLimit
public static void setDefaultTransactionLimit(int amount, @Nullable MeaListener listener)
Set default transaction limit. Default transaction limit is used always when currency don't have its explicitly defined transaction limit. If both currency specific limit and default limit are not set, then for this currency library will not check transaction amount.- Parameters:
amount
- Default transaction limit max amount, amount value includes decimals. 10000 = 100.00 EUR.listener
- The listener asMeaListener
interface.
-
removeDefaultTransactionLimit
public static void removeDefaultTransactionLimit(@Nullable MeaListener listener)
Removes default transaction limit. Default transaction limit is used always when currency don't have its explicitly defined transaction limit.- Parameters:
listener
- The listener asMeaListener
interface.
-
clearAllTransactionLimits
public static void clearAllTransactionLimits(@Nullable MeaListener listener)
Clear both currency specific transaction limits and default transaction limit value.- Parameters:
listener
- The listener asMeaListener
interface.
-
isMainProcess
@Deprecated public static boolean isMainProcess(@NonNull android.content.Context context)
Deprecated.
-
-