Interface ProvisioningBusinessService

All Superinterfaces:
BusinessService

public interface ProvisioningBusinessService extends BusinessService
This service is responsible to communicate to CPS and entertain the requests received from CPS via push notifications. Cards profiles and card credentials are received in the application through this service.

There are two modes of operations
  • Push mode: CPS will send the push to perform actions
  • Pull mode: Application needs to do a operation, so application will ask to CPS to send the push payload
  • Method Details

    • processIncomingMessage

      void processIncomingMessage(android.os.Bundle pushMessageBundle, PushServiceListener listener)
      Processes the received push message. If the message is not supported, it sends the message back to the application. The push message shall trigger the conversation to take place and the CPS will be sending the commands to the SDK
      This is a push mode operation, CPS can send push notification to sdk any time even the application is in background.
      Parameters:
      pushMessageBundle - received push message bundle from GCM (payload from CPS in the bundle)
      listener - PushServicelistener to send callback to the application.
    • retrySession

      A mechanism to retry the server request in the event that there is an error received which can be a timeout or no/weak network coverage.
      NOTE: Retry can only be done if the (com.gemalto.mfs.mwsdk.provisioning.model.ProvisioningServiceError) is called. The SDK is doing internal retries for a certain period of time before it triggers the PushServiceListener callbacks. If called before the callback, this method will throw ExistingRetrySessionException.
      Parameters:
      listener - PushServicelistener to send callback to the application.
      Throws:
      ExistingRetrySessionException - thrown if there is an ongoing retry
      NoSessionException - thrown if the GCM push message containing the conversation ID to initiate the server session is not yet received
    • getCodeType

      During the activation phase, the end user may be required to enter the mobile PIN. In such a use case, the user will be asked to enter an activation code, followed by the mobile pin.

      Once the listener EnrollingServiceListener.onCodeRequired(com.gemalto.mfs.mwsdk.utils.chcodeverifier.CHCodeVerifier) has been invoked, the MPA may use this method to understand which input is expected from the end user.
      Returns:
      ProvisioningServiceCodeType
    • sendActivationCode

      void sendActivationCode(EnrollingServiceListener listener)
      Sends the request to CPS to verify the activation code entered by user.
      After enrollment, application needs to verify activation code in order to start the provision the card and credentials for the card
      Parameters:
      listener - - EnrollingServiceListener service listener to provide the code and callback after completion the request
    • sendActivationCode

      void sendActivationCode(EnrollingServiceListener listener, ProvisioningServicePinType pinType)
      If this is invoked, then the end user will be required to enter the following in order:
      1. Activation code
      2. PIN - the type of PIN will be dictated by the pinType
      Both user inputs will be invoked through the EnrollingServiceListener.onCodeRequired(com.gemalto.mfs.mwsdk.utils.chcodeverifier.CHCodeVerifier) . Once inside the callback function, the MPA developer will be able to distinguish which input is required by calling getCodeType(). IMPORTANT: If pinType is ProvisioningServicePinType.NONE is entered, then the activation will proceed, and will require the user to enter the activation code ONLY. No other user input will follow.
      Parameters:
      pinType - - indicates which pin type the end-user is expected to enter @see ProvisioningServicePinType
      See Also:
    • sendRequestForReplenishment

      void sendRequestForReplenishment(String tokenizedCardId, PushServiceListener listener)
      This is a pull mode request to CPS server to replenish the card.
      When the card is out of credentials, then application may need to ask for credentials to server to continue to the payments.
      After this request, CPS server will send a push for the credentials.
      Parameters:
      tokenizedCardId - - card id to replenish.
      listener - - PushServicelistener to send callback to the application.
    • sendRequestForReplenishment

      void sendRequestForReplenishment(String tokenizedCardId, PushServiceListener listener, boolean isForceReplenishment)
      This is a pull mode request to CPS server to replenish the card.
      When the card is out of credentials, then application may need to ask for credentials to server to continue to the payments.
      After this request, CPS server will send a push for the credentials.
      Parameters:
      tokenizedCardId - - card id to replenish.
      listener - - PushServicelistener to send callback to the application.
      isForceReplenishment - - Boolean flag for MPA to force replenishment request call even if replenishment is not needed for the selected card.
    • updatePushToken

      void updatePushToken(String pushToken, PushServiceListener listener)
      This is a pull mode request to CPS server to update the GCM token.
      Parameters:
      pushToken - - GCM push token.
      listener - - PushServicelistener to send callback to the application.
    • getAccessToken

      void getAccessToken(String digitalCardId, GetAccessTokenMode refresh, AccessTokenListener listener)
      This is a pull mode request to CPS server to retrieve access token.
      Parameters:
      digitalCardId - - Digitalized card identifier.
      Digitized card ID shared by the HCE platform components (Different than token ID)
      refresh - - Indicates should access token be retrieved from CPS server, else will be retrieved from library's storage.
      listener - - AccessTokenListener to send callback to the application.
    • sendRequestForODACertificateRenewal

      void sendRequestForODACertificateRenewal(String tokenizedCardId, PushServiceListener listener)
      This is a pull mode request to CPS server to renew ODA certificate.
      Parameters:
      tokenizedCardId - - Digitalized card identifier.
      listener - - PushServiceListener to send callback to the application.
    • sendRequestForODACertificateRenewal

      void sendRequestForODACertificateRenewal(String tokenizedCardId, boolean forceRenewal, PushServiceListener listener)
      This is a pull mode request to CPS server to renew ODA certificate.
      Parameters:
      tokenizedCardId - - Digitalized card identifier.
      forceRenewal - - force renew for ODA cert.
      listener - - PushServiceListener to send callback to the application.
      Since:
      6.11
    • getReplenishmentPrepService

      ReplenishmentPrepService getReplenishmentPrepService()
      This returns ReplenishmentPrepService to be used for preparation before replenishment.
      Returns:
      ReplenishmentPrepService