ActivateStatusListener
Call the ActivateStatusListener API to monitor the status of the activatePayment API.
Method signature
public interface ActivateStatusListener {
void onActivateResult(int result, String errorCode, String errorMessage);
}Note:
- ACTapManager provides three methods for managing this listener:
setActivateStatusListener,addActivateStatusListener, andremoveActivateStatusListener.- Be aware of the following behaviors:
setActivateStatusListenerdoes not replace or clear previously registered listeners. It delegates toaddActivateStatusListenerinternally, so calling it multiple times (for example, on every login) accumulates listeners. Listeners are deduplicated by object reference only.- Accumulating listeners causes duplicate callbacks for the same event. To avoid duplicate callbacks, call removeActivateStatusListener to remove the listener before re-registering it.
- removeActivateStatusListener removes a listener by object reference. If the specified listener was never added, it silently does nothing.
Request parameters
Method | Item | Type | Description | Required |
onActivateResult | result | int | The processing result of the activatePayment API. For valid values, see Token status. | Yes |
errorCode | String | The result code. For more information, see Result codes. | Yes | |
errorMessage | String | The result message. For more information, see Result codes. | Yes |
Token status
Code | Value | Description | Further action | Returned by |
|
| No user is connected, or the user has already disconnected. | Call connect with the user id. | isPaymentAvailable, activatePayment, and activatePaymentInSlientMode |
|
| The token status could not be determined. Possible causes: an invalid input parameter (errorCode | Check the errorCode returned with this value to identify the cause. | isPaymentAvailable, activatePayment, and activatePaymentInSlientMode |
|
| No card exists for this user, or the card is not activated, is marked for deletion, or is in an unresolvable state. | Call activatePayment. If errorCode | isPaymentAvailable, activatePayment, and activatePaymentInSlientMode |
|
| The card is active but has no credentials available for payment. | Call replenish. | isPaymentAvailable, activatePayment, and activatePaymentInSlientMode |
|
| The card is active and has at least one valid credential. This is the only value that confirms a tap can succeed. | No action required. | isPaymentAvailable, activatePayment, and activatePaymentInSlientMode |
|
| The card is suspended by the server. | Call unlock. | isPaymentAvailable, activatePayment, and activatePaymentInSlientMode |
|
| The card is active but the user has not yet confirmed it. | Call activatePayment with NFCActivateParams.setDoConfirm(true). | isPaymentAvailable, activatePayment, and activatePaymentInSlientMode |
Note: This table lists only the token status values that
onActivateResultreturns. If an activation is already in progress,onActivateResultreturns code0paired with result code10010. For the complete list of token status values and which API calls can return each value, see Token status.
Response parameters
N/A
Sample
ACTapManager manager = ACTapManager.getInstance(this.getApplication());
manager.setActivateStatusListener(new ActivateStatusListener() {
@Override
public void onActivateResult(int result, String errorCode, String errorMessage) {
}
});