Class D1Task
- java.lang.Object
-
- com.thalesgroup.gemalto.d1.D1Task
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classD1Task.BuilderAn object that constructsD1Taskfrom its configurations.static interfaceD1Task.Callback<T>Generic callback to return result of an asynchronous call.static interfaceD1Task.ConfigCallback<T>Configuration callback to return result of an asynchronous call.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidactivateDigitalCard(String cardID, D1Task.Callback<Void> callback)Deprecated.Please use new API:D1Task.getD1PushWallet().activateDigitalCard(String,OEMPayType,Callback)voidactivatePhysicalCard(String cardID, EntryUI entryUI, D1Task.Callback<Void> callback)Activate a Physical Card.voidaddDigitalCardToOEM(String cardID, D1Task.Callback<Void> callback)Deprecated.voidaddDigitalCardToScheme(String cardID, TokenRequestor tokenRequestor, String appURL, boolean tcsAccepted, D1Task.Callback<String> callback)Add Digital Card to scheme for a givencardIDPINEntryUIchangePIN(String cardID, SecureEditText editTextNew, SecureEditText editTextConfirm, ChangePINOptions options, PINEntryUI.PINEventListener listener)Change the PIN of a Physical Card.voidconfigure(D1Task.ConfigCallback<Void> callback, D1Params... configParams)D1 Task configurations.voiddisplayCardDetails(String cardID, CardDetailsUI cardDetailsUI, D1Task.Callback<Void> callback)Display Card Details information securely.voiddisplayPhysicalCardPIN(String cardID, CardPINUI cardPINUI, D1Task.Callback<Void> callback)Display the PIN for a Physical Card.static StringgetAppInstanceID(Context context)Retrieve application instance identifier.voidgetCardActivationMethod(String cardID, D1Task.Callback<CardActivationMethod> callback)Retrieve the activation method for a Physical Card.voidgetCardDetails(String cardID, D1Task.Callback<CardDetails> callback)Retrieves the detail information of the card, including full PAN value.voidgetCardDigitizationState(String cardID, D1Task.Callback<CardDigitizationState> callback)Deprecated.Please use new API:D1Task.getD1PushWallet().getCardDigitizationState(String,OEMPayType,Callback)voidgetCardMetadata(String cardID, D1Task.Callback<CardMetadata> callback)Retrieves the basic card metadata.D1AuthngetD1Authn(FragmentActivity fragmentActivity, AuthnCallback authnCallback)Retrieve D1Authn object for Authn use casesD1PayWalletgetD1PayWallet()Retrieve D1PayWallet object for D1 Payment use casesD1PushToECommercegetD1PushToECommerce()getPushToECommerce to the D1 services PushToECommerce is a new Helper class for eCommerce push provisionD1PushWalletgetD1PushWallet()getPushWallet to the D1 services PushWallet is a new Helper classvoidgetDigitalCardList(String cardID, D1Task.Callback<List<DigitalCard>> callback)Retrieve Digital Card list for a givencardID.static Map<String,String>getSDKVersions()Returns the SDK version(s) in the D1 SDK.com.thalesgroup.gemalto.securelog.SecureLoggetSecureLog()Get D1 SDK secure log instance.voidgetTokenRequestorList(String cardID, D1Task.Callback<List<TokenRequestor>> callback)Retrieve eligible token requestor list for a givencardID.voidhandleCardResult(int requestCode, int resultCode, Intent data)Handle data that Wallet has returned for card operation.voidlogin(byte[] issuerToken, D1Task.Callback<Void> callback)Login to the D1 services using a provided token.voidlogout(D1Task.Callback<Void> callback)Logs out ofthe D1 services.voidprocessNotification(Map<String,String> data, D1Task.Callback<Map<PushResponseKey,String>> callback)Process the pushed data received from notification servervoidregisterCardDataChangedListener(CardDataChangedListener listener)Register to receive Card/Wallet update on following events: The active wallet changes (by changing the active account) The selected card of the active wallet changes Tokenized cards are added or removed from the active wallet The status of a token in the active wallet changesstatic voidreset(Context context)Reset the SDK.voidunRegisterCardDataChangedListener()Unregister the Card/Wallet data changed listenervoidupdateDigitalCard(String cardID, DigitalCard digitalCard, CardAction cardAction, D1Task.Callback<Boolean> callback)Update Digital Card status for a given Digital card ID.voidupdatePushToken(String token, D1Task.Callback<Void> callback)Updates the new push token.
-
-
-
Method Detail
-
getSDKVersions
@NonNull public static Map<String,String> getSDKVersions()
Returns the SDK version(s) in the D1 SDK.- Returns:
- Dictionary with SDK name as key and SDK version as value, for example, {"D1Core": "1.0.0"}.
-
updatePushToken
public void updatePushToken(@NonNull String token, @NonNull D1Task.Callback<Void> callback)
Updates the new push token.- Parameters:
token- The latest push notification token.callback- The callback for the result. When it succeeds, the returned argument of theD1Task.Callback.onSuccess(Object)is always null.
Possible errors:
- Since:
- 2.0.0
-
processNotification
public void processNotification(@NonNull Map<String,String> data, @NonNull D1Task.Callback<Map<PushResponseKey,String>> callback)
Process the pushed data received from notification server- Parameters:
data- The pushed datacallback- The callback for the result. IfD1Task.Callback.onSuccess(Object)is returned, checkPushResponseKey.MESSAGE_TYPEto find out the message type.
Possible errors:
D1Exception.ErrorCode.ERROR_DEVICE_ENVIRONMENT_UNSAFED1Exception.ErrorCode.ERROR_CORE Which can be due to storage (unlikely) or network failure
D1Exception.ErrorCode.ERROR_D1PAY This error can only happen for D1Exception.ErrorCode.ERROR_D1PAY_PROVISIONING_SERVICED1Exception.ErrorCode.ERROR_AUTHN_NOT_ENROLLEDD1Exception.ErrorCode.ERROR_AUTHN_ACCESS_DENIEDD1Exception.ErrorCode#ERROR_AUTHN_NO_PENDING_EVENTSD1Exception.ErrorCode.ERROR_NOT_LOGGED_IND1Exception.ErrorCode.ERROR_NOT_AUTHORIZED
PushResponseKey.TYPE_CARD_STATE- Since:
- 2.3.0
-
reset
public static void reset(@NonNull Context context)
Reset the SDK. Calling this API will delete all the SDK internal data and the end user wll need to initialize and re-enroll to the SDK services.- Parameters:
context- Application context- Since:
- 3.0.0
-
configure
public void configure(@NonNull D1Task.ConfigCallback<Void> callback, @NonNull D1Params... configParams)
D1 Task configurations. It is the entry point for SDK initialization.App can only initialize certain features only to reduce waiting time. It is not mandatory to initialize all features in a single call.
- Parameters:
callback- The callback for the result. When it succeeds, the returned argument of theD1Task.ConfigCallback.onSuccess(Object)is always null.
Possible errors:
D1Exception.ErrorCode.ERROR_DEVICE_ENVIRONMENT_UNSAFED1Exception.ErrorCode.ERROR_CORED1Exception.ErrorCode.ERROR_CARDD1Exception.ErrorCode.ERROR_D1PAYD1Exception.ErrorCode.ERROR_D1PAY_UNRECOVERABLED1Exception.ErrorCode.ERROR_GPAY_NOT_SUPPORTEDD1Exception.ErrorCode.ERROR_SPAY_NOT_SUPPORTEDD1Exception.ErrorCode.ERROR_D1PAY_NOT_SUPPORTEDD1Exception.ErrorCode.ERROR_GPAYD1Exception.ErrorCode.ERROR_SPAY
configParams- The configurations of feature, e.g. Google Pay, D1 Pay
-
login
public void login(@NonNull byte[] issuerToken, @NonNull D1Task.Callback<Void> callback)
Login to the D1 services using a provided token.- Parameters:
issuerToken- Issuer token received from the bank IDP.callback- The callback for the result. When it succeeds, the returned argument of theD1Task.Callback.onSuccess(Object)is always null.
Possible errors:
D1Exception.ErrorCode.ERROR_DEVICE_ENVIRONMENT_UNSAFED1Exception.ErrorCode.ERROR_CORED1Exception.ErrorCode.ERROR_PUSH_TOKEN_NOT_FOUND
This error only applies for card issued by D1.
-
logout
public void logout(@NonNull D1Task.Callback<Void> callback)
Logs out ofthe D1 services.- Parameters:
callback- The callback for the result. When it succeeds, the returned argument of theD1Task.Callback.onSuccess(Object)is always null.
Possible errors:
-
getAppInstanceID
@NonNull public static String getAppInstanceID(@NonNull Context context) throws D1Exception
Retrieve application instance identifier.- Parameters:
context- Application context- Returns:
- Throws:
D1Exception- Since:
- 3.0.0
-
getCardMetadata
public void getCardMetadata(@NonNull String cardID, @NonNull D1Task.Callback<CardMetadata> callback)
Retrieves the basic card metadata. Use this API to retrieve the last 4 digits of PAN & Card Art.- Parameters:
cardID- The card identifiercallback- The callback for the result. When it succeeds, the returned argument of theD1Task.Callback.onSuccess(Object)is always non-null.
Possible errors:
-
getCardDetails
public void getCardDetails(@NonNull String cardID, @NonNull D1Task.Callback<CardDetails> callback)
Retrieves the detail information of the card, including full PAN value. These values can be used for online transaction.- Parameters:
cardID- The card identifiercallback- The callback for the result. When it succeeds, the returned argument of theD1Task.Callback.onSuccess(Object)is always non-null.
Possible errors:
-
displayCardDetails
public void displayCardDetails(@NonNull String cardID, @NonNull CardDetailsUI cardDetailsUI, @NonNull D1Task.Callback<Void> callback)
Display Card Details information securely.Use this API to display full card information. Using UI component in
CardDetailsUIthe API sets the Card Details information in the UI. Integrator has full control of UI appearance and layout.- Parameters:
cardID- The card identifier.cardDetailsUI- The UI to display card details.callback- The callback invoked when the operation is completed. When it succeeds, the returned argument of theD1Task.Callback.onSuccess(Object)is always null.
Possible errors:
- Since:
- 2.1.0
-
displayPhysicalCardPIN
public void displayPhysicalCardPIN(@NonNull String cardID, @NonNull CardPINUI cardPINUI, @NonNull D1Task.Callback<Void> callback)
Display the PIN for a Physical Card.- Parameters:
cardID- The card identifiercardPINUI- The ui to display card PINcallback- The callback invoked when the operation is completed. When it succeeds, it returns no error and theD1Task.Callback.onSuccess(Object)'s argument is always null. Otherwise, it returns the error details.
Possible errors:
- Throws:
IllegalArgumentException- when one of the parameters isnullor empty.- Since:
- 1.1.0
-
changePIN
@NonNull public PINEntryUI changePIN(@NonNull String cardID, @NonNull SecureEditText editTextNew, @NonNull SecureEditText editTextConfirm, @NonNull ChangePINOptions options, @NonNull PINEntryUI.PINEventListener listener)
Change the PIN of a Physical Card.- Parameters:
cardID- The card identifier.editTextNew- TheSecureEditTextinstance for new PIN entry.editTextConfirm- TheSecureEditTextfor confirm PIN entry.options- The PIN change options.listener- The listener for PIN entry events.- Returns:
- The UI instance to submit PIN change request and wipe data.
- Since:
- 3.3.0
-
getCardActivationMethod
public void getCardActivationMethod(@NonNull String cardID, @NonNull D1Task.Callback<CardActivationMethod> callback)
Retrieve the activation method for a Physical Card.- Parameters:
cardID- The card identifiercallback- The callback invoked when the operation is completed. When it succeeds, it returns theCardActivationMethodif unknown activation method then it returns null. Otherwise, it returns the error details.
Possible errors:
- Throws:
IllegalArgumentException- when one of the parameters isnullor empty.- Since:
- 1.1.0
-
activatePhysicalCard
public void activatePhysicalCard(@NonNull String cardID, @NonNull EntryUI entryUI, @NonNull D1Task.Callback<Void> callback)
Activate a Physical Card.- Parameters:
cardID- The card identifierentryUI- The UI to display secure text entry. If activationMethod isCardActivationMethod.NOTHING, constructEntryUIwith a null `SecureEditText`callback- The callback invoked when the operation is completed. When it succeeds, the returned argument of theD1Task.Callback.onSuccess(Object)is always null. Otherwise, it returns the error details.
Possible errors:
D1Exception.ErrorCode.ERROR_NOT_LOGGED_IND1Exception.ErrorCode.ERROR_NOT_AUTHORIZEDD1Exception.ErrorCode.ERROR_DEVICE_ENVIRONMENT_UNSAFED1Exception.ErrorCode.ERROR_CORED1Exception.ErrorCode.ERROR_NO_CARD_ACTIVATION_METHODD1Exception.ErrorCode.ERROR_UI_COMPONENT_NOT_FOUNDD1Exception.ErrorCode.ERROR_CARD_NOT_FOUND
- Throws:
IllegalArgumentException- when one of the parameters isnullor empty.- Since:
- 1.1.0
-
getSecureLog
public com.thalesgroup.gemalto.securelog.SecureLog getSecureLog()
Get D1 SDK secure log instance.- Returns:
- The secure log instance from D1 SDK.
-
getD1PushWallet
@NonNull public D1PushWallet getD1PushWallet()
getPushWallet to the D1 services PushWallet is a new Helper class
-
getD1PushToECommerce
@NonNull public D1PushToECommerce getD1PushToECommerce()
getPushToECommerce to the D1 services PushToECommerce is a new Helper class for eCommerce push provision- Since:
- 3.3.0
-
getCardDigitizationState
public void getCardDigitizationState(@NonNull String cardID, @NonNull D1Task.Callback<CardDigitizationState> callback)
Deprecated.Please use new API:D1Task.getD1PushWallet().getCardDigitizationState(String,OEMPayType,Callback)Check if the card has been digitized or not. Use this API to determine if we need to show Add to Wallet button on the Application.- Parameters:
cardID- The card identifiercallback- The callback for the result. When it succeeds, the returned argument of theD1Task.Callback.onSuccess(Object)is always non-null.
Possible errors:
-
addDigitalCardToOEM
public void addDigitalCardToOEM(@NonNull String cardID, @NonNull D1Task.Callback<Void> callback)
Deprecated.Add Digital Card for a givencardIDfor OEM Type (Google Pay or Samsung Pay). OEM Type is set onConfigParams.buildConfigCard(android.app.Activity, OEMPayType, String)Integrator must override the
Activity.onActivityResult()and pass the result back to SDK usinghandleCardResult(int, int, Intent)APIWarning: This API does not support multiple OEM Type.
- Parameters:
cardID- The card identifiercallback- The callback for the result. When it succeeds, the returned argument of theD1Task.Callback.onSuccess(Object)is always null.
Possible errors:
D1Exception.ErrorCode.ERROR_NOT_LOGGED_IND1Exception.ErrorCode.ERROR_NOT_AUTHORIZEDD1Exception.ErrorCode.ERROR_DEVICE_ENVIRONMENT_UNSAFED1Exception.ErrorCode.ERROR_GPAY_NOT_SUPPORTEDD1Exception.ErrorCode.ERROR_SPAY_NOT_SUPPORTEDD1Exception.ErrorCode.ERROR_CORED1Exception.ErrorCode.ERROR_CARDD1Exception.ErrorCode.ERROR_CARD_NOT_FOUND
- See Also:
ConfigParams.buildConfigCard(android.app.Activity, OEMPayType, String),handleCardResult(int, int, Intent)
-
activateDigitalCard
public void activateDigitalCard(@NonNull String cardID, @NonNull D1Task.Callback<Void> callback)
Deprecated.Please use new API:D1Task.getD1PushWallet().activateDigitalCard(String,OEMPayType,Callback)Google Pay only.Activate the digital card which has been digitized but not yet done ID&V (Step up authentication - Yellow Flow inApp Verification).
Integrator should call this API when the return state of
getCardDigitizationState(String, Callback)isCardDigitizationState.PENDING_IDV- Parameters:
cardID- The card IDcallback- The callback for result. When it succeeds, the returned argument of theD1Task.Callback.onSuccess(Object)is always null.
Possible errors:
-
getDigitalCardList
public void getDigitalCardList(@NonNull String cardID, @NonNull D1Task.Callback<List<DigitalCard>> callback)
Retrieve Digital Card list for a givencardID.- Parameters:
cardID- The card identifiercallback- The callback for the result. When it succeeds, the returned argument of theD1Task.Callback.onSuccess(Object)is always non-null.
Possible errors:
-
updateDigitalCard
public void updateDigitalCard(@NonNull String cardID, @NonNull DigitalCard digitalCard, @NonNull CardAction cardAction, @NonNull D1Task.Callback<Boolean> callback)
Update Digital Card status for a given Digital card ID.- Parameters:
cardID- The card identifierdigitalCard- The digital card received fromgetDigitalCardList(String, Callback)cardAction- The card action to be performed: active, suspend or deletecallback- The callback for the result. When it succeeds, the returned argument of theD1Task.Callback.onSuccess(Object)is always non-null.
Possible errors:
-
handleCardResult
public void handleCardResult(int requestCode, int resultCode, @Nullable Intent data)Handle data that Wallet has returned for card operation.- Parameters:
requestCode- The requestCode available for card operation resultresultCode- The resultCode available for card operation resultdata- The data available for card operation result
-
registerCardDataChangedListener
public void registerCardDataChangedListener(@NonNull CardDataChangedListener listener)
Register to receive Card/Wallet update on following events:- The active wallet changes (by changing the active account)
- The selected card of the active wallet changes
- Tokenized cards are added or removed from the active wallet
- The status of a token in the active wallet changes
Note: Only foreground applications will be notified.
Therefore, application should update the token status not only when receiving this callback but also when the application launches or returns to the foreground.
For more information, refer to Android Push Provisioning API - Data Change Callbacks
- Parameters:
listener- The callback
-
unRegisterCardDataChangedListener
public void unRegisterCardDataChangedListener()
Unregister the Card/Wallet data changed listener- See Also:
CardDataChangedListener
-
getTokenRequestorList
public void getTokenRequestorList(@NonNull String cardID, @NonNull D1Task.Callback<List<TokenRequestor>> callback)
Retrieve eligible token requestor list for a givencardID.- Parameters:
cardID- The card identifiercallback- The callback for the result. When it succeeds, the returned argument of theD1Task.Callback.onSuccess(Object)is always non-null.
Possible errors:
- Throws:
IllegalArgumentException- when one of the parameter is null or emptyIllegalStateException- when core module has not been configured- Since:
- 2.0.0
-
addDigitalCardToScheme
public void addDigitalCardToScheme(@NonNull String cardID, @NonNull TokenRequestor tokenRequestor, @NonNull String appURL, boolean tcsAccepted, @NonNull D1Task.Callback<String> callback)
Add Digital Card to scheme for a givencardID- Parameters:
cardID- The card identifiertokenRequestor- The token requestor that user has selectedappURL- The issuer app's custom URL that the token requestor calls back upon completion of digitization flow to return the user to where they started their journeytcsAccepted- The terms and conditions accepted by usercallback- The callback for the result. When it succeeds, the returned argument of theD1Task.Callback.onSuccess(Object)is always non-null.
Possible errors:
- Throws:
IllegalArgumentException- when one of the parameter is null or emptyIllegalStateException- when core module has not been configured- Since:
- 2.0.0
-
getD1PayWallet
@NonNull public D1PayWallet getD1PayWallet()
Retrieve D1PayWallet object for D1 Payment use cases- Since:
- 2.0.0
-
getD1Authn
@NonNull public D1Authn getD1Authn(@NonNull FragmentActivity fragmentActivity, @NonNull AuthnCallback authnCallback) throws D1Exception
Retrieve D1Authn object for Authn use cases- Parameters:
fragmentActivity- Activity instanceauthnCallback- The callback for the auth use cases- Throws:
D1Exception- Since:
- 3.0.0
-
-