U
    g                     @   s\   d Z ddlmZmZ ddlmZ ddlmZ ddlm	Z	 erHddl
mZ G dd deZd	S )
zLThis module contains an object that represents a Telegram SuccessfulPayment.    )TYPE_CHECKINGOptional)	OrderInfo)TelegramObject)JSONDict)Botc                       st   e Zd ZdZdZdddeeeeeee ee ee	 d fddZ
edee	 ed ed  d	 fd
dZ  ZS )SuccessfulPaymenta	  This object contains basic information about a successful payment.

    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 <https://core.telegram.org/bots/payments/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.
        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 <https://core.telegram.org/bots/payments/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.
        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.

    )currencyinvoice_payload
order_infoprovider_payment_charge_idshipping_option_idtelegram_payment_charge_idtotal_amountN
api_kwargs)r	   r   r
   r   r   r   r   r   c          	         sR   t  j|d || _|| _|| _|| _|| _|| _|| _| j| jf| _	| 
  d S )Nr   )super__init__r	   r   r
   r   r   r   r   Z	_id_attrsZ_freeze)	selfr	   r   r
   r   r   r   r   r   	__class__ G/tmp/pip-unpacked-wheel-swnnwir2/telegram/_payment/successfulpayment.pyr   R   s    zSuccessfulPayment.__init__r   )databotreturnc                    s8   |  |}|sdS t|d||d< t j||dS )z,See :meth:`telegram.TelegramObject.de_json`.Nr   )r   r   )Z_parse_datar   de_jsongetr   )clsr   r   r   r   r   r   k   s
    
zSuccessfulPayment.de_json)NN)N)__name__
__module____qualname____doc__	__slots__strintr   r   r   r   classmethodr   __classcell__r   r   r   r   r      s.   (  
  r   N)r"   typingr   r   Ztelegram._payment.orderinfor   Ztelegram._telegramobjectr   Ztelegram._utils.typesr   Ztelegramr   r   r   r   r   r   <module>   s   