Environment configurations
This document introduces the SDK environment configurations for different phases or scenarios.
Card activation phase
The following table lists the configurations used during the card activation phase. Omit any key to use the default value.
Key | Configuration | Supported SDK version | Data type | Description |
nfc_issue_config | applyTokenTimes | 1.0.0 | Number | The number of polls for the token application. Default value: |
applyTokenInterval | 1.0.0 | Number | The polling interval for the token application. The unit is milliseconds (ms). Default value: | |
activateTimes | 1.0.0 | Number | The number of polls for the activation. Default value: | |
activateInterval | 1.0.0 | Number | The polling interval for the activation. The unit is milliseconds (ms). Default value: | |
sessionTimes | 1.0.0 | Number | The number of polls for the session. Default value: | |
sessionInterval | 1.0.0 | Number | The polling interval for the session. The unit is milliseconds (ms). Default value: |
Sample
The following sample shows a custom configuration.
{
"nfc_issue_config": {
"applyTokenTimes": 25,
"applyTokenInterval": 2000,
"activateTimes": 7,
"activateInterval": 1000,
"sessionTimes": 7,
"sessionInterval": 1500
}
}Transaction phase
The following table lists the configurations used during the transaction phase.
Key | Configuration | Supported SDK version | Data type | Description |
nfc_transaction_config | isSupportTransit | 1.0.0 | Boolean | Indicates whether to support transportation scenarios. Valid values are:
Default value: This remote configuration takes precedence over isSupportTransit passed via the init API. |
isSupportTransitWithoutConsent | 1.1.12 | Boolean | Indicates whether the traffic payment is supported while the screen is locked. Valid values are:
Default value: This remote configuration takes precedence over isSupportLockScreenPay passed via the init API. | |
requireDeviceUnlock | 1.2.11 | Boolean | Indicates whether the device must be unlocked to use NFC functionality. Valid values are:
Default value: | |
allowTapTransaction | 1.2.11 | Boolean | Indicates whether the NFC functionality is enabled. Valid values are:
Default value: | |
isSupportCardStatusJudgement | 1.2.19 | Boolean | Indicates whether to support card status judgment in advance. Valid values are:
Default value: | |
failedCallbackInterval | 1.2.18 | Int | The interval between the reports of the same error code. The unit is milliseconds (ms). Default value: | |
isWalletActionRequired | 1.2.18 | Boolean | Whether the refund process requires a second confirmation. Valid values are:
Default value: | |
isSupportCardProfileRepair | 1.2.19 | Boolean | Indicates whether to support card token re-activation if a card content parsing error occurs. Valid values are:
Default value: | |
isCheckTransitAdvancePayLimit | 1.4.5 | Boolean | Indicates whether to check the payment amount limit of the transit card. Valid values are:
Default value: | |
isSwitchDBStorage | 1.5.0 | Boolean | Indicates whether to switch to DB storage. Valid values are:
Default value: | |
isSwitchInitCard | 1.5.0 | Boolean | Indicates whether to switch to a new initialization card token information in the tap process. Valid values are:
Default value: | |
isEventTransactionTrackingV2 | 1.5.0 | Boolean | Indicates whether to switch to the SDK version 1.5 parameters of the NFCMonitor API. Valid values are:
Default value: | |
sameTapJudgementLevel | 1.5.0 | Int | The time interval between two taps that will be considered as the same tap. The unit is milliseconds (ms). Default value: | |
timeOfDelayReport | 1.5.0 | Int | The time delay to report failure results after a business failure. The unit is milliseconds (ms). Default value: | |
isSupportNewTransactionResultReport | 1.5.0 | Boolean | Indicates whether to support the new transaction result report mechanism. Valid values are:
Default value: | |
isSubmitFirstFailReason | 1.5.1 | Boolean | Indicates whether to report only the first failure reason during a transaction. When this key is set to Default value: | |
isTransactionCallbackAsync | 1.11.0 | Boolean | Indicates whether transaction callbacks are dispatched on a background thread. When this key is set to Default value: | |
isAutoRotateCredentialsEnabled | 1.9.0 | Boolean | Indicates whether the SDK automatically rotates transaction credentials when they are running low, without requiring an explicit replenish call. Default value: | |
isSupportLeByteAbsence | 1.5.1 | Boolean | Indicates whether the SDK accepts APDU commands that omit the Le byte. When this key is set to Default value: | |
isResetProvider | 1.5.0 | Boolean | Indicates whether the SDK storage provider is reset during initialization. Resetting clears locally cached configuration. Set to Default value: | |
useLocalConfig | 1.10.0 | Boolean | Indicates whether the built-in local configuration is used when remote configuration is unavailable. Default value: |
Sample
{
"nfc_transaction_config": {
"isSupportTransit": false,
"isSupportTransitWithoutConsent": false,
"isSupportTapWithoutConsent": false,
"isOnlySupportAggregate": true,
"isWalletActionRequired": false,
"isChangeDeclineToTryAgain": false,
"isCheckPreTapContext": true,
"isSupportCardProfileRepair": true,
"isSupportCardStateCheckAtFinalAssessment": false,
"regionTBC": ["0156"],
"useLocalConfig": true,
"allowTapTransaction": true,
"requireDeviceUnlock": false,
"isCheckTransitAdvancePayLimit": false,
"failedCallbackInterval": 0,
"isSupportNewTransactionResultReport": false,
"sameTapJudgementLevel": 0,
"timeOfDelayReport": 0,
"isSubmitFirstFailReason": false,
"isTransactionCallbackAsync": false,
"isAutoRotateCredentialsEnabled": false,
"isSupportLeByteAbsence": false,
"isResetProvider": true,
"asyncAmountLimitSwitch": false,
"canQueryAmountLimit": false
}
}Transit phase
The following table lists configurations specifically for transit scenarios.
Key | Configuration | Supported SDK version | Data type | Description |
nfc_transit_config | terminalCountryCode | 1.1.16 | String | The country code of the transaction. |
merchantCategoryCode | 1.1.16 | String | The merchant category code (MCC) that represents the categorization of the merchant's business type. | |
currencyAmount | 1.1.16 | Number | The transaction amount. | |
merchantNameAndLocation | 1.1.16 | String | The merchant's name, address, and location. |
Sample
{
"nfc_transit_config": [
{
"terminalCountryCode": "0458",
"merchantCategoryCode": "4131"
},
{
"terminalCountryCode": "0458",
"merchantCategoryCode": "4111"
},
{
"terminalCountryCode": "0458",
"merchantCategoryCode": "4784"
},
{
"terminalCountryCode": "0458",
"merchantCategoryCode": "1234"
},
{
"terminalCountryCode": "0458",
"merchantCategoryCode": "0000"
}
]
}Initialization phase
The following table lists the configurations used during the initialization phase.
Key | Configuration | Supported SDK version | Data type | Description |
nfc_init_config | init_monitor | 1.1.25 | Boolean | Indicates whether to activate initialization monitoring. If it is set to If this key is absent from the remote configuration, the value falls back to the setting provided through APNFCConfig.Builder.setInitMonitorDefault(Boolean) in the init API. Default value: |
next_step_type | 1.1.25 | Number | The next step to do upon detecting a previous crash.Valid values are:
Default value: | |
invalidate_time_stamp | 1.1.25 | Number | The validity period for the recorded initialization flag. The unit of this value is seconds (s). Default value: | |
vtee_precheck_enabled | 1.11.0 | Boolean | Indicates whether the virtual Trusted Execution Environment (vTEE) compatibility check runs during initialization. When enabled, the SDK verifies that the device supports vTEE before proceeding. Disable this only when instructed by Alipay+. Default value: |
Sample
{
"nfc_init_config": {
"init_monitor": false,
"next_step_type": 1,
"invalidate_time_stamp": 1209600
}
}Transaction blacklist
The following table lists configurations for the transaction blacklist.
Key | Configuration | Supported SDK version | Data type | Description |
nfc_transaction_black | countrycode values | 1.1.27 | List<String> | The transaction types that are blacklisted. For the valid transaction types, see Transaction types. |
Transaction types
The following table lists the transaction types and their corresponding richTransactionType.
Value | Corresponding richTransactionType | Description |
| N/A | All transaction types |
|
| Ordinary transactions |
|
| Refund |
|
| Cash withdrawal |
|
| Transit transactions |
|
| Purchases with cashback |
Sample
{
"nfc_transaction_black": {
"0344": [
"TRANSIT"
],
"0156": [
"ALL"
]
}
}Transaction whitelist
The following table lists the configurations about the transaction whitelist.
Key | Configuration | Supported SDK version | Data type | Description |
nfc_transaction_white | terminalCountryCode | 1.4.3 | String | The country code of the transaction. |
transactionType | 1.4.3 | String | Transaction types. Valid values are:
| |
needDebitBin | 1.4.3 | Boolean | Indicates whether debit card bins are required. |
Sample
{
"nfc_transaction_white": [
{
"terminalCountryCode": "0344",
"transactionType": "PURCHASE",
"needDebitBin": false
}
]
}Manage configurations with blacklist and whitelist
The following table lists configurations for managing nfc_transaction_config items using blacklists and whitelists.
Note: Only the allowTapTransaction configuration is supported.
Key | Configuration | Supported SDK version | Data type | Description |
nfc_payment_access_control_config | key | 1.2.18 | String | The configuration that needs to be managed according to the blacklist and whitelist. Valid value is |
blackList | 1.2.18 | List<String> | A list of user IDs, who are blacklisted and the configuration for them is set to | |
whiteList | 1.2.18 | List<String> | A list of user IDs, who are whitelisted and the configuration for them is set to |
Sample
{
"nfc_payment_access_control_config": [
{
"key": "allowTapTransaction",
"blackList": ["123", "456", "789"], // Users that are not allowed to make tap payment
"whiteList": ["123", "456"] // Users that are allowed to make tap payment
},
// other configurations
...
]
}