Obtener información sobre el terminal - Funcionalidades del terminal - Mercado Pago Developers

Obtener información sobre la terminal

Para acceder a información detallada sobre la terminal y el SDK integrado, como el número de serie de la terminal o la versión del SDK, utiliza la función getInformation de la clase SmartInformationTools.

Accede a esta función a través del objeto MPManager, como en el siguiente ejemplo.

val informationTools = MPManager.smartInformationTools
informationTools.getInformation { response ->
   response.doIfSuccess { smartInformation ->
       // Manejar la información del dispositivo e integración
       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 ->
       // Manejar el error en la solicitud de información
   }
}
final SmartInformationTools smartInformationTools = MPManager.INSTANCE.getSmartInformationTools();
final Function1<MPResponse<SmartInformation>, Unit> callback = (final MPResponse<SmartInformation> response) -> {
 if (response.getStatus() == ResponseStatus.SUCCESS) {
   // Manejar la información del dispositivo e integración
   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 {
   // Manejar el error en la solicitud de información
 }
 return Unit.INSTANCE;
};
smartInformationTools.getInformation(callback);
CampoDescripción
serialNumberNúmero de serie de la terminal.
brandNameNombre de la marca de la terminal.
modelNameNombre del modelo de la terminal.
paymentModuleVersionVersión del módulo de pago de SmartPos.
nativeSdkVersionVersión del SDK nativo para integraciones.