Class D1Task
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classAn object that constructsD1Taskfrom its configurations.static interfaceGeneric callback to return result of an asynchronous call.static interfaceConfiguration callback to return the result of an asynchronous call. -
Method Summary
Modifier and TypeMethodDescriptionvoidactivatePhysicalCard(String cardID, EntryUI entryUI, D1Task.Callback<Void> callback) Activate a Physical Card.voidaddDigitalCardToScheme(String cardID, TokenRequestor tokenRequestor, String appURL, boolean tcsAccepted, D1Task.Callback<String> callback) Add Digital Card to scheme for a givencardIDchangePIN(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.voidgetCardMetadata(String cardID, D1Task.Callback<CardMetadata> callback) Retrieves the basic card metadata.Gets theCardServiceinstance for the card issued by D1 whereCardServiceis a new helper class.getClickToPayService API is used to access D1 Click to Pay services.getD1Authn(FragmentActivity fragmentActivity, AuthnCallback authnCallback) Retrieve D1Authn object for Authn use casesDeprecated.Retrieve D1PayWallet object for D1 Payment use casesDeprecated.Please use new API:getD1ClickToPay()getPushWallet to the D1 services.voidgetDigitalCardList(String cardID, D1Task.Callback<List<DigitalCard>> callback) Retrieves the digital card list for a givencardID.Retrieves the DigitalCardService instance for digital card operations.Get D1 SDK secure log service instance.Retrieves theMessagingServiceinstance to perform message and notification related API operations.Returns the SDK version(s) in D1 SDK.com.thalesgroup.gemalto.securelog.SecureLogDeprecated.from 4.3.0, usegetLogService()insteadvoidgetTokenRequestorList(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) Logs in to the D1 services using a provided token.voidlogin(List<byte[]> issuerTokens, D1Task.Callback<Void> callback) Login to the D1 services using provided tokens.voidlogout(D1Task.Callback<Void> callback) Logs out ofthe D1 services.voidlogoutAll(D1Task.Callback<Void> callback) Logs out of the D1 services for all logged-in consumersvoidprocessNotification(Map<String, String> data, D1Task.Callback<Map<PushResponseKey, String>> callback) Process the pushed data received from notification servervoidRegister 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 voidResets the SDK.voidUnregister 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 Details
-
getSDKVersions
Returns the SDK version(s) in D1 SDK.- Returns:
- Dictionary with SDK name as the key and SDK version as the value, for example, {"D1": "1.0.0"}.
-
getCardService
Gets theCardServiceinstance for the card issued by D1 whereCardServiceis a new helper class.- Since:
- 4.0.0
-
getMessagingService
Retrieves theMessagingServiceinstance to perform message and notification related API operations.
Possible error:
- Since:
- 4.0.0
-
updatePushToken
Updates the new push token.To update the backend with the latest push token, one of the
login(byte[], D1Task.Callback)orlogin(List, D1Task.Callback)methods must be called before invokingupdatePushToken(String, D1Task.Callback)when the following features are used:- Click to Pay
- Messaging Service
For NFC Payment and 3D Secure features, the D1 SDK does not require initialization to call
updatePushToken(String, D1Task.Callback). It only requires an AndroidContext.In cases where either the Click to Pay or Messaging Service features are used together with the NFC Payment or 3D Secure features, one of the
login(byte[], D1Task.Callback)orlogin(List, D1Task.Callback)methods must be called before invokingupdatePushToken(String, D1Task.Callback).- Parameters:
token- The latest push notification token.callback- The callback for the result. When it is successful, 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 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_NOT_LOGGED_IND1Exception.ErrorCode.ERROR_NOT_AUTHORIZEDD1Exception.ErrorCode.ERROR_INVALID_ARGUMENT
PushResponseKey.TYPE_CARD_STATE- Since:
- 2.3.0
-
reset
Resets the SDK. Calling this API will delete all the SDK internal data and the end user wll need to initialize and re-enrol 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 initialise all features in a single call.
- Parameters:
callback- The callback for the result. When it is successful, 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 the features. For example, Google Pay, and D1 Pay.
-
login
Logs in 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 is successful, 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.
- Throws:
IllegalArgumentException- ifissuerTokenis null or emptyIllegalStateException- ifconfigure(D1Task.ConfigCallback, D1Params[])hasn't been called
-
login
Login to the D1 services using provided tokens.- Parameters:
issuerTokens- Issuer tokens received from the bank IDP.callback- The callback for the result. When it is successful, 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.
- Throws:
IllegalArgumentException- in any of following conditionsissuerTokensis null or empty- any token value in
issuerTokensis invalid issuerTokenscontains multiple tokens belong to sameissuerId
IllegalStateException- ifconfigure(D1Task.ConfigCallback, D1Params[])hasn't been called
-
logout
Logs out ofthe D1 services.- Parameters:
callback- The callback for the result. When it is successful, the returned argument of theD1Task.Callback.onSuccess(Object)is always null.
Possible errors:
-
logoutAll
Logs out of the D1 services for all logged-in consumers- Parameters:
callback- The callback for the result. When it is successful, the returned argument of theD1Task.Callback.onSuccess(Object)is always null.
Possible errors:
- Throws:
IllegalArgumentException- ifcallbackis nullIllegalStateException- ifconfigure(D1Task.ConfigCallback, D1Params[])hasn't been called
-
getAppInstanceID
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 is successful, the returned argument of theD1Task.Callback.onSuccess(Object)is always a non-null value.
Possible errors:
-
getCardDetails
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 is successful, the returned argument of theD1Task.Callback.onSuccess(Object)is always a non-null value.
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 is successful, 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 is successful, 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 is successful, 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 is successful, 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()Deprecated.from 4.3.0, usegetLogService()insteadGet D1 SDK secure log instance.- Returns:
- The secure log instance from D1 SDK.
-
getLogService
Get D1 SDK secure log service instance.- Returns:
- The secure log service instance from D1 SDK.
- Since:
- 4.3.0
-
getD1PushWallet
getPushWallet to the D1 services. PushWallet is a new helper class. -
getD1PushToECommerce
Deprecated.Please use new API:getD1ClickToPay()getPushToECommerce API is used to access D1 services. PushToECommerce is a new helper class for e-commerce push provision.- Since:
- 3.3.0
-
getD1ClickToPay
Deprecated.Please use new API:getClickToPayService()getClickToPay API is used to access D1 Click to Pay services. D1ClickToPay is a new helper class. -
getClickToPayService
getClickToPayService API is used to access D1 Click to Pay services. ClickToPayService is a new helper class.- Since:
- 4.3.0
-
getDigitalCardService
Retrieves the DigitalCardService instance for digital card operations. DigitalCardService is a helper class for device binding and cardholder verification operations.- Returns:
- The DigitalCardService instance.
- Since:
- 4.3.0
-
getDigitalCardList
public void getDigitalCardList(@NonNull String cardID, @NonNull D1Task.Callback<List<DigitalCard>> callback) Retrieves the digital card list for a givencardID. Note: Each `DigitalCard` provides theDigitalCard.isOnCurrentDevice()method to identify the digital cards on the current device (only for GooglePay, Samsung Pay and D1 Pay).- Parameters:
cardID- The card identifier.callback- The callback for the result. When it is successful, the returned argument of theD1Task.Callback.onSuccess(Object)is always a non-null value.
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 is successful, the returned argument of theD1Task.Callback.onSuccess(Object)is always a non-null value.
Possible errors:
-
handleCardResult
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
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:
-
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 is successful, the returned argument of theD1Task.Callback.onSuccess(Object)is always a non-null value.
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 is successful, the returned argument of theD1Task.Callback.onSuccess(Object)is always a non-null value.
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
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
-
getClickToPayService()