Alipay+ DocsAlipay+ Docs

DeviceFingerPrintService

The DeviceFingerPrintService is a device SPI that enables the SDK to request device fingerprints from the MPP. The service requires SHA-256 encryption.

Note: If this SPI is not implemented, or if the returned device fingerprint does not use SHA-256 encryption, the SDK will return a PARAMS_ERROR during card activation.

Method signature

copy
public interface DeviceFingerPrintService {
    String getDeviceFingerPrint();
}

Request parameters

Method

Item

Type

Description

Required

getDeviceFingerPrint()

N/A

Function

Obtains the device fingerprint.

Yes

Response parameters

Method

Item

Type

Description

Required

getDeviceFingerPrint

result

String

The device fingerprint.

Note: The returned value must be a 64-character hexadecimal SHA-256 digest. If the returned value is empty or has an incorrect length, activatePayment fails with error code 10011 (INPUT_PARAMS) without making any network call.

Yes

Sample

copy
class DeviceIdService(val utdid: String): DeviceFingerPrintService {
    override fun getDeviceFingerPrint(): String? {
        return DeviceHelper.getDeviceFingerprint(utdid)
    }
}