Class D1Task
- java.lang.Object
-
- com.thalesgroup.gemalto.d1.D1Task
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
D1Task.Builder
An object that constructsD1Task
from its configurations.static interface
D1Task.Callback<T>
Generic callback to return result of an asynchronous call.static interface
D1Task.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 void
activateDigitalCard(String cardID, D1Task.Callback<Void> callback)
Deprecated.Please use new API:D1Task.getD1PushWallet().activateDigitalCard(String,OEMPayType,Callback)
void
activatePhysicalCard(String cardID, EntryUI entryUI, D1Task.Callback<Void> callback)
Activate a Physical Card.void
addDigitalCardToOEM(String cardID, D1Task.Callback<Void> callback)
Deprecated.void
addDigitalCardToScheme(String cardID, TokenRequestor tokenRequestor, String appURL, boolean tcsAccepted, D1Task.Callback<String> callback)
Add Digital Card to scheme for a givencardID
PINEntryUI
changePIN(String cardID, SecureEditText editTextNew, SecureEditText editTextConfirm, ChangePINOptions options, PINEntryUI.PINEventListener listener)
Change the PIN of a Physical Card.void
configure(D1Task.ConfigCallback<Void> callback, D1Params... configParams)
D1 Task configurations.void
displayCardDetails(String cardID, CardDetailsUI cardDetailsUI, D1Task.Callback<Void> callback)
Display Card Details information securely.void
displayPhysicalCardPIN(String cardID, CardPINUI cardPINUI, D1Task.Callback<Void> callback)
Display the PIN for a Physical Card.static String
getAppInstanceID(Context context)
Retrieve application instance identifier.void
getCardActivationMethod(String cardID, D1Task.Callback<CardActivationMethod> callback)
Retrieve the activation method for a Physical Card.void
getCardDetails(String cardID, D1Task.Callback<CardDetails> callback)
Retrieves the detail information of the card, including full PAN value.void
getCardDigitizationState(String cardID, D1Task.Callback<CardDigitizationState> callback)
Deprecated.Please use new API:D1Task.getD1PushWallet().getCardDigitizationState(String,OEMPayType,Callback)
void
getCardMetadata(String cardID, D1Task.Callback<CardMetadata> callback)
Retrieves the basic card metadata.D1Authn
getD1Authn(FragmentActivity fragmentActivity, AuthnCallback authnCallback)
Retrieve D1Authn object for Authn use casesD1PayWallet
getD1PayWallet()
Retrieve D1PayWallet object for D1 Payment use casesD1PushToECommerce
getD1PushToECommerce()
getPushToECommerce to the D1 services PushToECommerce is a new Helper class for eCommerce push provisionD1PushWallet
getD1PushWallet()
getPushWallet to the D1 services PushWallet is a new Helper classvoid
getDigitalCardList(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.SecureLog
getSecureLog()
Get D1 SDK secure log instance.void
getTokenRequestorList(String cardID, D1Task.Callback<List<TokenRequestor>> callback)
Retrieve eligible token requestor list for a givencardID
.void
handleCardResult(int requestCode, int resultCode, Intent data)
Handle data that Wallet has returned for card operation.void
login(byte[] issuerToken, D1Task.Callback<Void> callback)
Login to the D1 services using a provided token.void
logout(D1Task.Callback<Void> callback)
Logs out ofthe D1 services.void
processNotification(Map<String,String> data, D1Task.Callback<Map<PushResponseKey,String>> callback)
Process the pushed data received from notification servervoid
registerCardDataChangedListener(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 void
reset(Context context)
Reset the SDK.void
unRegisterCardDataChangedListener()
Unregister the Card/Wallet data changed listenervoid
updateDigitalCard(String cardID, DigitalCard digitalCard, CardAction cardAction, D1Task.Callback<Boolean> callback)
Update Digital Card status for a given Digital card ID.void
updatePushToken(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_TYPE
to find out the message type.
Possible errors:
D1Exception.ErrorCode.ERROR_DEVICE_ENVIRONMENT_UNSAFE
D1Exception.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_SERVICE
D1Exception.ErrorCode.ERROR_AUTHN_NOT_ENROLLED
D1Exception.ErrorCode.ERROR_AUTHN_ACCESS_DENIED
D1Exception.ErrorCode#ERROR_AUTHN_NO_PENDING_EVENTS
D1Exception.ErrorCode.ERROR_NOT_LOGGED_IN
D1Exception.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_UNSAFE
D1Exception.ErrorCode.ERROR_CORE
D1Exception.ErrorCode.ERROR_CARD
D1Exception.ErrorCode.ERROR_D1PAY
D1Exception.ErrorCode.ERROR_D1PAY_UNRECOVERABLE
D1Exception.ErrorCode.ERROR_GPAY_NOT_SUPPORTED
D1Exception.ErrorCode.ERROR_SPAY_NOT_SUPPORTED
D1Exception.ErrorCode.ERROR_D1PAY_NOT_SUPPORTED
D1Exception.ErrorCode.ERROR_GPAY
D1Exception.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_UNSAFE
D1Exception.ErrorCode.ERROR_CORE
D1Exception.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
CardDetailsUI
the 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 isnull
or 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
- TheSecureEditText
instance for new PIN entry.editTextConfirm
- TheSecureEditText
for 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 theCardActivationMethod
if unknown activation method then it returns null. Otherwise, it returns the error details.
Possible errors:
- Throws:
IllegalArgumentException
- when one of the parameters isnull
or 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
, constructEntryUI
with 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_IN
D1Exception.ErrorCode.ERROR_NOT_AUTHORIZED
D1Exception.ErrorCode.ERROR_DEVICE_ENVIRONMENT_UNSAFE
D1Exception.ErrorCode.ERROR_CORE
D1Exception.ErrorCode.ERROR_NO_CARD_ACTIVATION_METHOD
D1Exception.ErrorCode.ERROR_UI_COMPONENT_NOT_FOUND
D1Exception.ErrorCode.ERROR_CARD_NOT_FOUND
- Throws:
IllegalArgumentException
- when one of the parameters isnull
or 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 givencardID
for 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_IN
D1Exception.ErrorCode.ERROR_NOT_AUTHORIZED
D1Exception.ErrorCode.ERROR_DEVICE_ENVIRONMENT_UNSAFE
D1Exception.ErrorCode.ERROR_GPAY_NOT_SUPPORTED
D1Exception.ErrorCode.ERROR_SPAY_NOT_SUPPORTED
D1Exception.ErrorCode.ERROR_CORE
D1Exception.ErrorCode.ERROR_CARD
D1Exception.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
-
-