From 6edf4662202a03d54e2e99c04ed73dcc7285ade3 Mon Sep 17 00:00:00 2001 From: bpavuk Date: Sun, 7 Jul 2024 17:45:59 +0300 Subject: [PATCH] Bot API 7.7 implemented minor changes regarding refunded payments --- .../inmo/tgbotapi/types/message/RawMessage.kt | 2 ++ .../types/payments/RefundedPayment.kt | 23 +++++++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/payments/RefundedPayment.kt diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/RawMessage.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/RawMessage.kt index d369a13ae3..55d1bf34ec 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/RawMessage.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/RawMessage.kt @@ -30,6 +30,7 @@ import dev.inmo.tgbotapi.types.message.content.MessageContent import dev.inmo.tgbotapi.types.message.payments.* import dev.inmo.tgbotapi.types.passport.PassportData import dev.inmo.tgbotapi.types.payments.Invoice +import dev.inmo.tgbotapi.types.payments.RefundedPayment import dev.inmo.tgbotapi.types.payments.SuccessfulPayment import dev.inmo.tgbotapi.types.polls.Poll import dev.inmo.tgbotapi.types.request.ChatShared @@ -98,6 +99,7 @@ internal data class RawMessage( private val invoice: Invoice? = null, private val dice: Dice? = null, private val successful_payment: SuccessfulPayment? = null, + private val refunded_payment: RefundedPayment? = null, private val giveaway: Giveaway? = null, private val giveaway_winners: GiveawayResults? = null, private val sender_boost_count: Int? = null, diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/payments/RefundedPayment.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/payments/RefundedPayment.kt new file mode 100644 index 0000000000..38d852ea1e --- /dev/null +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/payments/RefundedPayment.kt @@ -0,0 +1,23 @@ +package dev.inmo.tgbotapi.types.payments + +import dev.inmo.tgbotapi.types.* +import dev.inmo.tgbotapi.types.payments.abstracts.Amounted +import dev.inmo.tgbotapi.types.payments.abstracts.Currencied +import dev.inmo.tgbotapi.types.payments.abstracts.Currency +import dev.inmo.tgbotapi.types.payments.abstracts.TelegramPaymentChargeId +import kotlinx.serialization.SerialName +import kotlinx.serialization.Serializable + +@Serializable +data class RefundedPayment( + @SerialName(currencyField) + override val currency: Currency, + @SerialName(totalAmountField) + override val amount: Long, + @SerialName(invoicePayloadField) + val invoicePayload: String, + @SerialName(telegramPaymentChargeIdField) + val telegramPaymentChargeId: TelegramPaymentChargeId, + @SerialName(providerPaymentChargeIdField) + val providerPaymentChargeId: String +): Amounted, Currencied