Updated on 2026-08-14
This commit is contained in:
parent
3b6eeb7535
commit
8b677a8e6b
25 changed files with 1149 additions and 17 deletions
|
|
@ -55,6 +55,7 @@ internal sealed class TangemPay(
|
|||
"version" to ProviderSuspend { appInfoProvider.appVersion },
|
||||
"platform" to ProviderSuspend { "Android" },
|
||||
"X-API-KEY" to ProviderSuspend { getBffStaticToken(apiEnvironment) },
|
||||
"X-Device-Scale" to ProviderSuspend { appInfoProvider.deviceScale.toString() },
|
||||
)
|
||||
|
||||
private fun getBffStaticToken(apiEnvironment: ApiEnvironment): String {
|
||||
|
|
|
|||
|
|
@ -29,6 +29,11 @@ interface TangemPayApi {
|
|||
@GET("v1/customer/me")
|
||||
suspend fun getCustomerMe(@Header("Authorization") authHeader: String): ApiResponse<CustomerMeResponse>
|
||||
|
||||
@GET("v1/customer/tariff-plan/transitions")
|
||||
suspend fun getTariffPlanTransitions(
|
||||
@Header("Authorization") authHeader: String,
|
||||
): ApiResponse<TariffPlanTransitionsResponse>
|
||||
|
||||
/** Fiat bank requisites for the Virtual Account on-ramp (VA MVP0, TWI-1638). */
|
||||
@GET("v1/account/bank-credentials/{product_instance_id}")
|
||||
suspend fun getBankCredentials(
|
||||
|
|
|
|||
|
|
@ -39,6 +39,13 @@ data class CustomerMeResponse(
|
|||
@Json(name = "type") val type: String?,
|
||||
@Json(name = "name") val name: String?,
|
||||
@Json(name = "description_items") val descriptionItems: List<DescriptionItem>?,
|
||||
@Json(name = "images") val images: List<Image>? = null,
|
||||
)
|
||||
|
||||
@JsonClass(generateAdapter = true)
|
||||
data class Image(
|
||||
@Json(name = "type") val type: String?,
|
||||
@Json(name = "url") val url: String?,
|
||||
)
|
||||
|
||||
@JsonClass(generateAdapter = true)
|
||||
|
|
|
|||
|
|
@ -0,0 +1,15 @@
|
|||
package com.tangem.datasource.api.pay.models.response
|
||||
|
||||
import com.squareup.moshi.Json
|
||||
import com.squareup.moshi.JsonClass
|
||||
|
||||
@JsonClass(generateAdapter = true)
|
||||
data class TariffPlanTransitionsResponse(
|
||||
@Json(name = "result") val result: List<TariffPlanTransitionResponse>?,
|
||||
)
|
||||
|
||||
@JsonClass(generateAdapter = true)
|
||||
data class TariffPlanTransitionResponse(
|
||||
@Json(name = "type") val type: String?,
|
||||
@Json(name = "tariff_plan") val tariffPlan: CustomerMeResponse.TariffPlan?,
|
||||
)
|
||||
|
|
@ -70,6 +70,7 @@ internal class ProdApiConfigsManagerTest {
|
|||
every { appInfoProvider.osVersion } returns "Android 16"
|
||||
every { appInfoProvider.language } returns Locale.getDefault().toLanguageTag()
|
||||
every { appInfoProvider.device } returns "${Build.MANUFACTURER} ${Build.MODEL}"
|
||||
every { appInfoProvider.deviceScale } returns DEVICE_SCALE
|
||||
|
||||
manager = ProdApiConfigsManager(apiConfigs = createApiConfigs())
|
||||
}
|
||||
|
|
@ -298,6 +299,7 @@ internal class ProdApiConfigsManagerTest {
|
|||
"version" to ProviderSuspend { VERSION_NAME },
|
||||
"platform" to ProviderSuspend { "Android" },
|
||||
"X-API-KEY" to ProviderSuspend { TANGEM_PAY_BFF_KEY_DEV },
|
||||
"X-Device-Scale" to ProviderSuspend { DEVICE_SCALE.toString() },
|
||||
),
|
||||
),
|
||||
)
|
||||
|
|
@ -313,6 +315,7 @@ internal class ProdApiConfigsManagerTest {
|
|||
"version" to ProviderSuspend { VERSION_NAME },
|
||||
"platform" to ProviderSuspend { "Android" },
|
||||
"X-API-KEY" to ProviderSuspend { TANGEM_PAY_BFF_KEY_DEV },
|
||||
"X-Device-Scale" to ProviderSuspend { DEVICE_SCALE.toString() },
|
||||
),
|
||||
),
|
||||
)
|
||||
|
|
@ -457,6 +460,7 @@ internal class ProdApiConfigsManagerTest {
|
|||
private companion object {
|
||||
|
||||
const val VERSION_NAME = "debug"
|
||||
const val DEVICE_SCALE = 3f
|
||||
const val EXPRESS_SESSION_ID = "express_session_id"
|
||||
const val STAKE_KIT_API_KEY = "stake_kit_api_key"
|
||||
const val P2P_API_KEY = "p2p_api_key"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue