public class D1PayWallet extends Object
Constructor and Description |
---|
D1PayWallet(AddCardHandler addCardHandler,
TPCWrapper tpcWrapper)
Internal usage only
|
Modifier and Type | Method and Description |
---|---|
void |
addDigitalCard(String cardID,
D1Task.Callback<Void> callback)
Add Digital Card for a given
cardID for D1 Pay. |
void |
getCardDigitizationState(String cardID,
D1Task.Callback<CardDigitizationState> callback)
Get digital card state for a given
cardID for D1 Pay. |
void |
getDefaultPaymentDigitalCard(D1Task.Callback<String> callback)
Retrieve the card identifier
cardID of default D1 Pay digital card. |
void |
getDigitalCard(String cardID,
D1Task.Callback<D1PayDigitalCard> callback)
Retrieve D1 Pay digital card for a given
cardID . |
void |
getDigitalCardList(D1Task.Callback<Map<String,D1PayDigitalCard>> callback)
Retrieve D1 Pay digital card list.
|
void |
registerD1PayDataChangedListener(D1PayDataChangedListener listener)
Register to receive D1Pay Digital Card update on following events:
Digitization is completed, by having state is Active
D1Pay Digital Card state is updated
|
void |
replenish(String cardID,
boolean isForced,
DeviceAuthenticationCallback authCallback,
D1Task.Callback<Void> completionCallback)
Replenish the given card identifier
|
static void |
reset(Context context)
When the Mobile Payment Application - MPA receives an unrecoverable error
D1Exception.ErrorCode.ERROR_D1PAY_UNRECOVERABLE
it is suggested to call this API to reset all of the internal local data and retry the operation again. |
void |
setDefaultPaymentDigitalCard(String cardID,
D1Task.Callback<Void> callback)
Set the DigitalizedCard as the default payment card.
|
void |
unRegisterD1PayDataChangedListener()
Unregister the D1Pay data changed listener
|
void |
unsetDefaultPaymentDigitalCard(D1Task.Callback<Void> callback)
Remove the current default D1 Pay digital card.
|
void |
updateDigitalCard(String cardID,
D1PayDigitalCard d1PayDigitalCard,
CardAction cardAction,
D1Task.Callback<Boolean> callback)
Update D1 Pay digital card status for a
cardID |
public D1PayWallet(@NonNull AddCardHandler addCardHandler, @NonNull TPCWrapper tpcWrapper)
public void registerD1PayDataChangedListener(@NonNull D1PayDataChangedListener listener)
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.
listener
- The callbackpublic void unRegisterD1PayDataChangedListener()
D1PayDataChangedListener
public void addDigitalCard(@NonNull String cardID, @NonNull D1Task.Callback<Void> callback)
cardID
for D1 Pay.
If it is the first card, it will be automatically set as Default Card for Payment.
D1Task.login(byte[], D1Task.Callback)
is required before invoking this API.
Integrator must register listener on registerD1PayDataChangedListener(D1PayDataChangedListener)
to receive notification when the operation is completed.
cardID
- The card identifiercallback
- The callback for the intermediate result.
As it requires Push Notification, final status will be given on D1PayDataChangedListener
.
When it succeeds, the returned argument of the D1Task.Callback.onSuccess(Object)
is always null.public void getCardDigitizationState(@NonNull String cardID, @NonNull D1Task.Callback<CardDigitizationState> callback)
cardID
for D1 Pay.
D1Task.login(byte[], D1Task.Callback)
is not required before invoking this API.
cardID
- The card identifiercallback
- The callback for the CardDigitizationState
state.
When it succeeds, the returned argument of the D1Task.Callback.onSuccess(Object)
is always non-null.public static void reset(@NonNull Context context) throws D1Exception
D1Exception.ErrorCode.ERROR_D1PAY_UNRECOVERABLE
it is suggested to call this API to reset all of the internal local data and retry the operation again.context
- The application contextD1Exception
- If error happens while resetting the local storage.
The application should stop calling D1 Pay API
and ask for technical support with detail log.D1Exception.ErrorCode.ERROR_D1PAY_UNRECOVERABLE
public void replenish(@NonNull String cardID, boolean isForced, @NonNull DeviceAuthenticationCallback authCallback, @NonNull D1Task.Callback<Void> completionCallback)
D1Task.login(byte[], D1Task.Callback)
is not required before invoking this API.
cardID
- The card identifier.isForced
- The replenishment is forced or not.authCallback
- The callback for device CVM (if needed).
For VISA only!completionCallback
- The callback for the replenishment result.
When it succeeds, the returned argument of the D1Task.Callback.onSuccess(Object)
is always null.public void getDigitalCard(@NonNull String cardID, @NonNull D1Task.Callback<D1PayDigitalCard> callback)
cardID
.
D1Task.login(byte[], D1Task.Callback)
is not required before invoking this API.
cardID
- The card identifiercallback
- The callback for result.
When it succeeds, the returned argument of the D1Task.Callback.onSuccess(Object)
is always non-null.public void getDigitalCardList(@NonNull D1Task.Callback<Map<String,D1PayDigitalCard>> callback)
D1Task.login(byte[], D1Task.Callback)
is not required before invoking this API.
callback
- The callback for result, containing map of cardID
and D1PayDigitalCard
.
When it succeeds, the returned argument of the D1Task.Callback.onSuccess(Object)
is always non-null.public void getDefaultPaymentDigitalCard(@NonNull D1Task.Callback<String> callback)
cardID
of default D1 Pay digital card.
D1Task.login(byte[], D1Task.Callback)
is not required before invoking this API.
callback
- The callback for result, containing cardID
if any or null if no default card.public void setDefaultPaymentDigitalCard(@NonNull String cardID, @NonNull D1Task.Callback<Void> callback)
D1Task.login(byte[], D1Task.Callback)
is not required before invoking this API.
cardID
- The card identifiercallback
- The callback for result.
When it succeeds, the returned argument of the D1Task.Callback.onSuccess(Object)
is always null.public void unsetDefaultPaymentDigitalCard(@NonNull D1Task.Callback<Void> callback)
D1Task.login(byte[], D1Task.Callback)
is not required before invoking this API.
callback
- The callback for result.
When it succeeds, the returned argument of the D1Task.Callback.onSuccess(Object)
is always null.public void updateDigitalCard(@NonNull String cardID, @NonNull D1PayDigitalCard d1PayDigitalCard, @NonNull CardAction cardAction, @NonNull D1Task.Callback<Boolean> callback)
cardID
D1Task.login(byte[], D1Task.Callback)
is required before invoking this API.
cardID
- The card identifierd1PayDigitalCard
- The digital card received from getDigitalCard(String, D1Task.Callback)
or getDigitalCardList(D1Task.Callback)
cardAction
- The card action to be performed: active, suspend or deletecallback
- The callback when the command is sent successfully to the server.
The final status update is sent through push notification on D1PayDataChangedListener
.
When it succeeds, the returned argument of the D1Task.Callback.onSuccess(Object)
is always non-null.