
    AiV                     8   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 d dlmZmZ d dlmZmZmZmZmZmZ d d	lmZmZmZ er<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% d dl&m'Z' d dl(m)Z) d dl*m+Z+ d dl,m-Z-  G d ded   ed   ed         Z.y)    )CreateableAPIResource)ExpandableField)
ListObject)ListableAPIResource)StripeObject)UpdateableAPIResource)class_method_variantsanitize_id)ClassVarDictListOptionalcastoverload)LiteralUnpackTYPE_CHECKING)Account)Application)LineItem)ShippingRate)TaxId)PaymentLinkCreateParams)PaymentLinkListLineItemsParams)PaymentLinkListParams)PaymentLinkModifyParams)PaymentLinkRetrieveParamsc            	          e Zd ZU dZdZeed      ed<    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 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 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 G d" d#e      Zeed$<   	 e	ed%<   eed&<   	 eed'      ed(<   	 ee   ed)<   	 ee   ed*<   	 e
ed+<   ed,   ed-<   	 ee   ed.<   	 eed/<   	 ee   ed0<   	 eed1<   ed2   ed3<   	 eed4<   	 ee   ed5<   	 ee   ed6<   	 ee d7      ed8<   	 eed9<   	 e!eef   ed:<   	 ee   ed;<   ed   ed<<   	 eed=      ed><   	 eee      ed?<   	 ee   ed@<   	 ed2   edA<   	 eeedB         edC<   	 eedD<   ee   edE<   	 ee   edF<   	 ee   edG<   	 edH   edI<   	 ee   edJ<   	 eedK<   ee   edL<   	 eedM<   	 e"dNe#dO   dPd fdQ       Z$e"dNe#dO   dPd fdR       Z%e"dNe#dS   dPe d    fdT       Z&e"dNe#dS   dPe d    fdU       Z'e"dedNe#dV   dPe d7   fdW       Z(e)e*dedNe#dV   dPe d7   fdX              Z+e)dNe#dV   dPe d7   fdY       Z+ e,dZ      dNe#dV   dPe d7   fd[       Z+e"dedNe#dV   dPe d7   fd\       Z-e)e*dedNe#dV   dPe d7   fd]              Z.e)dNe#dV   dPe d7   fd^       Z. e,d_      dNe#dV   dPe d7   fd`       Z.e"d4edNe#da   dPd fdb       Z/e"d4edNe#da   dPd fdc       Z0e"d4edNe#dd   dPd fde       Z1e"d4edNe#dd   dPd fdf       Z2i d%e	d+e
d.ed0ed1ed6ed;ed?ed@edDedEedFedGedJedKedLeZ3yg)hPaymentLinka#  
    A payment link is a shareable URL that will take your customers to a hosted payment page. A payment link can be shared and used multiple times.

    When a customer opens a payment link it will open a new [checkout session](https://stripe.com/docs/api/checkout/sessions) to render the payment page. You can use [checkout session events](https://stripe.com/docs/api/events/types#event_types-checkout.session.completed) to track payments through payment links.

    Related guide: [Payment Links API](https://stripe.com/docs/payment-links)
    payment_linkOBJECT_NAMEc                   v    e Zd ZU  G d de      Z G d de      Zee   ed<   ee   ed<   ed   ed<   	 eedZ	y	)
PaymentLink.AfterCompletionc                       e Zd ZU ee   ed<   y).PaymentLink.AfterCompletion.HostedConfirmationcustom_messageN__name__
__module____qualname__r   str__annotations__     G/var/www/html/immo/lib/python3.12/site-packages/stripe/_payment_link.pyHostedConfirmationr%   2   s    $SM)r.   r0   c                       e Zd ZU eed<   y)$PaymentLink.AfterCompletion.RedirecturlNr(   r)   r*   r+   r,   r-   r.   r/   Redirectr2   8   s    Hr.   r5   hosted_confirmationredirect)r6   r7   typeN)
r(   r)   r*   r   r0   r5   r   r,   r   _inner_class_typesr-   r.   r/   AfterCompletionr#   1   sT    	 		| 	 &&8998$$788	 $6 
r.   r:   c                   J    e Zd ZU  G d de      Zeed<   	 ee   ed<   	 deiZy)PaymentLink.AutomaticTaxc                   6    e Zd ZU eed      ed<   	 ed   ed<   y)"PaymentLink.AutomaticTax.Liabilityr   accountr?   selfr8   Nr(   r)   r*   r   r   r,   r   r-   r.   r/   	Liabilityr>   J   s*    oi899 +,,r.   rC   enabled	liabilityN)	r(   r)   r*   r   rC   boolr,   r   r9   r-   r.   r/   AutomaticTaxr<   I   s9    	 	 	 I&&	 *95r.   rG   c                   n    e Zd ZU  G d de      Zee   ed<   	 eed      ed<   	 eed      ed<   	 deiZy)	PaymentLink.ConsentCollectionc                       e Zd ZU ed   ed<   y)9PaymentLink.ConsentCollection.PaymentMethodReuseAgreement)autohiddenpositionNr(   r)   r*   r   r,   r-   r.   r/   PaymentMethodReuseAgreementrK   _   s    .//r.   rP   payment_method_reuse_agreement)rL   none
promotions)rR   requiredterms_of_serviceN)	r(   r)   r*   r   rP   r   r,   r   r9   r-   r.   r/   ConsentCollectionrI   ^   s`    	, 	 )11L(MM	 W^455	 #7+=#>??	 -.I
r.   rV   c                       e Zd ZU  G d de      Z G d de      Z G d de      Z G d de      Zee   e	d	<   e
e	d
<   	 ee	d<   ee   e	d<   ee	d<   	 ee   e	d<   ed   e	d<   	 eeeedZy)PaymentLink.CustomFieldc                   P    e Zd ZU  G d de      Zee   ed<   	 ee   ed<   	 deiZ	y) PaymentLink.CustomField.Dropdownc                   $    e Zd ZU eed<   	 eed<   y)'PaymentLink.CustomField.Dropdown.OptionlabelvalueNr4   r-   r.   r/   Optionr\   y   s    
 
r.   r_   default_valueoptionsN)
r(   r)   r*   r   r_   r   r+   r,   r   r9   r-   r.   r/   DropdownrZ   x   s=      $C=( &\! #,V!4r.   rb   c                   0    e Zd ZU ee   ed<   	 ed   ed<   y)PaymentLink.CustomField.Labelcustomr8   N)r(   r)   r*   r   r+   r,   r   r-   r.   r/   Labelrd      s#    SM! (##r.   rf   c                   B    e Zd ZU ee   ed<   	 ee   ed<   	 ee   ed<   y)PaymentLink.CustomField.Numericr`   maximum_lengthminimum_lengthNr(   r)   r*   r   r+   r,   intr-   r.   r/   Numericrh      3    #C=( %SM) %SM)r.   rm   c                   B    e Zd ZU ee   ed<   	 ee   ed<   	 ee   ed<   y)PaymentLink.CustomField.Textr`   ri   rj   Nrk   r-   r.   r/   Textrp      rn   r.   rq   dropdownkeyr]   numericoptionaltext)rr   rt   rv   r8   )rr   r]   rt   rv   N)r(   r)   r*   r   rb   rf   rm   rq   r   r,   r+   rF   r   r9   r-   r.   r/   CustomFieldrX   w   s    	5| 	5*	L 		l 		< 	 8$$	 '""	 tn344	 !	
r.   rw   c                       e Zd ZU  G d de      Z G d de      Z G d de      Z G d de      Zee   e	d	<   	 ee   e	d
<   	 ee   e	d<   	 ee   e	d<   	 eeeedZ
y)PaymentLink.CustomTextc                       e Zd ZU eed<   y)"PaymentLink.CustomText.AfterSubmitmessageNr4   r-   r.   r/   AfterSubmitr{          Lr.   r}   c                       e Zd ZU eed<   y)&PaymentLink.CustomText.ShippingAddressr|   Nr4   r-   r.   r/   ShippingAddressr      r~   r.   r   c                       e Zd ZU eed<   y)PaymentLink.CustomText.Submitr|   Nr4   r-   r.   r/   Submitr      r~   r.   r   c                       e Zd ZU eed<   y)/PaymentLink.CustomText.TermsOfServiceAcceptancer|   Nr4   r-   r.   r/   TermsOfServiceAcceptancer      r~   r.   r   after_submitshipping_addresssubmitterms_of_service_acceptance)r   r   r   r   N)r(   r)   r*   r   r}   r   r   r   r   r,   r9   r-   r.   r/   
CustomTextry      s    	, 		l 		\ 		| 	 {++	 #?33	   	 &..F%GG	 ( /+C	
r.   r   c                   J    e Zd ZU  G d de      Zeed<   	 ee   ed<   	 deiZy)PaymentLink.InvoiceCreationc                       e Zd ZU  G d de      Z G d de      Z G d de      Zeee	d         e
d<   	 eee      e
d	<   	 ee   e
d
<   	 ee   e
d<   	 ee   e
d<   	 eeeef      e
d<   	 ee   e
d<   	 eeedZy)'PaymentLink.InvoiceCreation.InvoiceDatac                   $    e Zd ZU eed<   	 eed<   y)3PaymentLink.InvoiceCreation.InvoiceData.CustomFieldnamer^   Nr4   r-   r.   r/   rw   r      s    	 
r.   rw   c                   6    e Zd ZU eed      ed<   	 ed   ed<   y).PaymentLink.InvoiceCreation.InvoiceData.Issuerr   r?   r@   r8   NrB   r-   r.   r/   Issuerr     *    !/)"<== /00r.   r   c                   0    e Zd ZU ee   ed<   	 ee   ed<   y)8PaymentLink.InvoiceCreation.InvoiceData.RenderingOptionsamount_tax_displaytemplateNr'   r-   r.   r/   RenderingOptionsr     s"    $,SM1 #3-'r.   r   r   account_tax_idscustom_fieldsdescriptionfooterissuermetadatarendering_options)r   r   r   N)r(   r)   r*   r   rw   r   r   r   r   r   r,   r+   r   r9   r-   r.   r/   InvoiceDatar      s    l  <  &d?7+C&DEE $D$566 "#& SM! V$$ tCH~..  ((899 "- %5"r.   r   rD   invoice_dataN)	r(   r)   r*   r   r   rF   r,   r   r9   r-   r.   r/   InvoiceCreationr      s:    ?	, ?	B 	 {++	 -k:r.   r   c                   d    e Zd ZU  G d de      Z G d de      Zee   ed<   ee   ed<   eedZy)	PaymentLink.NameCollectionc                   $    e Zd ZU eed<   	 eed<   y)#PaymentLink.NameCollection.BusinessrD   ru   Nr(   r)   r*   rF   r,   r-   r.   r/   Businessr   G      M Nr.   r   c                   $    e Zd ZU eed<   	 eed<   y)%PaymentLink.NameCollection.IndividualrD   ru   Nr   r-   r.   r/   
Individualr   Q  r   r.   r   business
individual)r   r   N)	r(   r)   r*   r   r   r   r   r,   r9   r-   r.   r/   NameCollectionr   F  s=    	| 		 	 8$$Z((*2*Mr.   r   c                   P    e Zd ZU  G d de      Zee   ed<   eed<   eed<   deiZ	y)PaymentLink.OptionalItemc                   <    e Zd ZU eed<   	 ee   ed<   	 ee   ed<   y)+PaymentLink.OptionalItem.AdjustableQuantityrD   maximumminimumN)r(   r)   r*   rF   r,   r   rl   r-   r.   r/   AdjustableQuantityr   `  s.    M c]" c]"r.   r   adjustable_quantitypricequantityN)
r(   r)   r*   r   r   r   r,   r+   rl   r9   r-   r.   r/   OptionalItemr   _  s2    	 	 &&899
35GHr.   r   c                       e Zd ZU eed      ed<   	 ee   ed<   	 eeef   ed<   	 eed      ed<   	 ee   ed<   	 ee   ed<   	 ee   ed	<   y
)PaymentLink.PaymentIntentData)	automaticautomatic_asyncmanualcapture_methodr   r   )off_session
on_sessionsetup_future_usagestatement_descriptorstatement_descriptor_suffixtransfer_groupN)r(   r)   r*   r   r   r,   r+   r   r-   r.   r/   PaymentIntentDatar   s  s     <=
 	
	 c]"	 sCx. 	 %W-H%IJJ	 'sm+	 &.c]2	 !%	r.   r   c                       e Zd ZU eed<   y)!PaymentLink.PhoneNumberCollectionrD   Nr   r-   r.   r/   PhoneNumberCollectionr     s    	r.   r   c                   6    e Zd ZU  G d de      Zeed<   deiZy)PaymentLink.Restrictionsc                   $    e Zd ZU eed<   	 eed<   y)*PaymentLink.Restrictions.CompletedSessionscountlimitN)r(   r)   r*   rl   r,   r-   r.   r/   CompletedSessionsr     s    J Jr.   r   completed_sessionsN)r(   r)   r*   r   r   r,   r9   r-   r.   r/   Restrictionsr     s"    	 	 .-24EFr.   r   c                   $    e Zd ZU eed      ed<   y)%PaymentLink.ShippingAddressCollection)ACADAEAFAGAIALAMAOAQARATAUAWAXAZBABBBDBEBFBGBHBIBJBLBMBNBOBQBRBSBTBVBWBYBZCACDCFCGCHCICKCLCMCNCOCRCVCWCYCZDEDJDKDMDODZECEEEGEHERESETFIFJFKFOFRGAGBGDGEGFGGGHGIGLGMGNGPGQGRGSGTGUGWGYHKHNHRHTHUIDIEILIMINIOIQISITJEJMJOJPKEKGKHKIKMKNKRKWKYKZLALBLCLILKLRLSLTLULVLYMAMCMDMEMFMGMKMLMMMNMOMQMRMSMTMUMVMWMXMYMZNANCNENGNINLNONPNRNUNZOMPAPEPFPGPHPKPLPMPNPRPSPTPYQARERORSRURWSASBSCSDSESGSHSISJSKSLSMSNSOSRSSSTSVSXSZTATCTDTFTGTHTJTKTLTMTNTOTRTTTVTWTZUAUGUSUYUZVAVCVEVGVNVUWFWSXKYEYTZAZMZWZZallowed_countriesN)r(   r)   r*   r   r   r,   r-   r.   r/   ShippingAddressCollectionr     s&    moq
 q	
d	r.   r  c                   *    e Zd ZU eed<   	 ed   ed<   y)PaymentLink.ShippingOptionshipping_amountr   shipping_rateN)r(   r)   r*   rl   r,   r   r-   r.   r/   ShippingOptionr    s    	 '~66	r.   r  c                       e Zd ZU  G d de      Z G d de      Zee   ed<   	 eed<   e	eef   ed<   	 ee
   ed<   	 ee   ed	<   	 eed
Zy)PaymentLink.SubscriptionDatac                   6    e Zd ZU  G d de      Zeed<   deiZy),PaymentLink.SubscriptionData.InvoiceSettingsc                   6    e Zd ZU eed      ed<   	 ed   ed<   y)3PaymentLink.SubscriptionData.InvoiceSettings.Issuerr   r?   r@   r8   NrB   r-   r.   r/   r   r    r   r.   r   r   N)r(   r)   r*   r   r   r,   r9   r-   r.   r/   InvoiceSettingsr    s       N"*F!3r.   r  c                   8    e Zd ZU  G d de      Zeed<   	 deiZy)*PaymentLink.SubscriptionData.TrialSettingsc                       e Zd ZU ed   ed<   y)6PaymentLink.SubscriptionData.TrialSettings.EndBehavior)cancelcreate_invoicepausemissing_payment_methodNrO   r-   r.   r/   EndBehaviorr    s    (/7) r.   r  end_behaviorN)r(   r)   r*   r   r  r,   r9   r-   r.   r/   TrialSettingsr    s(    l  &% #1+!>r.   r  r   invoice_settingsr   trial_period_daystrial_settings)r  r  N)r(   r)   r*   r   r  r  r   r+   r,   r   rl   r9   r-   r.   r/   SubscriptionDatar    sy    	4l 	4	?L 	? c]"	 *)sCx. 	 $C=(	 !//	 !0+
r.   r  c                   *    e Zd ZU eed<   	 ed   ed<   y)PaymentLink.TaxIdCollectionrD   )if_supportedneverrT   N)r(   r)   r*   rF   r,   r   r-   r.   r/   TaxIdCollectionr    s    	 122r.   r  c                   0    e Zd ZU ee   ed<   	 ed   ed<   y)PaymentLink.TransferDataamountr   destinationN)r(   r)   r*   r   rl   r,   r   r-   r.   r/   TransferDatar    s#    	 %Y//	r.   r  activeafter_completionallow_promotion_codesr   applicationapplication_fee_amountapplication_fee_percentautomatic_tax)rL   rT   billing_address_collectionconsent_collectioncurrencyr   custom_text)alwaysif_requiredcustomer_creationidinactive_messageinvoice_creationr   
line_itemslivemoder   name_collectionobjectr   on_behalf_ofoptional_itemspayment_intent_datapayment_method_collection)&affirmafterpay_clearpayalipayalmaau_becs_debit
bacs_debit
bancontactbillieblikboletocardcashappepsfpxgiropaygrabpayidealklarnakonbinilinkmb_way	mobilepay
multibancooxxop24pay_by_bankpaynowpaypalpix	promptpaysatispay
sepa_debitsofortswishtwintus_bank_account
wechat_payzippayment_method_typesphone_number_collectionrestrictionsshipping_address_collectionshipping_options)rL   bookdonatepay	subscribesubmit_typesubscription_datatax_id_collectiontransfer_datar3   paramsr   returnc                 Z    t        d| j                  d| j                         |            S ))
        Creates a payment link.
        r   postr;  )r   _static_request	class_urlclsr;  s     r/   createzPaymentLink.create  s6        
 	
r.   c                 v   K   t        d| j                  d| j                         |       d{         S 7 w)r>  r   r?  r@  N)r   _static_request_asyncrB  rC  s     r/   create_asynczPaymentLink.create_async  sD      ++ ,  
 	
s   ,97
	9r   c                     | j                  d| j                         |      }t        |t              s!t	        dt        |      j                  z        |S )7
        Returns a list of your payment links.
        getr@  %Expected list object from API, got %s)rA  rB  
isinstancer   	TypeErrorr8   r(   rD  r;  results      r/   listzPaymentLink.list  s]     $$MMO % 

 &*-7<((* 
 r.   c                    K   | j                  d| j                         |       d{   }t        |t              s!t	        dt        |      j                  z        |S 7 7w)rJ  rK  r@  NrL  )rG  rB  rM  r   rN  r8   r(   rO  s      r/   
list_asynczPaymentLink.list_async  sk      00MMO 1 
 

 &*-7<((* 
 
s   &A"A 8A"r   c                 ~    t        t        d   | j                  ddj                  t	        |            |            S )
        When retrieving a payment link, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items.
        r   rK  +/v1/payment_links/{payment_link}/line_itemsr    r@  )r   r   rA  formatr
   rD  r    r;  s      r/   _cls_list_line_itemsz PaymentLink._cls_list_line_items  sP     z"=DD!,\!: E     	
 		
r.   c                      yrU  Nr-   r    r;  s     r/   list_line_itemszPaymentLink.list_line_items  s     	r.   c                      yr\  r-   rA   r;  s     r/   r^  zPaymentLink.list_line_items  s     	r.   rZ  c                     t        t        d   | j                  ddj                  t	        | j                  d                  |            S )rU  r   rK  rV  r  rW  r@  )r   r   _requestrX  r
   rK  r`  s     r/   r^  zPaymentLink.list_line_items  sV     z"MM=DD!,TXXd^!< E    	
 		
r.   c                    K   t        t        d   | j                  ddj                  t	        |            |       d{         S 7 w)rU  r   rK  rV  rW  r@  N)r   r   rG  rX  r
   rY  s      r/   _cls_list_line_items_asyncz&PaymentLink._cls_list_line_items_async  s^      z"++=DD!,\!: E   ,  	
 		
s   >A A	
	Ac                    K   ywr\  r-   r]  s     r/   list_line_items_asyncz!PaymentLink.list_line_items_async(  s      	   c                    K   ywr\  r-   r`  s     r/   rf  z!PaymentLink.list_line_items_async2  s      	rg  rd  c                    K   t        t        d   | j                  ddj                  t	        | j                  d                  |       d{         S 7 w)rU  r   rK  rV  r  rW  r@  N)r   r   _request_asyncrX  r
   rK  r`  s     r/   rf  z!PaymentLink.list_line_items_async;  sf      z"%%=DD!,TXXd^!< E   &  	
 		
s   AAA
	Ar   c                 z    | j                         dt        |      }t        d| j                  d||            S ))
        Updates a payment link.
        /r   r?  r@  )rB  r
   r   rA  rD  r  r;  r3   s       r/   modifyzPaymentLink.modifyM  sD     +b/:   
 	
r.   c                    K   | j                         dt        |      }t        d| j                  d||       d{         S 7 w)rl  rm  r   r?  r@  N)rB  r
   r   rG  rn  s       r/   modify_asynczPaymentLink.modify_async^  sR      +b/:++ ,  
 	
s   <A	A
	A	r   c                 8     | |fi |}|j                          |S )*
        Retrieve a payment link.
        )refreshrD  r  r;  instances       r/   retrievezPaymentLink.retrieveo  s$     r$V$r.   c                 T   K    | |fi |}|j                          d{    |S 7 w)rs  N)refresh_asyncru  s       r/   retrieve_asynczPaymentLink.retrieve_asyncz  s3      r$V$$$&&& 	's   (&(N)4r(   r)   r*   __doc__r!   r   r   r,   r   r:   rG   rV   rw   r   r   r   r   r   r   r   r  r  r  r  r  rF   r   r   rl   floatr+   r   r   r   classmethodr   rE  rH  rQ  rS  rZ  r   staticmethodr^  r	   rd  rf  ro  rq  rw  rz  r9   r-   r.   r/   r   r   "   s3   
 6DK'.12C
, 
06| 6*
L 
2Q
l Q
f.
\ .
`J;, J;XN N2I| I(L @ G| GuL un 2
< 2
h3, 3|  L &% /-899 %SM) &e_,   '(: ;; !!233 M $$ 677 	G sm# // J/00 N 38n n--N## ?9566 T,/00 ""344  ''>?? #%')	
+ +X 32<(( "**C!DD >** EFF   011 '&L)) 
H 
78
	
 
 
78
	
 
 56	M	" & 56	M	" & 

 9:
 
J		
 
& %+,L%M	J	   ?@	J	  01
?@
	J	
 2
" 

 9:
 
J		
 
& %+,L%M	J	   ?@	J	  67
?@
	J	
 8
" 

 &'@ A
	
 
  

 &'@ A
	
 
   &'B C	   &'B C	 O 	/ 		
 	z 	O 	> 	, 	0 	"#8 	 	&'@ 	N 	- 	_  	!r.   r   N)/stripe._createable_api_resourcer   stripe._expandable_fieldr   stripe._list_objectr   stripe._listable_api_resourcer   stripe._stripe_objectr   stripe._updateable_api_resourcer   stripe._utilr	   r
   typingr   r   r   r   r   r   typing_extensionsr   r   r   stripe._accountr   stripe._applicationr   stripe._line_itemr   stripe._shipping_rater   stripe._tax_idr   )stripe.params._payment_link_create_paramsr   2stripe.params._payment_link_list_line_items_paramsr   'stripe.params._payment_link_list_paramsr   )stripe.params._payment_link_modify_paramsr   +stripe.params._payment_link_retrieve_paramsr   r   r-   r.   r/   <module>r     sy    B 4 * = . A : A A < <'/*2$ N
t-(&-(tr.   