U
    ^g%iž
  ã                   @   s,   d dl mZ ddlmZ G dd„ deƒZdS )é   )ÚResourceé   )ÚURLc                       sr   e Zd Zd‡ fdd„	Zi fdd„Zi fdd„Zi fdd	„Zi fd
d„Zi fdd„Zi fdd„Z	i fdd„Z
‡  ZS )ÚTokenNc                    s"   t t| ƒ |¡ tjtj | _d S )N)Úsuperr   Ú__init__r   ÚV1ZCUSTOMER_URLÚbase_url)ÚselfÚclient©Ú	__class__© úW/var/www/html/api-medvista/venv/lib/python3.8/site-packages/razorpay/resources/token.pyr      s    zToken.__init__c                 K   s    d  tjtj¡}| j||f|ŽS )zi
        Create token from given dict

        Returns:
            token Dict which was created
        z{}{}©Úformatr   r   ZTOKENZpost_url©r
   ÚdataÚkwargsÚurlr   r   r   Úcreate
   s    zToken.createc                 K   s    d  | j||¡}| j||f|ŽS )a  
        Fetch Token for given Id and given customer Id

        Args:
            customer_id : Customer Id for which tokens have to be fetched
            token_id    : Id for which TOken object has to be fetched

        Returns:
            Token dict for given token Id
        ú{}/{}/tokens/{}©r   r	   Úget_url©r
   Úcustomer_idZtoken_idr   r   r   r   r   r   Úfetch   s    zToken.fetchc                 K   s   d  | j|¡}| j||f|ŽS )zÎ
        Get all tokens for given customer Id

        Args:
            customer_id : Customer Id for which tokens have to be fetched

        Returns:
            Token dicts for given cutomer Id
        z{}/{}/tokensr   )r
   r   r   r   r   r   r   r   Úall#   s    
z	Token.allc                 K   s    d  | j||¡}| j||f|ŽS )a  
        Delete Given Token For a Customer

        Args:
            customer_id : Customer Id for which tokens have to be deleted
            token_id    : Id for which TOken object has to be deleted
        Returns:
            Dict for deleted token
        r   )r   r	   Z
delete_urlr   r   r   r   Údelete0   s    
zToken.deletec                 K   s"   d  tjtjd¡}| j||f|ŽS )ze
        fetch Given Token For a Customer

        Returns:
            Dict for fetch token
        ú{}{}/{}r   r   r   r   r   r   Ú
fetchToken=   s    zToken.fetchTokenc                 K   s"   d  tjtjd¡}| j||f|ŽS )zY
        Delete Given Token

        Returns:
            Dict for deleted token
        r   r   r   r   r   r   r   ÚdeleteTokenG   s    zToken.deleteTokenc                 K   s"   d  tjtjd¡}| j||f|ŽS )zr
        Process a Payment on another PA/PG with Token Created on Razorpay

        Returns:
            
        r   z0service_provider_tokens/token_transactional_datar   r   r   r   r   ÚprocessPaymentOnAlternatePAorPGQ   s    z%Token.processPaymentOnAlternatePAorPG)N)Ú__name__Ú
__module__Ú__qualname__r   r   r   r   r   r    r!   r"   Ú__classcell__r   r   r   r   r      s   

r   N)Úbaser   Zconstants.urlr   r   r   r   r   r   Ú<module>   s   