Manage in-app card controls
Let end users view and update domain controls from the issuer application using the D1 SDK.
Sequence Diagram
Use the D1 SDK to retrieve current settings, render your UI, then submit updates.
Pre-requisites
Consumer and card already created/registered in D1.
SDK is properly initialised.
Issuer App called D1 SDK login API.
Before calling of updateCardControlSettings or updateCardLimitSettings API, please call getCardSettings API first.
D1 SDK Integration
D1 SDK uses these public APIs for cards managed in D1:
CardService.getCardSettings(): To retrieve the card settings.CardService.updateCardControlSettings(): To update the card control settings.
Retrieve current settings
CardService.getCardSettings() returns two groups of settings:
Card control settings (domain controls)
Card limit setting (spending limits) refer to the API documentation for the detailed field-level information on card control and card limit settings.
See the D1 SDK API reference for field-level details.
If you also implement spending limits, see Implement Spending Limits.
Render card control settings in your UI
Read card controls from the CardSettings object, then render only the controls that exist.
Some controls are optional at Card Product level. D1 returns them as null. Hide those controls.
Update card control settings
Treat card control updates as a sensitive operation.
Perform additional authentication before modifying card settings.
Always start from a
CardSettingsobject returned byCardService.getCardSettings().Never create a
CardSettingsobject yourself.
If you send a self-initialized object to CardService.updateCardControlSettings(), you can overwrite existing values on the D1 backend. You can also trigger errors like ERROR_CARD_SETTINGS_OPERATION_NOT_ALLOWED, ERROR_CARD_SETTINGS_INVALID_FORMAT, or ERROR_CARD_SETTINGS_INVALID_VALUE.
Prerequisites and allowed updates
Before you update a control, verify that D1 returned the corresponding attribute in getCardSettings().
D1 SDK returns ERROR_CARD_SETTINGS_OPERATION_NOT_ALLOWED when the end user updates a control that is not available.
The following table shows the prerequisite for the respective control settings:
CardControlSettings.setOnlinePaymentEnabled(true)
N/A
CardControlSettings.setAbroadPaymentEnabled(true)
N/A
CardControlSettings.setDeniedCurrencyList()
N/A
CardControlSettings.Merchant.setGamblingMerchantEnabled(true)
N/A
CardControlSettings.Merchant.setAdultMerchantEnabled(true)
N/A
CardControlSettings.Merchant.setRiskyMerchantEnabled(true)
N/A
CardControlSettings.setContactlessEnabled(true)
If the isContactlessEnabled attribute is retrieved from the CardService.getCardSettings() API, then an update operation is allowed.
CardControlSettings.setMagneticStripeEnabled(true)
If the isMagneticStripeEnabled attribute is retrieved from the CardService.getCardSettings() API, then an update operation is allowed.
CardControlSettings.setATMWithdrawalEnabled(true)
If the isATMWithdrawalEnabled attribute is retrieved from the CardService.getCardSettings() API, then an update operation is allowed.
Input validation and errors
D1 SDK can return:
The
ERROR_CARD_SETTINGS_INVALID_FORMATerror code to the issuer application when the end user tries to update the card control setting with an invalid formatted input.The
ERROR_CARD_SETTINGS_INVALID_VALUEerror code when the end user tries to update card control settings where the format is correct but the input value is incorrect.
Use the following formats for list-based controls:
CardControlSettings.getGeography().setCountryList()
Refer to ISO 3166-1 alpha-2 format for the country code formats allowed. If the format is invalid, D1 SDK will propagate the error to the issuer application. Refer to the Android Country API to prevent such error from happening.
CardControlSettings.setDeniedCurrencyList()
Refer to ISO 4217 alpha code format for allowed currencies code formats. If the format is invalid, D1 SDK will propagate the error to the issuer application. Refer to Android Currency API to prevent such error from happening.
Use the following examples to submit updates:
Next steps
If you use geography by region, see Supported Regions.
If you need the default MCC groups, see Default Merchant type.
Last updated
Was this helpful?