L idZddlZddlmZmZddlmZddlm Z ddl m Z ddl m Z mZddlmZerdd lmZGd d e Zy) zLThis module contains an object that represents a Telegram SuccessfulPayment.N) TYPE_CHECKINGOptional) OrderInfo)TelegramObject)de_json_optional)extract_tzinfo_from_defaultsfrom_timestamp)JSONDict)BotceZdZdZdZ ddddedededed ed eed eed ee jd ee dee dee ffdZ edde dedddffd ZxZS)SuccessfulPaymenta This object contains basic information about a successful payment. Note that if the buyer initiates a chargeback with the relevant payment provider following this transaction, the funds may be debited from your balance. This is outside of Telegram's control. Objects of this class are comparable in terms of equality. Two objects of this class are considered equal, if their :attr:`telegram_payment_charge_id` and :attr:`provider_payment_charge_id` are equal. Args: currency (:obj:`str`): Three-letter ISO 4217 currency code, or ``XTR`` for payments in |tg_stars|. total_amount (:obj:`int`): Total price in the smallest units of the currency (integer, **not** float/double). For example, for a price of ``US$ 1.45`` pass ``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). invoice_payload (:obj:`str`): Bot-specified invoice payload. subscription_expiration_date (:class:`datetime.datetime`, optional): Expiration date of the subscription; for recurring payments only. .. versionadded:: 21.8 is_recurring (:obj:`bool`, optional): True, if the payment is for a subscription. .. versionadded:: 21.8 is_first_recurring (:obj:`bool`, optional): True, if the payment is the first payment of a subscription. .. versionadded:: 21.8 shipping_option_id (:obj:`str`, optional): Identifier of the shipping option chosen by the user. order_info (:class:`telegram.OrderInfo`, optional): Order info provided by the user. telegram_payment_charge_id (:obj:`str`): Telegram payment identifier. provider_payment_charge_id (:obj:`str`): Provider payment identifier. Attributes: currency (:obj:`str`): Three-letter ISO 4217 currency code, or ``XTR`` for payments in |tg_stars|. total_amount (:obj:`int`): Total price in the smallest units of the currency (integer, **not** float/double). For example, for a price of ``US$ 1.45`` pass ``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). invoice_payload (:obj:`str`): Bot-specified invoice payload. subscription_expiration_date (:class:`datetime.datetime`): Optional. Expiration date of the subscription; for recurring payments only. .. versionadded:: 21.8 is_recurring (:obj:`bool`): Optional. True, if the payment is for a subscription. .. versionadded:: 21.8 is_first_recurring (:obj:`bool`): Optional. True, if the payment is the first payment of a subscription. .. versionadded:: 21.8 shipping_option_id (:obj:`str`): Optional. Identifier of the shipping option chosen by the user. order_info (:class:`telegram.OrderInfo`): Optional. Order info provided by the user. telegram_payment_charge_id (:obj:`str`): Telegram payment identifier. provider_payment_charge_id (:obj:`str`): Provider payment identifier. ) currencyinvoice_payloadis_first_recurring is_recurring order_infoprovider_payment_charge_idshipping_option_idsubscription_expiration_datetelegram_payment_charge_id total_amountN api_kwargsrrrrrrrrrrrc  t || ||_||_||_||_||_||_||_||_ | |_ | |_ |j|jf|_ |jy)Nr)super__init__rrrrrrrrrr _id_attrs_freeze) selfrrrrrrrrrrr __class__s i/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/telegram/_payment/successfulpayment.pyrzSuccessfulPayment.__init__qs J/% !-$31C/9/I'/I'D`),82D994;Z;Z[ databotr returnc|j|}t|jdt||d<t |}t |jd||d<t |||S)z,See :meth:`telegram.TelegramObject.de_json`.rr)tzinfo)r#r$) _parse_datargetrrr rde_json)clsr#r$ loc_tzinfor s r!r*zSuccessfulPayment.de_jsonspt$-dhh|.DiQTU\2#6 /= HH3 4Z0  +,wDc22r")NNNNN)N)__name__ __module__ __qualname____doc__ __slots__strintrrdtmdatetimeboolr r classmethodr* __classcell__)r s@r!r r "s?B I(-1*.?C'+-1*.  %(  %( %SMY''/s||&<tn%TNX&> 38 3(5/ 3EX 3 3r"r )r0r5r4typingrrtelegram._payment.orderinfortelegram._telegramobjectrtelegram._utils.argumentparsingrtelegram._utils.datetimerr telegram._utils.typesr telegramr r r"r!rAs4&S*13<Q*|3|3r"