
    h                     :    d dl mZ ddlmZ ddlZ G d de      Zy)   )Resource   )URL    Nc                   f     e Zd Zd	 fd	Zi fdZi f fd	Zi f fd	Zi fdZd Zi fdZ	d Z
 xZS )
PaymentLinkc                 x    t         t        |   |       t        j                  t        j
                  z   | _        y N)superr   __init__r   V1PAYMENT_LINK_URLbase_url)selfclient	__class__s     ]/var/www/html/eduruby.in/venv/lib/python3.12/site-packages/razorpay/resources/payment_link.pyr   zPaymentLink.__init__   s(    k4)&1!5!55    c                 \    t        j                  dt                | j                  |fi |S )Nz"Will be Deprecated in next release)warningswarnDeprecationWarningall)r   datakwargss      r   	fetch_allzPaymentLink.fetch_all   s(    :<NOtxx'''r   c                 ,    t        t        | 
  |fi |S )zo
        Fetch all Payment link entities

        Returns:
            Dictionary of Payment link data
        )r   r   r   )r   r   r   r   s      r   r   zPaymentLink.all   s     [$+D;F;;r   c                 .    t        t        | 
  ||fi |S )z
        Fetch Payment link for given Id

        Args:
            payment_link_id : Id for which Payment link object has to be retrieved

        Returns:
            Payment link dict for given payment_link_id Id
        )r   r   fetch)r   payment_link_idr   r   r   s       r   r   zPaymentLink.fetch   s     [$-otNvNNr   c                 B    | j                   } | j                  ||fi |S )z
        Create Payment link from given dict

        Args:
            data : Dictionary having keys using which Payment link have to be created

        Returns:
            Payment link Dict which was created
        )r   post_url)r   r   r   urls       r   createzPaymentLink.create$   s%     mmt}}S$1&11r   c                 b    dj                  | j                  |      } | j                  |i fi |S )a  
        Cancel an unpaid Payment link with given ID via API
        It can only be called on an Payment link that is not in the paid state.

        Args:
            payment_link_id : Id for cancel the Payment link
        Returns:
            The response for the API will be the Payment link entity, similar to create/update API response, with status attribute's value as cancelled
        z{}/{}/cancelformatr   r"   )r   r    r   r#   s       r   cancelzPaymentLink.cancel1   s2     ##DMM?Ct}}S"///r   c                 b    dj                  | j                  |      } | j                  ||fi |S )a  
        Edit the Payment link
        Args:
            data : Dictionary having keys using which order have to be edited
                reference_id : Adds a unique reference number to an existing link.

                expire_by : Timestamp, in Unix format, when the payment links should expire.

                notes : key value pair as notes
            
            Returns:
            Payment Link Dict which was edited
        z{}/{})r'   r   	patch_url)r   r    r   r   r#   s        r   editzPaymentLink.edit>   s0     nnT]]O<t~~c42622r   c                 d    dj                  | j                  ||      } | j                  |i fi |S )z
        Send notification

        Args:
            payment_link_id : Unique identifier of the Payment Link that should be resent.
            
            medium : sms/email
        z{}/{}/notify_by/{}r&   )r   r    mediumr   r#   s        r   notifyByzPaymentLink.notifyByO   s4     #))$--&Qt}}S"///r   r
   )__name__
__module____qualname__r   r   r   r   r$   r(   r+   r.   __classcell__)r   s   @r   r   r      sE    6   (  < +- 
O  20 *, 3"
0r   r   )baser   constants.urlr   r   r    r   r   <module>r6      s      S0( S0r   