
    <@g*#                     ~    d dl mZ d dlmZ d dlmZ d dlmZ d dlm	Z	 d dl
mZmZmZ d dlmZmZmZ  G d d	e      Zy
)    )RequestOptions)StripeService)sanitize_id)Transaction)TransactionLineItemService)DictListcast)LiteralNotRequired	TypedDictc            	       (    e Zd Z fdZ G d de      Z G d de      Z G d de      Z G d d	e      Z G d
 de      Z	i i fde
dddedefdZi i fde
dddedefdZi fdddedefdZi fdddedefdZi fdddedefdZi fdddedefdZ xZS )TransactionServicec                 X    t         |   |       t        | j                        | _        y )N)super__init__r   
_requestor
line_items)self	requestor	__class__s     ^/var/www/html/AdoubleTech/venv/lib/python3.12/site-packages/stripe/tax/_transaction_service.pyr   zTransactionService.__init__   s     #4T__E    c                   j    e Zd ZU eed<   	 eee      ed<   	 eeeef      ed<   	 ee   ed<   	 eed<   y).TransactionService.CreateFromCalculationParamscalculationexpandmetadata	posted_at	referenceN)	__name__
__module____qualname__str__annotations__r   r	   r   int r   r   CreateFromCalculationParamsr      s[    	 DI&&	 d38n--	 s##	 	r   r(   c                       e Zd ZU eee      ed<   	 ee   ed<   	 eed      ed<   	 eeeef      ed<   	 e	d   ed<   	 eed<   	 eed	<   	 ed
   ed<   y)'TransactionService.CreateReversalParamsr   flat_amount/TransactionService.CreateReversalParamsLineItemr   r   )fullpartialmodeoriginal_transactionr    3TransactionService.CreateReversalParamsShippingCostshipping_costN)
r!   r"   r#   r   r	   r$   r%   r&   r   r   r'   r   r   CreateReversalParamsr*   )   s    DI&&	 !%%	  BC
 	
	 d38n--	 '((	 "!	 	 #A
 	
	r   r3   c                   j    e Zd ZU eed<   	 eed<   	 eeeef      ed<   	 eed<   	 ee   ed<   	 eed<   y)r,   amount
amount_taxr   original_line_itemquantityr    N)r!   r"   r#   r&   r%   r   r   r$   r'   r   r   CreateReversalParamsLineItemz/TransactionService.CreateReversalParamsLineItemO   s]    	 	 d38n--	  	 c""	 	r   r9   c                   $    e Zd ZU eed<   	 eed<   y)r1   r5   r6   N)r!   r"   r#   r&   r%   r'   r   r    CreateReversalParamsShippingCostz3TransactionService.CreateReversalParamsShippingCosti   s    	 	r   r;   c                   $    e Zd ZU eee      ed<   y)!TransactionService.RetrieveParamsr   N)r!   r"   r#   r   r	   r$   r%   r'   r   r   RetrieveParamsr=   s   s    DI&&	r   r>   transactionparamsr=   optionsreturnc                 |    t        t        | j                  ddj                  t	        |            d||            S )5
        Retrieves a Tax Transaction object.
        get"/v1/tax/transactions/{transaction}r?   apibase_addressr@   rA   )r
   r   _requestformatr   r   r?   r@   rA   s       r   retrievezTransactionService.retrievey   sN     MM4;; +K 8 <  #  
 	
r   c                    K   t        t        | j                  ddj                  t	        |            d||       d{         S 7 w)rD   rE   rF   rG   rH   rI   N)r
   r   _request_asyncrL   r   rM   s       r   retrieve_asyncz!TransactionService.retrieve_async   s^      %%4;; +K 8 <  # &  
 	
s   =A
A
 	A
r   c           
      J    t        t        | j                  ddd||            S )
        Creates a Tax Transaction from a calculation, if that calculation hasn't expired. Calculations expire after 90 days.
        post,/v1/tax/transactions/create_from_calculationrH   rI   r
   r   rK   r   r@   rA   s      r   create_from_calculationz*TransactionService.create_from_calculation   s4     MM>"  	
 		
r   c           
      f   K   t        t        | j                  ddd||       d{         S 7 w)rS   rT   rU   rH   rI   Nr
   r   rP   rW   s      r   create_from_calculation_asyncz0TransactionService.create_from_calculation_async   sD      %%>" &  	
 		
   $1/
	1r*   c           
      J    t        t        | j                  ddd||            S )O
        Partially or fully reverses a previously created Transaction.
        rT   $/v1/tax/transactions/create_reversalrH   rI   rV   rW   s      r   create_reversalz"TransactionService.create_reversal   s4     MM6"  	
 		
r   c           
      f   K   t        t        | j                  ddd||       d{         S 7 w)r^   rT   r_   rH   rI   NrZ   rW   s      r   create_reversal_asyncz(TransactionService.create_reversal_async   sD      %%6" &  	
 		
r\   )r!   r"   r#   r   r   r(   r3   r9   r;   r>   r$   r   r   rN   rQ   rX   r[   r`   rb   __classcell__)r   s   @r   r   r      sD   Fi ,$y $Ly 49   79"$	

 4
  	

 

2 79"$	

 4
  	

 

2 #%
@
  
 
	
, #%
@
  
 
	
, #%
9
  
 
	
, #%
9
  
 
	
r   r   N)stripe._request_optionsr   stripe._stripe_servicer   stripe._utilr   stripe.tax._transactionr   )stripe.tax._transaction_line_item_servicer   typingr   r	   r
   typing_extensionsr   r   r   r   r'   r   r   <module>rk      s4    3 0 $ / $ # = =a
 a
r   