Alipay+ DocsAlipay+ Docs

isPaymentAvailable

Call the isPaymentAvailable API to determine if the payment function is available.

Method signature

copy
int isPaymentAvailable();

Request parameters

N/A

Response parameters

Item

Type

Description

Required

result

Int

The Token status code. For the code and the corresponding Token status, see Token status.

Yes

Token status

Code

Token status

-3

White-box cryptography module failed to initialize. Returned before any other status is checked.

-2

Disconnected.

-1

Query failed.

0

The card does not exist.

1

The card exists, but there are no credentials.

Call the replenish API to replenish credentials.

2

Payment is allowed.

3

The card is locked.

Call the unlock API to unlock.

11

The card is in activation.

21

The card is activated successfully but requires secondary confirmation.

Note: isPaymentAvailable checks the following conditions in order and returns immediately when the first condition is met:

  1. Returns -3 if the white-box cryptography module failed to initialize.
  2. Returns -2 if the SDK is not connected.
  3. Returns 11 if a credential replenishment is in progress.
  4. Otherwise, returns the token status retrieved from the local query.

Sample

copy
ACTapManager.getInstance(getApplication()).isPaymentAvailable();