From 9318a47e4bb823b10e7a0e8a3c999e7e4a924a0a Mon Sep 17 00:00:00 2001 From: Marek Stransky <77441794+Hopsaheysa@users.noreply.github.com> Date: Wed, 13 Dec 2023 11:30:53 +0100 Subject: [PATCH] Replace `timestampRequested ` and `timestampSigned ` with `timestampReceived ` and `timestampSent ` (#119) --- docs/Using-Operations-Service.md | 6 +++--- .../operation/model/AuthorizeRequestObject.kt | 18 +++++++++--------- .../api/operation/model/UserOperation.kt | 2 +- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/docs/Using-Operations-Service.md b/docs/Using-Operations-Service.md index 7d186ae..db38ce2 100644 --- a/docs/Using-Operations-Service.md +++ b/docs/Using-Operations-Service.md @@ -501,7 +501,7 @@ class ProximityCheck { val type: ProximityCheckType /** Timestamp when the operation was scanned (QR Code) or delivered to the device (Deeplink) */ - val timestampRequested: ZonedDateTime = ZonedDateTime.now() + val timestampReceived: ZonedDateTime = ZonedDateTime.now() } ``` @@ -556,10 +556,10 @@ When the app is launched via a deeplink, preserve the data from the deeplink and Once the QR code is scanned or match from the deeplink is found, create a `WMTProximityCheck` with: - `totp`: The actual Time-Based One-Time Password. - `type`: Set to `ProximityCheckType.QR_CODE` or `ProximityCheckType.DEEPLINK`. - - `timestampRequested`: The timestamp when the QR code was scanned (by default, it is created as the current timestamp when the object is instantiated). + - `timestampReceived`: The timestamp when the QR code was scanned (by default, it is created as the current timestamp when the object is instantiated). - Authorizing the ProximityCheck - When authorizing, the SDK will by default add `timestampSigned` to the `ProximityCheck` object. This timestamp indicates when the operation was signed. + When authorizing, the SDK will by default add `timestampSent` to the `ProximityCheck` object. This timestamp indicates when the operation was sent. ### PACUtils - For convenience, utility class for parsing and extracting data from QR codes and deeplinks used in the PAC (Proximity Anti-fraud Check), is provided. diff --git a/library/src/main/java/com/wultra/android/mtokensdk/api/operation/model/AuthorizeRequestObject.kt b/library/src/main/java/com/wultra/android/mtokensdk/api/operation/model/AuthorizeRequestObject.kt index ca7ae24..fdfb00a 100644 --- a/library/src/main/java/com/wultra/android/mtokensdk/api/operation/model/AuthorizeRequestObject.kt +++ b/library/src/main/java/com/wultra/android/mtokensdk/api/operation/model/AuthorizeRequestObject.kt @@ -37,15 +37,15 @@ internal data class AuthorizeRequestObject( val proximityCheck: ProximityCheckData? = null ) { - constructor(operation: IOperation, timestampSigned: ZonedDateTime = ZonedDateTime.now()): this( + constructor(operation: IOperation, timestampSent: ZonedDateTime = ZonedDateTime.now()): this( operation.id, operation.data, operation.proximityCheck?.let { ProximityCheckData( it.totp, it.type, - it.timestampRequested, - timestampSigned + it.timestampReceived, + timestampSent ) } ) @@ -61,11 +61,11 @@ internal data class ProximityCheckData( @SerializedName("type") val type: ProximityCheckType, - /** Timestamp when the operation was delivered to the app */ - @SerializedName("timestampRequested") - val timestampRequested: ZonedDateTime, + /** Timestamp when the operation was received by the */ + @SerializedName("timestampReceived") + val timestampReceived: ZonedDateTime, - /** Timestamp when the operation was signed */ - @SerializedName("timestampSigned") - val timestampSigned: ZonedDateTime + /** Timestamp when the operation was sent */ + @SerializedName("timestampSent") + val timestampSent: ZonedDateTime ) diff --git a/library/src/main/java/com/wultra/android/mtokensdk/api/operation/model/UserOperation.kt b/library/src/main/java/com/wultra/android/mtokensdk/api/operation/model/UserOperation.kt index 8554677..cdedb64 100644 --- a/library/src/main/java/com/wultra/android/mtokensdk/api/operation/model/UserOperation.kt +++ b/library/src/main/java/com/wultra/android/mtokensdk/api/operation/model/UserOperation.kt @@ -193,7 +193,7 @@ data class ProximityCheck( val type: ProximityCheckType, /** Timestamp when the operation was scanned (qrCode) or delivered to the device (deeplink) */ - val timestampRequested: ZonedDateTime = ZonedDateTime.now() + val timestampReceived: ZonedDateTime = ZonedDateTime.now() ) /**