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 Modifier and Type Method Description void
activateDigitalCard(String cardID, D1Task.Callback<Void> callback)
Google Pay only.void
activatePhysicalCard(String cardID, EntryUI entryUI, D1Task.Callback<Void> callback)
Activate a Physical Card.void
addDigitalCardToOEM(String cardID, D1Task.Callback<Void> callback)
Add Digital Card for a givencardID
for OEM Type (Google Pay or Samsung Pay).void
addDigitalCardToScheme(String cardID, TokenRequestor tokenRequestor, String appURL, boolean tcsAccepted, D1Task.Callback<String> callback)
Add Digital Card to scheme for a givencardID
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.void
getCardActivationMethod(String cardID, D1Task.Callback<CardActivationMethod> callback)
Retrieve the activation method for a Physical Card.void
getCardDetails(String cardID, D1Task.Callback<CardDetails> callback)
Retrieve detail information of the card, including full PAN value.void
getCardDigitizationState(String cardID, D1Task.Callback<CardDigitizationState> callback)
Check if the card has been digitized or not.void
getCardMetadata(String cardID, D1Task.Callback<CardMetadata> callback)
Retrieve basic card metadata.D1PayWallet
getD1PayWallet()
Retrieve D1PayWallet object for D1 Payment use casesvoid
getDigitalCardList(String cardID, D1Task.Callback<List<DigitalCard>> callback)
Retrieve Digital Card list for a givencardID
.void
getPhysicalCardPIN(String cardID, D1Task.Callback<byte[]> callback)
Retrieve the PIN for a Physical Card.static Map<String,String>
getSDKVersions()
Returns SDK version(s) in the D1 SDK.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)
Logout to the D1 servicesvoid
processPushMessage(Map<String,String> data, D1Task.Callback<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 changesvoid
unRegisterCardDataChangedListener()
Unregister the Card/Wallet data changed listenervoid
updateCard(String cardID, CardAction cardAction, String reason, D1Task.Callback<Void> callback)
Update the Virtual Card state.void
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)
Update new push token
-
-
-
Method Detail
-
getSDKVersions
@NonNull public static Map<String,String> getSDKVersions()
Returns SDK version(s) in the D1 SDK.- Returns:
- Dictionary with SDK name as key and SDK version as value, e.g. {"D1Core": "1.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 feature 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.configParams
- The configurations
-
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 IDPcallback
- The callback for the result. When it succeeds, the returned argument of theD1Task.Callback.onSuccess(Object)
is always null.
-
logout
public void logout(@NonNull D1Task.Callback<Void> callback)
Logout to the D1 services- Parameters:
callback
- The callback for result. When it succeeds, the returned argument of theD1Task.Callback.onSuccess(Object)
is always null.
-
getCardMetadata
public void getCardMetadata(@NonNull String cardID, @NonNull D1Task.Callback<CardMetadata> callback)
Retrieve basic card metadata. Use this API to retrieve last 4 PAN digit value & 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.
-
getCardDetails
public void getCardDetails(@NonNull String cardID, @NonNull D1Task.Callback<CardDetails> callback)
Retrieve 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.
-
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, it returns no error. Otherwise, it returns error details.- Since:
- 2.1.0
-
updateCard
public void updateCard(@NonNull String cardID, @NonNull CardAction cardAction, @Nullable String reason, @NonNull D1Task.Callback<Void> callback)
Update the Virtual Card state.The following
CardAction
can be performed:- Resume the card
- Suspend the card
- Parameters:
cardID
- The card identifiercardAction
- The card action to be performed, possible actions:reason
- The reason for the operationcallback
- The callback for the result. When it succeeds, the returned argument of theD1Task.Callback.onSuccess(Object)
is always null.
-
getPhysicalCardPIN
public void getPhysicalCardPIN(@NonNull String cardID, @NonNull D1Task.Callback<byte[]> callback)
Retrieve the PIN for a Physical Card.- Parameters:
cardID
- The card identifiercallback
- The callback invoked when the operation is completed. When it succeeds, it returns the PIN (D1Task.Callback.onSuccess(Object)
). Otherwise, it returns the error details.- Throws:
IllegalArgumentException
- when one of the parameters isnull
or empty.- Since:
- 1.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.- Throws:
IllegalArgumentException
- when one of the parameters isnull
or empty.- Since:
- 1.1.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
. Otherwise, it returns the error details.- 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, it returns no error. Otherwise, it returns the error details.- Throws:
IllegalArgumentException
- when one of the parameters isnull
or empty.- Since:
- 1.1.0
-
getCardDigitizationState
public void getCardDigitizationState(@NonNull String cardID, @NonNull D1Task.Callback<CardDigitizationState> 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.
-
addDigitalCardToOEM
public void addDigitalCardToOEM(@NonNull String cardID, @NonNull D1Task.Callback<Void> callback)
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)
API- Parameters:
cardID
- The card identifiercallback
- The callback for the result. When it succeeds, the returned argument of theD1Task.Callback.onSuccess(Object)
is always null.- 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)
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.
-
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.
-
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.
-
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.- 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.- Throws:
IllegalArgumentException
- when one of the parameter is null or emptyIllegalStateException
- when core module has not been configured- Since:
- 2.0.0
-
updatePushToken
public void updatePushToken(@NonNull String token, @NonNull D1Task.Callback<Void> callback)
Update new push token- Parameters:
token
- The latest push notification tokencallback
- The callback for the result- Since:
- 2.0.0
-
processPushMessage
public void processPushMessage(@NonNull Map<String,String> data, @NonNull D1Task.Callback<String> callback)
Process the pushed data received from notification server- Parameters:
data
- The pushed datacallback
- The callback for the result- Since:
- 2.0.0
-
getD1PayWallet
@NonNull public D1PayWallet getD1PayWallet()
Retrieve D1PayWallet object for D1 Payment use cases- Since:
- 2.0.0
-
-