Package com.thalesgroup.gemalto.d1
Class CardDetailsUI
java.lang.Object
com.thalesgroup.gemalto.d1.CardDetailsUI
A type to represent the UI component required to display the card details securely.
It is an enhanced version of
D1Task.getCardDetails(String, D1Task.Callback) API.
By using CardDetailsUI API, DisplayTextView#getText() will always return empty.
To retrieve the value, DisplayTextView.insecureCopyToClipboard() should be called.- Since:
- 2.1.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic CardDetailsUIgetInstance(DisplayTextView panTextView, DisplayTextView expiryDateTextView, DisplayTextView cvvTextView, DisplayTextView cardHolderNameTextView) Initializer to construct a CardDetailsUI.abstract voidTo mask card details.abstract voidsetExpiryDateFormat(String expiryDateFormat) To set date format used in expiry date.abstract voidsetPanMaskCharacter(String panMaskCharacter) To set mask character for PAN.abstract voidsetPanSeparatorCharacter(String panSeparatorCharacter) To set separator character for PAN every 4 characters, e.g.abstract voidshowCardDetails(D1Task.Callback<Void> callback) To show card details securely.abstract voidwipe()Wipe the content of the displayed card details.
-
Constructor Details
-
CardDetailsUI
public CardDetailsUI()
-
-
Method Details
-
getInstance
public static CardDetailsUI getInstance(@Nullable DisplayTextView panTextView, @Nullable DisplayTextView expiryDateTextView, @Nullable DisplayTextView cvvTextView, @Nullable DisplayTextView cardHolderNameTextView) Initializer to construct a CardDetailsUI.- Parameters:
panTextView- The text view to display the PAN securely.expiryDateTextView- The text view to display the expiry date securely.cvvTextView- The text view to display the CVV securely.cardHolderNameTextView- The text view to display the card holder name securely.
-
setPanSeparatorCharacter
To set separator character for PAN every 4 characters, e.g. when the separator character is ' ', PAN is displayed 1234 5678 1234 5678. By default, it is set to ' '.- Parameters:
panSeparatorCharacter- a string for PAN separation
-
setPanMaskCharacter
To set mask character for PAN. It is used in `maskCardDetails()`. By default, it is set to '*'.- Parameters:
panMaskCharacter- a string for PAN mask
-
setExpiryDateFormat
To set date format used in expiry date. By default, it is set to "MM/yy".- Parameters:
expiryDateFormat- a string for expiry date format- See Also:
-
- SimpleDateFormat for acceptable date format.
-
showCardDetails
To show card details securely.When
D1Task.displayCardDetails(String, CardDetailsUI, D1Task.Callback)is called, it is showing the card details; thus there is no need to call this API.This API should only be called after successful
D1Task.displayCardDetails(String, CardDetailsUI, D1Task.Callback). It is convenient method to show the card details again aftermaskCardDetails()is called.- Parameters:
callback- The callback invoked when the operation is completed. When it succeeds, the returned argument of theCallback#onSuccess(Object)is always null. Otherwise, it returns error
Error details.
-
maskCardDetails
public abstract void maskCardDetails()To mask card details.This API update the UI so that only last 4 digit and expiry date is visible. CVV and card holder name is removed.
To show the card details, call
showCardDetails(D1Task.Callback). -
wipe
public abstract void wipe()Wipe the content of the displayed card details.
-