Interface D1PayWallet
-
public interface D1PayWallet
Entry point to manage the D1Pay wallet- Since:
- 2.0.0
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addDigitalCard(String cardID, D1Task.Callback<Void> callback)
Add Digital Card for a givencardID
for D1 Pay.void
getCardDigitizationState(String cardID, D1Task.Callback<CardDigitizationState> callback)
Get digital card state for a givencardID
for D1 Pay.void
getDefaultPaymentDigitalCard(D1Task.Callback<String> callback)
Retrieve the card identifiercardID
of default D1 Pay digital card.void
getDigitalCard(String cardID, D1Task.Callback<D1PayDigitalCard> callback)
Retrieve D1 Pay digital card for a givencardID
.void
getDigitalCardList(D1Task.Callback<Map<String,D1PayDigitalCard>> callback)
Retrieve D1 Pay digital card list.void
registerD1PayDataChangedListener(D1PayDataChangedListener listener)
Register to receive notification on following events: Digitization is completed, by having state is Active D1Pay Digital Card state is updated Virtual/Physical Card is renewedvoid
replenish(String cardID, boolean isForced, DeviceAuthenticationCallback authCallback, D1Task.Callback<Void> completionCallback)
Replenish the given card identifierstatic void
reset(Context context)
When the Mobile Payment Application - MPA receives an unrecoverable errorD1Exception.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
startManualModePayment(String cardID)
To start proximity payment from the application.void
unRegisterD1PayDataChangedListener()
Unregister the D1Pay data changed listenervoid
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 acardID
-
-
-
Method Detail
-
registerD1PayDataChangedListener
void registerD1PayDataChangedListener(@NonNull D1PayDataChangedListener listener)
Register to receive notification on following events:- Digitization is completed, by having state is Active
- D1Pay Digital Card state is updated
- Virtual/Physical Card is renewed
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.
- Parameters:
listener
- The callback
-
unRegisterD1PayDataChangedListener
void unRegisterD1PayDataChangedListener()
Unregister the D1Pay data changed listener- See Also:
D1PayDataChangedListener
-
addDigitalCard
void addDigitalCard(@NonNull String cardID, @NonNull D1Task.Callback<Void> callback)
Add Digital Card for a givencardID
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.- Parameters:
cardID
- The card identifiercallback
- The callback for the intermediate result. As it requires Push Notification, final status will be given onD1PayDataChangedListener
. When it succeeds, the returned argument of theD1Task.Callback.onSuccess(Object)
is always null.
-
getCardDigitizationState
void getCardDigitizationState(@NonNull String cardID, @NonNull D1Task.Callback<CardDigitizationState> callback)
Get digital card state for a givencardID
for D1 Pay.D1Task.login(byte[], D1Task.Callback)
is not required before invoking this API.- Parameters:
cardID
- The card identifiercallback
- The callback for theCardDigitizationState
state. When it succeeds, the returned argument of theD1Task.Callback.onSuccess(Object)
is always non-null.
-
reset
static void reset(@NonNull Context context) throws D1Exception
When the Mobile Payment Application - MPA receives an unrecoverable errorD1Exception.ErrorCode.ERROR_D1PAY_UNRECOVERABLE
it is suggested to call this API to reset all of the internal local data and retry the operation again.- Parameters:
context
- The application context- Throws:
D1Exception
- If error happens while resetting the local storage. The application should stop calling D1 Pay API and ask for technical support with detail log.- See Also:
D1Exception.ErrorCode.ERROR_D1PAY_UNRECOVERABLE
-
replenish
void replenish(@NonNull String cardID, boolean isForced, @NonNull DeviceAuthenticationCallback authCallback, @NonNull D1Task.Callback<Void> completionCallback)
Replenish the given card identifierD1Task.login(byte[], D1Task.Callback)
is not required before invoking this API.- Parameters:
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 theD1Task.Callback.onSuccess(Object)
is always null.
-
getDigitalCard
void getDigitalCard(@NonNull String cardID, @NonNull D1Task.Callback<D1PayDigitalCard> callback)
Retrieve D1 Pay digital card for a givencardID
.D1Task.login(byte[], D1Task.Callback)
is not required before invoking this API.- Parameters:
cardID
- The card identifiercallback
- The callback for result. When it succeeds, the returned argument of theD1Task.Callback.onSuccess(Object)
is always non-null.
-
getDigitalCardList
void getDigitalCardList(@NonNull D1Task.Callback<Map<String,D1PayDigitalCard>> callback)
Retrieve D1 Pay digital card list.D1Task.login(byte[], D1Task.Callback)
is not required before invoking this API.- Parameters:
callback
- The callback for result, containing map ofcardID
andD1PayDigitalCard
. When it succeeds, the returned argument of theD1Task.Callback.onSuccess(Object)
is always non-null.
-
getDefaultPaymentDigitalCard
void getDefaultPaymentDigitalCard(@NonNull D1Task.Callback<String> callback)
Retrieve the card identifiercardID
of default D1 Pay digital card.D1Task.login(byte[], D1Task.Callback)
is not required before invoking this API.- Parameters:
callback
- The callback for result, containingcardID
if any or null if no default card.
-
setDefaultPaymentDigitalCard
void setDefaultPaymentDigitalCard(@NonNull String cardID, @NonNull D1Task.Callback<Void> callback)
Set the DigitalizedCard as the default payment card.D1Task.login(byte[], D1Task.Callback)
is not required before invoking this API.- Parameters:
cardID
- The card identifiercallback
- The callback for result. When it succeeds, the returned argument of theD1Task.Callback.onSuccess(Object)
is always null.
-
unsetDefaultPaymentDigitalCard
void unsetDefaultPaymentDigitalCard(@NonNull D1Task.Callback<Void> callback)
Remove the current default D1 Pay digital card.D1Task.login(byte[], D1Task.Callback)
is not required before invoking this API.- Parameters:
callback
- The callback for result. When it succeeds, the returned argument of theD1Task.Callback.onSuccess(Object)
is always null.
-
updateDigitalCard
void updateDigitalCard(@NonNull String cardID, @NonNull D1PayDigitalCard d1PayDigitalCard, @NonNull CardAction cardAction, @NonNull D1Task.Callback<Boolean> callback)
Update D1 Pay digital card status for acardID
D1Task.login(byte[], D1Task.Callback)
is required before invoking this API.- Parameters:
cardID
- The card identifierd1PayDigitalCard
- The digital card received fromgetDigitalCard(String, D1Task.Callback)
orgetDigitalCardList(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 onD1PayDataChangedListener
. When it succeeds, the returned argument of theD1Task.Callback.onSuccess(Object)
is always non-null.
-
startManualModePayment
void startManualModePayment(@NonNull String cardID)
To start proximity payment from the application.D1Task.login(byte[], D1Task.Callback)
is required before invoking this API.The API allows manual trigger of payment, for example, when the user manually selects a card.
Set the listener by calling
D1PayConfigParams.setManualModeContactlessTransactionListener(ContactlessTransactionListener)
to listen to transaction events:- Parameters:
cardID
- The card identifier
-
-