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 Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
getAccessToken(java.lang.String digitalCardId, GetAccessTokenMode refresh, AccessTokenListener listener)
This is a pull mode request to CPS server to retrieve access token.ProvisioningServiceCodeType
getCodeType()
During the activation phase, the end user may be required to enter the mobile PIN.ReplenishmentPrepService
getReplenishmentPrepService()
This returns ReplenishmentPrepService to be used for preparation before replenishment.void
processIncomingMessage(android.os.Bundle pushMessageBundle, PushServiceListener listener)
Processes the received push message.void
retrySession(PushServiceListener listener)
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.void
sendActivationCode(EnrollingServiceListener listener)
Sends the request to CPS to verify the activation code entered by user.void
sendActivationCode(EnrollingServiceListener listener, ProvisioningServicePinType pinType)
If this is invoked, then the end user will be required to enter the following in order: Activation code PIN - the type of PIN will be dictated by the pinType Both user inputs will be invoked through theEnrollingServiceListener.onCodeRequired(com.gemalto.mfs.mwsdk.utils.chcodeverifier.CHCodeVerifier)
.void
sendRequestForODACertificateRenewal(java.lang.String tokenizedCardId, PushServiceListener listener)
This is a pull mode request to CPS server to renew ODA certificate.void
sendRequestForReplenishment(java.lang.String tokenizedCardId, PushServiceListener listener)
This is a pull mode request to CPS server to replenish the card.void
sendRequestForReplenishment(java.lang.String tokenizedCardId, PushServiceListener listener, boolean isForceReplenishment)
This is a pull mode request to CPS server to replenish the card.void
updatePushToken(java.lang.String pushToken, PushServiceListener listener)
This is a pull mode request to CPS server to update the GCM token.-
Methods inherited from interface com.gemalto.mfs.mwsdk.sdkconfig.BusinessService
initialize, reset
-
-
-
-
Method Detail
-
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
void retrySession(PushServiceListener listener) throws ExistingRetrySessionException, NoSessionException
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 thePushServiceListener
callbacks. If called before the callback, this method will throwExistingRetrySessionException
.- Parameters:
listener
- PushServicelistener to send callback to the application.- Throws:
ExistingRetrySessionException
- thrown if there is an ongoing retryNoSessionException
- thrown if the GCM push message containing the conversation ID to initiate the server session is not yet received
-
getCodeType
ProvisioningServiceCodeType 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 listenerEnrollingServiceListener.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:- Activation code
- PIN - the type of PIN will be dictated by the pinType
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 callinggetCodeType()
. IMPORTANT: If pinType isProvisioningServicePinType.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 @seeProvisioningServicePinType
- See Also:
sendActivationCode(EnrollingServiceListener)
-
sendRequestForReplenishment
void sendRequestForReplenishment(java.lang.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(java.lang.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(java.lang.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(java.lang.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(java.lang.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.
-
getReplenishmentPrepService
ReplenishmentPrepService getReplenishmentPrepService()
This returns ReplenishmentPrepService to be used for preparation before replenishment.- Returns:
ReplenishmentPrepService
-
-