-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #86 from Tinkoff/2.5.6
v2.5.6
- Loading branch information
Showing
51 changed files
with
727 additions
and
99 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
core/src/main/java/ru/tinkoff/acquiring/sdk/requests/TinkoffPayLinkRequest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/* | ||
* Copyright © 2020 Tinkoff Bank | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package ru.tinkoff.acquiring.sdk.requests | ||
|
||
import ru.tinkoff.acquiring.sdk.network.AcquiringApi | ||
import ru.tinkoff.acquiring.sdk.responses.TinkoffPayLinkResponse | ||
|
||
/** | ||
* Возвращает deeplink для TinkoffPay в зависимости от версии | ||
*/ | ||
class TinkoffPayLinkRequest(paymentId: String, version: String) : | ||
AcquiringRequest<TinkoffPayLinkResponse>( | ||
"TinkoffPay/transactions/${paymentId}/versions/${version}/link") { | ||
|
||
override val httpRequestMethod: String = AcquiringApi.API_REQUEST_METHOD_GET | ||
|
||
override fun asMap(): MutableMap<String, Any> = mutableMapOf() | ||
|
||
override fun validate() = Unit | ||
|
||
/** | ||
* Синхронный вызов метода API | ||
*/ | ||
override fun execute(onSuccess: (TinkoffPayLinkResponse) -> Unit, onFailure: (Exception) -> Unit) { | ||
super.performRequest(this, TinkoffPayLinkResponse::class.java, onSuccess, onFailure) | ||
} | ||
} |
40 changes: 40 additions & 0 deletions
40
core/src/main/java/ru/tinkoff/acquiring/sdk/requests/TinkoffPayStatusRequest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/* | ||
* Copyright © 2020 Tinkoff Bank | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package ru.tinkoff.acquiring.sdk.requests | ||
|
||
import ru.tinkoff.acquiring.sdk.network.AcquiringApi | ||
import ru.tinkoff.acquiring.sdk.responses.TinkoffPayStatusResponse | ||
|
||
/** | ||
* Определение доступности проведения TinkoffPay для Продавца | ||
*/ | ||
class TinkoffPayStatusRequest(terminalKey: String) : | ||
AcquiringRequest<TinkoffPayStatusResponse>("TinkoffPay/terminals/$terminalKey/status") { | ||
|
||
override val httpRequestMethod: String = AcquiringApi.API_REQUEST_METHOD_GET | ||
|
||
override fun asMap(): MutableMap<String, Any> = mutableMapOf() | ||
|
||
override fun validate() = Unit | ||
|
||
/** | ||
* Синхронный вызов метода API | ||
*/ | ||
override fun execute(onSuccess: (TinkoffPayStatusResponse) -> Unit, onFailure: (Exception) -> Unit) { | ||
super.performRequest(this, TinkoffPayStatusResponse::class.java, onSuccess, onFailure) | ||
} | ||
} |
39 changes: 39 additions & 0 deletions
39
core/src/main/java/ru/tinkoff/acquiring/sdk/responses/TinkoffPayLinkResponse.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/* | ||
* Copyright © 2020 Tinkoff Bank | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package ru.tinkoff.acquiring.sdk.responses | ||
|
||
import com.google.gson.annotations.SerializedName | ||
|
||
/** | ||
* Ответ на запрос TinkoffPayLink | ||
* | ||
* @param params Json-объект содержащий дополнительный параметр | ||
*/ | ||
class TinkoffPayLinkResponse( | ||
@SerializedName("Params") | ||
val params: Params? = null | ||
|
||
) : AcquiringResponse() { | ||
|
||
/** | ||
* @param redirectUrl URL для перехода в приложение Мобильный Банк | ||
*/ | ||
class Params( | ||
@SerializedName("RedirectUrl") | ||
val redirectUrl: String | ||
) | ||
} |
52 changes: 52 additions & 0 deletions
52
core/src/main/java/ru/tinkoff/acquiring/sdk/responses/TinkoffPayStatusResponse.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
/* | ||
* Copyright © 2020 Tinkoff Bank | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package ru.tinkoff.acquiring.sdk.responses | ||
|
||
import com.google.gson.annotations.SerializedName | ||
|
||
/** | ||
* Ответ на запрос TinkoffPayStatus | ||
* | ||
* @param params Json-объект содержащий дополнительные параметры | ||
*/ | ||
class TinkoffPayStatusResponse( | ||
@SerializedName("Params") | ||
val params: Params? = null | ||
|
||
) : AcquiringResponse() { | ||
|
||
fun isTinkoffPayAvailable(): Boolean = params?.allowed == true | ||
|
||
/** | ||
* @return "1.0" - deeplink, "2.0" - applink | ||
*/ | ||
fun getTinkoffPayVersion(): String? = params?.version | ||
|
||
/** | ||
* @param allowed Наличие возможности проведения оплаты TinkoffPay по API, SDK | ||
* @param version Версия TinkoffPay, доступная на терминале: | ||
* - 1.0 (e-invoice); | ||
* - 2.0 (TinkoffPay) | ||
*/ | ||
class Params( | ||
@SerializedName("Allowed") | ||
val allowed: Boolean, | ||
|
||
@SerializedName("Version") | ||
val version: String? = null | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
VERSION_NAME=2.5.5 | ||
VERSION_NAME=2.5.6 | ||
VERSION_CODE=15 | ||
GROUP=ru.tinkoff.acquiring | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.