
    h                     :    d dl mZ ddlmZ ddlZ G d de      Zy)   )Resource   )URL    Nc                   x     e Zd Zd
 fd	Zi f fd	Zi f fd	Zi fdZi fdZi fdZi fdZ	i fdZ
i fd	Z xZS )VirtualAccountc                 x    t         t        |   |       t        j                  t        j
                  z   | _        y N)superr   __init__r   V1VIRTUAL_ACCOUNT_URLbase_url)selfclient	__class__s     `/var/www/html/eduruby.in/venv/lib/python3.12/site-packages/razorpay/resources/virtual_account.pyr   zVirtualAccount.__init__   s(    nd,V4!8!88    c                 ,    t        t        | 
  |fi |S )zu
        Fetch all Virtual Account entities

        Returns:
            Dictionary of Virtual Account data
        )r   r   all)r   datakwargsr   s      r   r   zVirtualAccount.all   s     ^T.t>v>>r   c                 .    t        t        | 
  ||fi |S )z
        Fetch Virtual Account for given Id

        Args:
            virtual_account_id :
                Id for which Virtual Account object has to be retrieved

        Returns:
            Virtual Account dict for given Virtual Account Id
        )r   r   fetch)r   virtual_account_idr   r   r   s       r   r   zVirtualAccount.fetch   s)     ^T0  	r   c                 B    | j                   } | j                  ||fi |S )z
        Create Virtual Account from given dict

        Args:
            Param for Creating Virtual Account

        Returns:
            Virtual Account dict
        )r   post_url)r   r   r   urls       r   createzVirtualAccount.create$   s%     mmt}}S$1&11r   c                 b    dj                  | j                  |      } | j                  ||fi |S )z
        Close Virtual Account from given Id

        Args:
            virtual_account_id :
                Id for which Virtual Account objects has to be Closed
        z{}/{}/closeformatr   r   r   r   r   r   r   s        r   closezVirtualAccount.close1   s3     ""4==2DEt}}S$1&11r   c                 b    dj                  | j                  |      } | j                  ||fi |S )z
        Fetch Payment for Virtual Account Id

        Args:
            virtual_account_id :
                Id for which Virtual Account objects has to be retrieved

        Returns:
            Payment dict for given Virtual Account Id
        z{}/{}/payments)r"   r   get_urlr#   s        r   paymentszVirtualAccount.payments<   s3     %%dmm5GHt||C000r   c                 b    dj                  | j                  |      } | j                  ||fi |S )z
        Add receiver to an existing virtual account

        Args:
            virtual_account_id :
                Id for which Virtual Account objects has to be Closed
        z{}/{}/receiversr!   r#   s        r   add_receiverzVirtualAccount.add_receiverJ   s3      &&t}}6HIt}}S$1&11r   c                 b    dj                  | j                  |      } | j                  ||fi |S )z
        Add an Allowed Payer Account

        Args:
            virtual_account_id :
                Id for which Virtual Account objects has to be Closed
        z{}/{}/allowed_payersr!   r#   s        r   add_allowed_playerz!VirtualAccount.add_allowed_playerU   s3     %++DMM;MNt}}S$1&11r   c                 d    dj                  | j                  ||      } | j                  ||fi |S )z
        Delete an Allowed Payer Account

        Args:
            virtual_account_id :
                Id for which Virtual Account objects has to be Closed
        Returns:
            204        
        z{}/{}/allowed_payers/{})r"   r   
delete_url)r   r   allowed_player_idr   r   r   s         r   delete_allowed_playerz$VirtualAccount.delete_allowed_player`   s6     (..t}}>PRcdtsD3F33r   r
   )__name__
__module____qualname__r   r   r   r   r$   r'   r)   r+   r/   __classcell__)r   s   @r   r   r      sZ    9  ? .0    2 .0 	2 13 1 57 	2 ;= 	2 QS 4r   r   )baser   constants.urlr   jsonr    r   r   <module>r8      s      e4X e4r   