o
    ˷e                     @   sX   d dl mZmZmZ d dlmZ d dlmZ d dlm	Z	 d dl
mZ G dd deZdS )	    )absolute_importdivisionprint_function)util)UpdateableAPIResource)Transfer)
quote_plusc                   @   s6   e Zd ZdZdZdd Zedd Zed
dd	ZdS )Reversala-  
    [Stripe Connect](https://stripe.com/docs/connect) platforms can reverse transfers made to a
    connected account, either entirely or partially, and can also specify whether
    to refund any related application fees. Transfer reversals add to the
    platform's balance and subtract from the destination account's balance.

    Reversing a transfer that was made for a [destination
    charge](/docs/connect/destination-charges) is allowed only up to the amount of
    the charge. It is possible to reverse a
    [transfer_group](https://stripe.com/docs/connect/charges-transfers#transfer-options)
    transfer only if the destination account has enough balance to cover the
    reversal.

    Related guide: [Reversing Transfers](https://stripe.com/docs/connect/charges-transfers#reversing-transfers).
    transfer_reversalc                 C   s>   t | j}t | j}t }t|}t|}d|||f S )Nz%s/%s/reversals/%s)r   utf8idtransferr   	class_urlr   )selftokenr   base	cust_extnextn r   T/var/www/ideatree/venv/lib/python3.10/site-packages/stripe/api_resources/reversal.pyinstance_url   s   zReversal.instance_urlc                 K      t d)NzeCan't modify a reversal without a transferID. Call save on transfer.reversals.retrieve('reversal_id')NotImplementedError)clssidparamsr   r   r   modify%      zReversal.modifyNc                 K   r   )Nz^Can't retrieve a reversal without a transferID. Use transfer.reversals.retrieve('reversal_id')r   )r   r   api_keyr   r   r   r   retrieve,   r   zReversal.retrieve)N)	__name__
__module____qualname____doc__OBJECT_NAMEr   classmethodr   r    r   r   r   r   r	   
   s    
r	   N)
__future__r   r   r   striper   stripe.api_resources.abstractr   stripe.api_resources.transferr   stripe.six.moves.urllib.parser   r	   r   r   r   r   <module>   s   