Updated on 2026-08-14
This commit is contained in:
parent
25444c3a2d
commit
2ee2edeeef
18 changed files with 255 additions and 14 deletions
|
|
@ -190,4 +190,16 @@ interface TangemPayApi {
|
|||
|
||||
@GET("v1/customer/cashback/summary")
|
||||
suspend fun getCashbackSummary(@Header("Authorization") authHeader: String): ApiResponse<CashbackSummaryResponse>
|
||||
|
||||
@GET("v1/customer/cashback/promotions")
|
||||
suspend fun getCashbackPromotions(
|
||||
@Header("Authorization") authHeader: String,
|
||||
@Header("Accept-Language") language: String,
|
||||
): ApiResponse<CashbackPromotionsResponse>
|
||||
|
||||
@GET("v1/customer/cashback/accruals/docs")
|
||||
suspend fun getCashbackAccrualDocs(
|
||||
@Header("Authorization") authHeader: String,
|
||||
@Header("Accept-Language") language: String,
|
||||
): ApiResponse<CashbackAccrualDocsResponse>
|
||||
}
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
package com.tangem.datasource.api.pay.models.response
|
||||
|
||||
import com.squareup.moshi.Json
|
||||
import com.squareup.moshi.JsonClass
|
||||
|
||||
/**
|
||||
* Response from `GET v1/customer/cashback/accruals/docs` — cashback program documents (always English).
|
||||
*/
|
||||
@JsonClass(generateAdapter = true)
|
||||
data class CashbackAccrualDocsResponse(
|
||||
@Json(name = "docs") val docs: List<Doc>?,
|
||||
) {
|
||||
|
||||
@JsonClass(generateAdapter = true)
|
||||
data class Doc(
|
||||
@Json(name = "id") val id: String?,
|
||||
@Json(name = "title") val title: String?,
|
||||
@Json(name = "url") val url: String?,
|
||||
)
|
||||
}
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
package com.tangem.datasource.api.pay.models.response
|
||||
|
||||
import com.squareup.moshi.Json
|
||||
import com.squareup.moshi.JsonClass
|
||||
import java.math.BigDecimal
|
||||
|
||||
/**
|
||||
* Response from `GET v1/customer/cashback/promotions` — cashback program configuration for the customer.
|
||||
*/
|
||||
@JsonClass(generateAdapter = true)
|
||||
data class CashbackPromotionsResponse(
|
||||
@Json(name = "cashback_on_cards") val cashbackOnCards: CashbackOnCards?,
|
||||
@Json(name = "additional_cashback") val additionalCashback: List<AdditionalCashback>?,
|
||||
) {
|
||||
|
||||
@JsonClass(generateAdapter = true)
|
||||
data class CashbackOnCards(
|
||||
@Json(name = "tiers") val tiers: List<CardTier>?,
|
||||
@Json(name = "monthly_cap_amount") val monthlyCapAmount: BigDecimal?,
|
||||
@Json(name = "monthly_cap_currency") val monthlyCapCurrency: String?,
|
||||
)
|
||||
|
||||
@JsonClass(generateAdapter = true)
|
||||
data class CardTier(
|
||||
@Json(name = "tier") val tier: String?,
|
||||
@Json(name = "label") val label: String?,
|
||||
@Json(name = "scope") val scope: String?,
|
||||
@Json(name = "min_transaction_amount") val minTransactionAmount: BigDecimal?,
|
||||
@Json(name = "tier_monthly_cap_amount") val tierMonthlyCapAmount: BigDecimal?,
|
||||
@Json(name = "promotion_id") val promotionId: String?,
|
||||
)
|
||||
|
||||
@JsonClass(generateAdapter = true)
|
||||
data class AdditionalCashback(
|
||||
@Json(name = "promotion_id") val promotionId: String?,
|
||||
@Json(name = "label") val label: String?,
|
||||
@Json(name = "scope") val scope: String?,
|
||||
)
|
||||
}
|
||||
|
|
@ -17,6 +17,8 @@ data class CashbackSummaryResponse(
|
|||
@Json(name = "confirmed_amount") val confirmedAmount: BigDecimal?,
|
||||
@Json(name = "pending_amount") val pendingAmount: BigDecimal?,
|
||||
@Json(name = "currency") val currency: String?,
|
||||
@Json(name = "payout_currency") val payoutCurrency: String?,
|
||||
@Json(name = "payout_network") val payoutNetwork: String?,
|
||||
) {
|
||||
|
||||
@JsonClass(generateAdapter = true)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue