
    khX                     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                   b   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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d.<   	 eed/<   ed0   ed1<   	 eed2<   	 ee   ed3<   	 ee   ed4<   	 eed5      ed6<   	 eed7<   	 e eef   ed8<   	 ed   ed9<   	 eed:      ed;<   	 eee      ed<<   	 ee   ed=<   	 ed0   ed><   	 eeed?         ed@<   	 eedA<   ee   edB<   	 ee   edC<   	 ee   edD<   	 edE   edF<   	 ee   edG<   	 eedH<   ee   edI<   	 eedJ<   	 e!dKe"dL   dMd fdN       Z#e!dKe"dL   dMd fdO       Z$e!dKe"dP   dMed    fdQ       Z%e!dKe"dP   dMed    fdR       Z&e!dedKe"dS   dMed5   fdT       Z'e(e)dedKe"dS   dMed5   fdU              Z*e(dKe"dS   dMed5   fdV       Z* e+dW      dKe"dS   dMed5   fdX       Z*e!dedKe"dS   dMed5   fdY       Z,e(e)dedKe"dS   dMed5   fdZ              Z-e(dKe"dS   dMed5   fd[       Z- e+d\      dKe"dS   dMed5   fd]       Z-e!d2edKe"d^   dMd fd_       Z.e!d2edKe"d^   dMd fd`       Z/e!d2edKe"da   dMd fdb       Z0e!d2edKe"da   dMd fdc       Z1e	e
eeeeeeeeeeeeeddZ2ye)f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__     T/var/www/api/v1/venv_fitandmore/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                   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   G  s.    M c]" c]"r.   r   adjustable_quantitypricequantityN)
r(   r)   r*   r   r   r   r,   r+   rl   r9   r-   r.   r/   OptionalItemr   F  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   Z  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   N)r(   r)   r*   rF   r,   r-   r.   r/   PhoneNumberCollectionr   z  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   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	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.createx  s6        
 	
r.   c                 v   K   t        d| j                  d| j                         |       d{         S 7 w)r/  r   r0  r1  N)r   _static_request_asyncr3  r4  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.
        getr1  %Expected list object from API, got %s)r2  r3  
isinstancer   	TypeErrorr8   r(   r5  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)r;  r<  r1  Nr=  )r8  r3  r>  r   r?  r8   r(   r@  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   r<  +/v1/payment_links/{payment_link}/line_itemsr    r1  )r   r   r2  formatr
   r5  r    r,  s      r/   _cls_list_line_itemsz PaymentLink._cls_list_line_items  sP     z"=DD!,\!: E     	
 		
r.   c                      yrF  Nr-   r    r,  s     r/   list_line_itemszPaymentLink.list_line_items  s     	r.   c                      yrM  r-   rA   r,  s     r/   rO  zPaymentLink.list_line_items  s     	r.   rK  c                     t        t        d   | j                  ddj                  t	        | j                  d                  |            S )rF  r   r<  rG  r  rH  r1  )r   r   _requestrI  r
   r<  rQ  s     r/   rO  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)rF  r   r<  rG  rH  r1  N)r   r   r8  rI  r
   rJ  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rM  r-   rN  s     r/   list_line_items_asyncz!PaymentLink.list_line_items_async  s      	   c                    K   ywrM  r-   rQ  s     r/   rW  z!PaymentLink.list_line_items_async  s      	rX  rU  c                    K   t        t        d   | j                  ddj                  t	        | j                  d                  |       d{         S 7 w)rF  r   r<  rG  r  rH  r1  N)r   r   _request_asyncrI  r
   r<  rQ  s     r/   rW  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   r0  r1  )r3  r
   r   r2  r5  r  r,  r3   s       r/   modifyzPaymentLink.modify2  sD     +b/:   
 	
r.   c                    K   | j                         dt        |      }t        d| j                  d||       d{         S 7 w)r]  r^  r   r0  r1  N)r3  r
   r   r8  r_  s       r/   modify_asynczPaymentLink.modify_asyncC  sR      +b/:++ ,  
 	
s   <A	A
	A	r   c                 8     | |fi |}|j                          |S )*
        Retrieve a payment link.
        )refreshr5  r  r,  instances       r/   retrievezPaymentLink.retrieveT  s$     r$V$r.   c                 T   K    | |fi |}|j                          d{    |S 7 w)rd  N)refresh_asyncrf  s       r/   retrieve_asynczPaymentLink.retrieve_async_  s3      r$V$$$&&& 	's   (&()r  r  r  r   r  r  r  r  r   r!  r"  r#  r)  r*  r+  N)3r(   r)   r*   __doc__r!   r   r   r,   r   r:   rG   rV   rw   r   r   r   r   r   r   r  r  r  r  r  rF   r   r   rl   floatr+   r   r   r   classmethodr   r6  r9  rB  rD  rK  r   staticmethodrO  r	   rU  rW  r`  rb  rh  rk  r9   r-   r.   r/   r   r   "   s   
 6DK'.12C
, 
06| 6*
L 
2Q
l Q
f.
\ .
`J;, J;X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## ?9566 T,/00 ""344  ''>?? #$&(	
* *V 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	  ,%/$!+&0#8$'@*-,%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
X-(&-(Xr.   