Obter informações sobre o terminal
Para acessar informações detalhadas sobre o terminal e o SDK integrado, como o número de série do terminal ou a versão do SDK, utilize a função getInformation da classe SmartInformationTools.
Acesse essa função pelo objeto MPManager, como no exemplo a seguir.
val informationTools = MPManager.smartInformationTools
informationTools.getInformation { response ->
response.doIfSuccess { smartInformation ->
// Tratar as informações do dispositivo e da integração
val deviceSerialNumber = smartInformation.smartDevice.serialNumber
val brandName = smartInformation.smartDevice.brandName
val modelName = smartInformation.smartDevice.modelName
val paymentModuleVersion = smartInformation.smartDevice.paymentModuleVersion
val sdkVersion = smartInformation.integration.nativeSdkVersion
}.doIfError { error ->
// Tratar o erro na solicitação de informações
}
}
final SmartInformationTools smartInformationTools = MPManager.INSTANCE.getSmartInformationTools();
final Function1<MPResponse<SmartInformation>, Unit> callback = (final MPResponse<SmartInformation> response) -> {
if (response.getStatus() == ResponseStatus.SUCCESS) {
// Tratar as informações do dispositivo e da integração
final String deviceSerialNumber = response.getData().getSmartDevice().getSerialNumber();
final String brandName = response.getData().getSmartDevice().getBrandName();
final String modelName = response.getData().getSmartDevice().getModelName();
final String paymentModuleVersion = response.getData().getSmartDevice().getPaymentModuleVersion();
final String sdkVersion = response.getData().getIntegration().getNativeSdkVersion();
} else {
// Tratar o erro na solicitação de informações
}
return Unit.INSTANCE;
};
smartInformationTools.getInformation(callback);
| Campo | Descrição |
serialNumber | Número de série do terminal. |
brandName | Nome da marca do terminal. |
modelName | Nome do modelo do terminal. |
paymentModuleVersion | Versão do módulo de pagamento do SmartPos. |
nativeSdkVersion | Versão do SDK nativo para integrações. |