Interface MGCardEnrollmentService


  • public interface MGCardEnrollmentService
    The card enrollment service is responsible for card digitization process. The Card Enrollment Flows shall describe the use-cases that can be applied in accordance to the class diagram shown below. If in case wherein a card enrollment is interrupted in before completion, this module is also used to retrieve the pending card enrollments and continue further.
    • Method Detail

      • checkCardEligibility

        void checkCardEligibility​(byte[] encCardInfo,
                                  InputMethod inputMethod,
                                  java.lang.String language,
                                  CardEligibilityListener cardEligibilityListener,
                                  java.lang.String serialNumber)
        Before card digitization happens, the contactless card has to be checked for eligibility first. This method is mainly used for this purpose. This asynchroDefaultMGCardEnrollmentServicenous method accepts an encrypted contactless card details. Encryption however, shall be decided by the MPA - either using Tap&Roll SDK or the MG_SDK.encrypt() method depending on the card type (PASS / NO PASS). Events are delegated to the MPA via CardEligibilityListener.
        Parameters:
        encCardInfo - PAN and expiry date encrypted with PKCS#7.
        inputMethod - represents how card details were entered.
        language - ISO 639-1 two letter language codes.
        cardEligibilityListener - listener to get response for the request.
        serialNumber - Serial number of the device
      • checkCardEligibility

        void checkCardEligibility​(byte[] encCardInfo,
                                  InputMethod inputMethod,
                                  java.lang.String language,
                                  WalletAccountData walletAccountData,
                                  CardEligibilityListener cardEligibilityListener,
                                  java.lang.String serialNumber)
        Before card digitization happens, the contactless card has to be checked for eligibility first. This method is mainly used for this purpose. This asynchronous method accepts an encrypted contactless card details. Encryption however, shall be decided by the MPA - either using Tap&Roll SDK or the MG_SDK.encrypt() method depending on the card type (PASS / NO PASS). Events are delegated to the MPA via CardEligibilityListener.
        Parameters:
        encCardInfo - PAN and expiry date encrypted with PKCS#7.
        inputMethod - represents how card details were entered.
        language - ISO 639-1 two letter language codes.
        walletAccountData - Information related to end user wallet account
        cardEligibilityListener - listener to get response for the request.
        serialNumber - Serial number of the device
      • checkEligibility

        void checkEligibility​(EligibilityData eligibilityData,
                              InstrumentData instrumentData,
                              CardEligibilityListener cardEligibilityListener)
        Before card digitization happens, the contactless card has to be checked for eligibility first. This method is mainly used for this purpose. This asynchronous method accepts an eligibility data and instrument data. Eligibility data contains input method, language,information related to end user wallet account and serial number of the device. Instrument data contains one of the following: 1. A physical or virtual card to enroll (identified by a PAN, card expiry date and cvv) 2. A scheme push receipt Events are delegated to the MPA via CardEligibilityListener.
        Parameters:
        eligibilityData - Eligibility data
        instrumentData - Instrument data
        cardEligibilityListener - listener to get response for the request.
        Since:
        TSH Pay SDK 6.6.0
      • getTermsAndConditions

        void getTermsAndConditions​(java.lang.String productId,
                                   TermsAndConditionsListener termsAndConditionsListener)
        This API is mainly intended for Non-Payment cases. After end user selects the card product to digitize, the MPA needs to fetch the terms and conditions of the card product using this asynchronous method. The #TermsAndConditions object result will be returned to the application through the #TermsAndConditionsListener. From here, the application can extract the TnC text to display to the end-user. If the user accepts the TnC, application should call #TermsAndConditions#accept() method to retrieve the #TermsAndConditionSession to be passed to the digitizeCard(String, String, String, String, TermsAndConditionSession, byte[], byte[], MGDigitizationListener) API
        Parameters:
        productId - An unique identifier of the card product.
        termsAndConditionsListener - listener for the getTermsAndConditions events.
      • digitizeCard

        void digitizeCard​(TermsAndConditionSession tncAcceptanceToken,
                          byte[] authenticationCodeToken,
                          MGDigitizationListener mgDigitizationListener)
        This API is used to initiate the digitization process of a payment card. The MPA should trigger this call only after the Terms and Conditions are accepted by the user. The result of the digitization process would be returned through a listener.
        Parameters:
        tncAcceptanceToken - The tncIdToken retrieved after terms and conditions acceptance.
        authenticationCodeToken - token used for green card enrollment flow or null otherwise.
        mgDigitizationListener - listener to provide the results and events within the card digitization process.
      • digitizeCard

        java.lang.String digitizeCard​(java.lang.String cardId,
                                      java.lang.String issuerId,
                                      java.lang.String productId,
                                      java.lang.String deviceId,
                                      TermsAndConditionSession tncAcceptanceToken,
                                      byte[] authenticationCode,
                                      byte[] authenticationCodeToken,
                                      MGDigitizationListener mgDigitizationListener)
        This API is used to initiate the digitization process of a transit or non-payment card. The MPA should normally trigger this call only after the Terms and Conditions are accepted by the user. There could be use cases though where T&C acceptance is managed outside of this library, in which case, the token can be optional. This should be used with caution. The result of the digitization process would be returned through a listener.
        Parameters:
        cardId - An unique identifier of a plastic card generated by issuer. It shall be provided if the MPA if it is available.
        issuerId - An unique identifier of the issuer. It shall be provided if the MPA if it is available.
        productId - An unique identifier of the card product. It shall be provided if the MPA if it is available.
        deviceId - is optional and shall only provided if the MPA has this value.
        tncAcceptanceToken - The tncIdToken retrieved after terms and conditions acceptance. This shall be provided if applicable.
        authenticationCode - is optional and shall only be provided if the MPA has this value.
        authenticationCodeToken - is optional and shall only be provided if the MPA has this value.
        mgDigitizationListener - listener for the digitize card events.
        Returns:
        The correlation id used to identify this operation
      • isCardActivationPending

        boolean isCardActivationPending​(java.lang.String digitalCardId)
        This API is used check if the card activation was previously interrupted. Each object in the array shall be used to continue the process depending on which state it was interrupted.
        Parameters:
        digitalCardId - The digitalCardId obtained from the CPS SDK.
        Digitized card ID shared by the HCE platform components (Different than token ID)
        Returns:
        the flag if the card activation was previously interrupted.
      • getPendingCardActivation

        PendingCardActivation getPendingCardActivation​(java.lang.String digitalCardId)
        This API is used to get the PendingCardActivation which are previously interrupted. This object shall be used to continue the process depending on which state it was interrupted.
        Parameters:
        digitalCardId - The digitalCardId obtained from the CPS SDK,
        Digitized card ID shared by the HCE platform components (Different than token ID)
        Returns:
        the cards pending for activation.
      • getWalletId

        java.lang.String getWalletId()
        This API is used to get the identifier of the Wallet
        Returns:
        the identifier of the wallet. returns null if an internal error occurs
      • getProduct

        void getProduct​(java.lang.String issuerId,
                        java.lang.String deviceId,
                        java.lang.String language,
                        java.lang.String productId,
                        ProductListener productListener)
        This API is used to get the card product defined by the productId.
        Parameters:
        issuerId - The unique identifier of the issuer.
        deviceId - The unique identifier of the device.
        language - The supported language that is defined by two letters language coding according to ISO 639-1.
        If language is not supported, English will be used.
        productId - The unique identifier of the card product to be retrieved.
        productListener - Listener for product retrieval events.
      • getProductList

        void getProductList​(java.lang.String issuerId,
                            java.lang.String deviceId,
                            java.lang.String language,
                            ProductListener productListener)
        This API is used to get the list of card products.
        Parameters:
        issuerId - The unique identifier of the issuer.
        deviceId - The unique identifier of the device.
        language - The supported language that is defined by two letters language coding according to ISO 639-1.
        If language is not supported, English will be used.
        productListener - Listener for product retrieval events.
      • getCardMetaData

        void getCardMetaData​(java.lang.String digitalCardId,
                             CardMetaDataFetchListener cardMetaDataFetchListener)
        This API returns the meta data of a card identified by its digitalCardId with the help of @CardMetaDataFetchListener
        Parameters:
        digitalCardId - Digitized card ID shared by the HCE platform components (Different than token ID)
        cardMetaDataFetchListener -