@@ -1080,6 +1080,9 @@ class Message(JsonDeserializable):
1080
1080
the payment. More about payments »
1081
1081
:type successful_payment: :class:`telebot.types.SuccessfulPayment`
1082
1082
1083
+ :param refunded_payment: Optional. Message is a service message about a refunded payment, information about the payment. More about payments »
1084
+ :type refunded_payment: :class:`telebot.types.RefundedPayment`
1085
+
1083
1086
:param users_shared: Optional. Service message: a user was shared with the bot
1084
1087
:type users_shared: :class:`telebot.types.UsersShared`
1085
1088
@@ -1391,7 +1394,8 @@ def de_json(cls, json_string):
1391
1394
opts ['show_caption_above_media' ] = obj ['show_caption_above_media' ]
1392
1395
if 'paid_media' in obj :
1393
1396
opts ['paid_media' ] = PaidMediaInfo .de_json (obj ['paid_media' ])
1394
-
1397
+ if 'refunded_payment' in obj :
1398
+ opts ['refunded_payment' ] = RefundedPayment .de_json (obj ['refunded_payment' ])
1395
1399
1396
1400
return cls (message_id , from_user , date , chat , content_type , opts , json_string )
1397
1401
@@ -1502,6 +1506,7 @@ def __init__(self, message_id, from_user, date, chat, content_type, options, jso
1502
1506
self .effect_id : Optional [str ] = None
1503
1507
self .show_caption_above_media : Optional [bool ] = None
1504
1508
self .paid_media : Optional [PaidMediaInfo ] = None
1509
+ self .refunded_payment : Optional [RefundedPayment ] = None
1505
1510
1506
1511
for key in options :
1507
1512
setattr (self , key , options [key ])
@@ -10676,5 +10681,43 @@ def to_dict(self):
10676
10681
if self .supports_streaming is not None :
10677
10682
data ['supports_streaming' ] = self .supports_streaming
10678
10683
return data
10684
+
10685
+ class RefundedPayment (JsonDeserializable ):
10686
+ """
10687
+ This object contains basic information about a refunded payment.
10688
+
10689
+ Telegram documentation: https://core.telegram.org/bots/api#refundedpayment
10690
+
10691
+ :param currency: Three-letter ISO 4217 currency code, or “XTR” for payments in Telegram Stars. Currently, always “XTR”
10692
+ :type currency: :obj:`str`
10693
+
10694
+ :param total_amount: Total refunded price in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45, total_amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies).
10695
+ :type total_amount: :obj:`int`
10696
+
10697
+ :param invoice_payload: Bot-specified invoice payload
10698
+ :type invoice_payload: :obj:`str`
10699
+
10700
+ :param telegram_payment_charge_id: Telegram payment identifier
10701
+ :type telegram_payment_charge_id: :obj:`str`
10702
+
10703
+ :param provider_payment_charge_id: Optional. Provider payment identifier
10704
+ :type provider_payment_charge_id: :obj:`str`
10705
+
10706
+ :return: Instance of the class
10707
+ :rtype: :class:`RefundedPayment`
10708
+ """
10709
+
10710
+ def __init__ (self , currency , total_amount , invoice_payload , telegram_payment_charge_id , provider_payment_charge_id = None , ** kwargs ):
10711
+ self .currency : str = currency
10712
+ self .total_amount : int = total_amount
10713
+ self .invoice_payload : str = invoice_payload
10714
+ self .telegram_payment_charge_id : str = telegram_payment_charge_id
10715
+ self .provider_payment_charge_id : Optional [str ] = provider_payment_charge_id
10716
+
10717
+ @classmethod
10718
+ def de_json (cls , json_string ):
10719
+ if json_string is None : return None
10720
+ obj = cls .check_json (json_string )
10721
+ return cls (** obj )
10679
10722
10680
10723
0 commit comments