-
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 #174 from Tinkoff/v2.11
V2.11
- Loading branch information
Showing
94 changed files
with
2,767 additions
and
61 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
12 changes: 12 additions & 0 deletions
12
core/src/main/java/ru/tinkoff/acquiring/sdk/models/paysources/YandexPay.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,12 @@ | ||
package ru.tinkoff.acquiring.sdk.models.paysources | ||
|
||
import ru.tinkoff.acquiring.sdk.models.PaymentSource | ||
|
||
/** | ||
* Тип оплаты с помощью Yandex Pay | ||
* | ||
* @param yandexPayToken токен для оплаты, полученный через Yandex Pay | ||
* | ||
* Created by i.golovachev | ||
*/ | ||
class YandexPay(var yandexPayToken: String) : PaymentSource |
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
37 changes: 37 additions & 0 deletions
37
core/src/main/java/ru/tinkoff/acquiring/sdk/requests/GetTerminalPayMethodsRequest.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,37 @@ | ||
package ru.tinkoff.acquiring.sdk.requests | ||
|
||
import ru.tinkoff.acquiring.sdk.network.AcquiringApi | ||
import ru.tinkoff.acquiring.sdk.network.AcquiringApi.GET_TERMINAL_PAY_METHODS | ||
import ru.tinkoff.acquiring.sdk.responses.GetTerminalPayMethodsResponse | ||
|
||
/** | ||
* Запрос в MAPI, проверяет доступности методов оплаты на терминале | ||
* | ||
* Created by Ivan Golovachev | ||
*/ | ||
class GetTerminalPayMethodsRequest( | ||
terminalKey: String, | ||
paysource: Paysource = Paysource.SDK | ||
) : | ||
AcquiringRequest<GetTerminalPayMethodsResponse>( | ||
"$GET_TERMINAL_PAY_METHODS?TerminalKey=$terminalKey&PaySource=$paysource") { | ||
|
||
override val httpRequestMethod: String = AcquiringApi.API_REQUEST_METHOD_GET | ||
|
||
override fun validate() = Unit | ||
|
||
override fun asMap(): MutableMap<String, Any> = mutableMapOf() | ||
|
||
override fun getToken(): String? = null | ||
|
||
override fun execute( | ||
onSuccess: (GetTerminalPayMethodsResponse) -> Unit, | ||
onFailure: (Exception) -> Unit | ||
) { | ||
super.performRequest(this, GetTerminalPayMethodsResponse::class.java, onSuccess, onFailure) | ||
} | ||
|
||
enum class Paysource { | ||
API, SDK | ||
} | ||
} |
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
68 changes: 68 additions & 0 deletions
68
core/src/main/java/ru/tinkoff/acquiring/sdk/responses/GetTerminalPayMethodsResponse.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,68 @@ | ||
package ru.tinkoff.acquiring.sdk.responses | ||
|
||
import com.google.gson.annotations.SerializedName | ||
|
||
/** | ||
* Ответ на запрос /v2/GetTerminalPayMethods | ||
* | ||
* @param terminalInfo - Характеристики терминала | ||
* | ||
* | ||
* Created by Ivan Golovachev | ||
*/ | ||
class GetTerminalPayMethodsResponse( | ||
|
||
@SerializedName("TerminalInfo") | ||
val terminalInfo: TerminalInfo? = null | ||
|
||
) : AcquiringResponse() | ||
|
||
|
||
/** | ||
* | ||
* @param terminalInfo - Характеристики терминала | ||
* @param paymethods - Перечень доступных методов оплаты | ||
* @param addCardScheme - Признак возможности сохранения карт | ||
* @param tokenRequired - Признак необходимости подписания токеном | ||
* @param initTokenRequired - Признак необходимости подписания токеном запроса /init | ||
* | ||
* | ||
* Created by Ivan Golovachev | ||
*/ | ||
class TerminalInfo( | ||
|
||
@SerializedName("Paymethods") | ||
val paymethods: List<PaymethodData> = emptyList(), | ||
|
||
@SerializedName("AddCardScheme") | ||
val addCardScheme: Boolean = false, | ||
|
||
@SerializedName("TokenRequired") | ||
val tokenRequired: Boolean = true, | ||
|
||
@SerializedName("InitTokenRequired") | ||
val initTokenRequired: Boolean = false | ||
) | ||
|
||
/** | ||
* @param params - Перечень параметров подключения в формате ключ-значение | ||
*/ | ||
class PaymethodData( | ||
|
||
@SerializedName("PayMethod") | ||
val paymethod: Paymethod? = null, | ||
|
||
@SerializedName("Params") | ||
val params: Map<String, String> = emptyMap() | ||
) | ||
|
||
enum class Paymethod { | ||
@SerializedName("TinkoffPay") | ||
TinkoffPay, | ||
|
||
@SerializedName("YandexPay") | ||
YandexPay, | ||
|
||
@SerializedName("SBP") | ||
SBP | ||
} |
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
Oops, something went wrong.