Class DigitalizedCardManager

java.lang.Object
com.gemalto.mfs.mwsdk.dcm.DigitalizedCardManager

public final class DigitalizedCardManager extends Object
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 Details

    • getAllCards

      public static AsyncToken<String[]> getAllCards(AbstractAsyncHandler<String[]> handler)
      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 type PaymentType.
      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

      public static AsyncToken<String> getDefault(PaymentType type, AbstractAsyncHandler<String> handler)
      Retrieves the tokenized ID of the default card, if any. Otherwise, AsyncResult will 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

      public static DigitalizedCard getDigitalizedCard(String tokenizedCardId)
      Creates a DigitalizedCard instance for the given tokenized card ID. This call does not perform any check or database operation. It only creates the DigitalizedCard object. 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

      public static String getDigitalCardId(String tokenizedCardId)
      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

      public static String getTokenizedCardId(String digitalCardId)
      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

      public static void invokeTokenSync(TokenSyncListener listener)
      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