o
    f                     @   s,   d dl mZ ddlmZ G dd deZdS )   )Resource   )URLc                       s^   e Zd Zd fdd	Zi f fdd	Zi fddZi f fdd		Zi fd
dZdd Z  Z	S )QrcodeNc                    s"   t t| | tjtj | _d S N)superr   __init__r   V1
QRCODE_URLbase_url)selfclient	__class__ /media/darth/New Volume E/PROJECTS/DRIVERZZ/DRIVERZZ_CUSTOMER_APIS/venv/lib/python3.10/site-packages/razorpay/resources/qrcode.pyr      s   zQrcode.__init__c                    s   t t| j||fi |S )z
        Fetch a Qr code

        Args:
            customer_id : Id for which customer object has to be retrieved

        Returns:
            Qrcode dict for given qrcode id
        )r   r   fetch)r   	qrcode_iddatakwargsr   r   r   r   
   s   
zQrcode.fetchc                 K   s   | j }| j||fi |S )z^
        Create a QR Code

        Returns:
            QrCode Dict which was created
        )r   post_url)r   r   r   urlr   r   r   create   s   zQrcode.createc                    s   t t| j|fi |S )zM
        Fetch All Qr Code

        Returns:
            Qrcode dict
        )r   r   all)r   r   r   r   r   r   r       s   z
Qrcode.allc                 K   s"   d | j|}| j||fi |S )z`
        Fetch Payments for a QR Code

        Returns:
            Qrcode payment dict
        z{}/{}/payments)formatr   get_url)r   r   r   r   r   r   r   r   fetch_all_payments)   s   zQrcode.fetch_all_paymentsc                 K   s"   d | j|}| j|i fi |S )z\
        Close a QR Code

        Returns:
            Qrcode Dict which was closed
        z{}/{}/close)r   r   r   )r   r   r   r   r   r   r   close3   s   zQrcode.closer   )
__name__
__module____qualname__r   r   r   r   r   r   __classcell__r   r   r   r   r      s    
	
r   N)baser   constants.urlr   r   r   r   r   r   <module>   s    