Skip to content

Commit

Permalink
Merge pull request #71 from TinkoffCreditSystems/2.5.2
Browse files Browse the repository at this point in the history
Send "connection_type" and "sdk_version" in Init request
  • Loading branch information
IlnarH authored Dec 1, 2021
2 parents bd0f2da + 1999d30 commit bf40254
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 1 deletion.
7 changes: 7 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
## 2.5.2

#### Fixed
#### Changes
#### Additions
Send "connection_type" and "sdk_version" in Init request

## 2.5.1

#### Fixed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,5 +115,7 @@ abstract class AcquiringRequest<R : AcquiringResponse>(internal val apiMethod: S
const val DATA_TYPE = "DataType"
const val REDIRECT_DUE_DATE = "RedirectDueDate"
const val IP = "IP"
const val CONNECTION_TYPE = "connection_type"
const val SDK_VERSION = "sdk_version"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,8 @@ class InitRequest : AcquiringRequest<InitResponse>(INIT_METHOD) {
}
}

var sdkVersion: String? = null

private var redirectDueDateFormat: String? = null
private val dateFormat = SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ", Locale.getDefault())

Expand Down Expand Up @@ -166,10 +168,13 @@ class InitRequest : AcquiringRequest<InitResponse>(INIT_METHOD) {
}

dataMap[CHARGE_FLAG] = chargeFlag.toString()
dataMap[CONNECTION_TYPE] = CONNECTION_TYPE_MOBILE_SDK
sdkVersion?.let { dataMap[SDK_VERSION] = it }
this[DATA] = dataMap
}

companion object {
private const val RECURRENT_FLAG_Y = "Y"
private const val CONNECTION_TYPE_MOBILE_SDK = "mobile_sdk"
}
}
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
VERSION_NAME=2.5.1
VERSION_NAME=2.5.2
VERSION_CODE=15
GROUP=ru.tinkoff.acquiring

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
package ru.tinkoff.acquiring.sdk.payment

import ru.tinkoff.acquiring.sdk.AcquiringSdk
import ru.tinkoff.acquiring.sdk.BuildConfig
import ru.tinkoff.acquiring.sdk.exceptions.AcquiringApiException
import ru.tinkoff.acquiring.sdk.localization.AsdkLocalization
import ru.tinkoff.acquiring.sdk.models.AsdkState
Expand Down Expand Up @@ -364,6 +365,7 @@ class PaymentProcess internal constructor(private val sdk: AcquiringSdk) {
data = order.additionalData
customerKey = paymentOptions.customer.customerKey
language = AsdkLocalization.language.name
sdkVersion = BuildConfig.VERSION_NAME
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ package ru.tinkoff.acquiring.sdk.viewmodel
import androidx.lifecycle.LiveData
import androidx.lifecycle.MutableLiveData
import ru.tinkoff.acquiring.sdk.AcquiringSdk
import ru.tinkoff.acquiring.sdk.BuildConfig
import ru.tinkoff.acquiring.sdk.localization.AsdkLocalization
import ru.tinkoff.acquiring.sdk.models.DefaultScreenState
import ru.tinkoff.acquiring.sdk.models.LoadedState
Expand Down Expand Up @@ -134,6 +135,7 @@ internal class QrViewModel(handleErrorsInSdk: Boolean, sdk: AcquiringSdk) : Base
data = order.additionalData
customerKey = paymentOptions.customer.customerKey
language = AsdkLocalization.language.name
sdkVersion = BuildConfig.VERSION_NAME
}
}
}

0 comments on commit bf40254

Please sign in to comment.