Package com.gemalto.mfs.mwsdk.dcm
Class DigitalizedCardManager
java.lang.Object
com.gemalto.mfs.mwsdk.dcm.DigitalizedCardManager
This serves as the entry point to the Digitalized Card Manager Module. All
methods here are asynchronous. The callback methods are defined by the parameter
AbstractAsyncHandler. This parameter defines the data type that is expected
to be returned by each method.
The return value AsyncToken has a method call that waits in the calling
thread until the operation has finished. This method will return the
corresponding AsyncResult that contains the expected output of
each method. It is important to note that this wait blocks the
calling thread.
The AsyncHandler parameter is optional. If this is not defined, the caller of
the operation is expected to call
AsyncToken.waitToComplete() to be
notified of the result of the operation.-
Method Summary
Modifier and TypeMethodDescriptionstatic AsyncToken<String[]>getAllCards(AbstractAsyncHandler<String[]> handler) Retrieves the tokenized IDs of all digitalized cards.static AsyncToken<String>getDefault(PaymentType type, AbstractAsyncHandler<String> handler) Retrieves the tokenized ID of the default card, if any.static StringgetDigitalCardId(String tokenizedCardId) Retrieves the digital card ID from storage based on the tokenized card ID provided.static DigitalizedCardgetDigitalizedCard(String tokenizedCardId) Creates a DigitalizedCard instance for the given tokenized card ID.static StringgetTokenizedCardId(String digitalCardId) Retrieves the tokenized card ID from storage based on the digitalized card ID provided.static longThis API allows MPA to know when the next scheduled time slot is for tokenSync.static voidinvokeTokenSync(TokenSyncListener listener) Invokes the token synchronisation process.static booleanThis API is used to check whether the token synchronisation process is allowed.static AsyncToken<Void>unsetDefaultCard(PaymentType type, AbstractAsyncHandler<Void> handler) Removes the current default card status.
-
Method Details
-
getAllCards
Retrieves the tokenized IDs of all digitalized cards.- Parameters:
handler- The handler that is responsible for processing the result of the operation.- Returns:
- The AsyncToken<String[]> token that may be used to wait for the result of the asynchronous operation.
-
unsetDefaultCard
public static AsyncToken<Void> unsetDefaultCard(PaymentType type, AbstractAsyncHandler<Void> handler) Removes the current default card status.- Parameters:
type- The payment typePaymentType.handler- The handler that is responsible for processing the result of the operation.- Returns:
- The AsyncToken
token that may be used to wait for the result of the asynchronous operation.
-
getDefault
Retrieves the tokenized ID of the default card, if any. Otherwise, AsyncResultwill contain null as the result. - Parameters:
type- The payment type.handler- The handler that will be responsible for processing the result of the operation- Returns:
- The AsyncToken
token that may be used to wait for the result of the asynchronous operation.
-
getDigitalizedCard
Creates a DigitalizedCard instance for the given tokenized card ID. This call does not perform any check or database operation. It only creates theDigitalizedCardobject. So the best practice is the developer needs to ensure that the tokenized card ID is valid and exists in the database.- Parameters:
tokenizedCardId- The tokenized card ID to be used when creating a DigitalizedCard instance.- Returns:
- A new DigitalizedCard instance.
-
getDigitalCardId
Retrieves the digital card ID from storage based on the tokenized card ID provided. The digital card ID is defined in the card profile as dc.tokenId.- Parameters:
tokenizedCardId- The digital token(Token unique reference) of the PAN.- Returns:
- The digital card ID in String format. If the corresponding digital card ID is not found for the token ID, then result will be null.
-
getTokenizedCardId
Retrieves the tokenized card ID from storage based on the digitalized card ID provided.- Parameters:
digitalCardId- The digitized card ID shared by the HCE platform components (Different than token ID).- Returns:
- The string of tokenized card ID. If the corresponding tokenized card ID is not found for the digital card ID, then the result will be null.
-
isTokenSyncAllowed
public static boolean isTokenSyncAllowed()This API is used to check whether the token synchronisation process is allowed.- Returns:
- A true value if the token synchronisation process is allowed. Otherwise, a false value is returned.
- Since:
- 6.2.0
-
invokeTokenSync
Invokes the token synchronisation process.- Parameters:
listener- The listener that is responsible for processing the result of the token synchronisation operation.- Since:
- 6.2.0
-
getTokenSyncSchedule
public static long getTokenSyncSchedule()This API allows MPA to know when the next scheduled time slot is for tokenSync.- Returns:
- Future timestamp in milliseconds. The data returned can be from current week or next week depending on whether the scheduled slot of current week is exhausted.
- Since:
- 6.2.0
-