a
    !fʅ                     @   s  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mZ d dlmZmZmZmZmZ erd 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 ded Z*dS )    )ListableAPIResource)ExpandableField)
ListObject)RequestOptions)StripeObject)ClassVarListOptionalUnion)LiteralNotRequired	TypedDictUnpackTYPE_CHECKING)Account)Application)BankAccount)Card)Customer)Mandate)PaymentIntent)PaymentMethod)SetupIntent)Sourcec                   @   sP  e Zd ZU dZdZeed  ed< G dd deZ	G dd deZ
G dd	 d	eZG d
d deZeed  ed< ee ed< eed< eed  ed< eeed   ed< eed< eed< ed ed< eed  ed< ed ed< e	ed< ee
 ed< ed ed< eed< eed < ed'ee ee ee ed" ed  d#d$d%Ze	e
d&Zd!S )(SetupAttempta  
    A SetupAttempt describes one attempted confirmation of a SetupIntent,
    whether that confirmation is successful or unsuccessful. You can use
    SetupAttempts to inspect details of a specific attempt at setting up a
    payment method using a SetupIntent.
    Zsetup_attemptOBJECT_NAMEc                   @   s  e Zd ZU G dd deZG dd deZG dd deZG dd deZG d	d
 d
eZG dd deZ	G dd deZ
G dd deZG dd deZG dd deZG dd deZG dd deZG dd deZG dd deZG dd deZee ed< ee ed < ee ed!< ee ed"< ee ed#< ee	 ed$< ee
 ed%< ee ed&< ee ed'< ee ed(< ee ed)< ee ed*< ee ed+< ee ed,< eed-< ee ed.< eeeeee	e
eeeeeeeed/Zd0S )1z!SetupAttempt.PaymentMethodDetailsc                   @   s   e Zd ZdS )z+SetupAttempt.PaymentMethodDetails.AcssDebitN__name__
__module____qualname__ r    r    c/var/www/html/python-backend/venv/lib/python3.9/site-packages/stripe/api_resources/setup_attempt.py	AcssDebit)   s   r"   c                   @   s   e Zd ZdS )z-SetupAttempt.PaymentMethodDetails.AuBecsDebitNr   r    r    r    r!   AuBecsDebit,   s   r#   c                   @   s   e Zd ZdS )z+SetupAttempt.PaymentMethodDetails.BacsDebitNr   r    r    r    r!   	BacsDebit/   s   r$   c                   @   sz   e Zd ZU ee ed< ee ed< ee ed< eed  ed< eed  ed< ee ed< eed	  ed
< ee ed< dS )z,SetupAttempt.PaymentMethodDetails.Bancontact	bank_code	bank_namebicr   generated_sepa_debitr   generated_sepa_debit_mandate
iban_last4deenfrnlpreferred_languageverified_nameNr   r   r   r	   str__annotations__r   r   r    r    r    r!   
Bancontact2   s   
r5   c                   @   s   e Zd ZdS )z(SetupAttempt.PaymentMethodDetails.BoletoNr   r    r    r    r!   BoletoV   s   r6   c                   @   s   e Zd ZU G dd deZG dd deZG dd deZee e	d< ee e	d< ee e	d	< ee e	d
< ee
 e	d< ee
 e	d< ee e	d< ee e	d< ee e	d< ee e	d< ee e	d< ee e	d< ee e	d< ee e	d< eeedZdS )z&SetupAttempt.PaymentMethodDetails.Cardc                   @   s2   e Zd ZU ee ed< ee ed< ee ed< dS )z-SetupAttempt.PaymentMethodDetails.Card.ChecksZaddress_line1_checkZaddress_postal_code_checkZ	cvc_checkN)r   r   r   r	   r3   r4   r    r    r    r!   ChecksZ   s   
r7   c                   @   sj   e Zd ZU eed  ed< eed  ed< eed  ed< eed  ed< ee ed	< eed
  ed< dS )z3SetupAttempt.PaymentMethodDetails.Card.ThreeDSecure)	challengeZfrictionlessZauthentication_flow)Z01Z02Z05Z06Z07Zelectronic_commerce_indicator)Zattempt_acknowledgedauthenticatedZexemptedfailedZnot_supportedprocessing_errorresult)Z	abandonedZbypassedcanceledZcard_not_enrolledZnetwork_not_supportedZprotocol_errorZrejectedZresult_reasonZtransaction_id)z1.0.2z2.1.0z2.2.0versionN)r   r   r   r	   r   r4   r3   r    r    r    r!   ThreeDSecureh   s&   
r?   c                   @   s\   e Zd ZU G dd deZG dd deZee ed< ee ed< ed ed< eed	Z	d
S )z-SetupAttempt.PaymentMethodDetails.Card.Walletc                   @   s   e Zd ZdS )z6SetupAttempt.PaymentMethodDetails.Card.Wallet.ApplePayNr   r    r    r    r!   ApplePay   s   r@   c                   @   s   e Zd ZdS )z7SetupAttempt.PaymentMethodDetails.Card.Wallet.GooglePayNr   r    r    r    r!   	GooglePay   s   rA   	apple_pay
google_pay)rB   rC   linktype)rB   rC   N)
r   r   r   r   r@   rA   r	   r4   r   _inner_class_typesr    r    r    r!   Wallet   s   
rG   ZbrandchecksZcountrydescriptionZ	exp_monthZexp_yearfingerprintZfundingZiinZissuerZlast4networkthree_d_securewallet)rH   rL   rM   N)r   r   r   r   r7   r?   rG   r	   r3   r4   intrF   r    r    r    r!   r   Y   s*   
5r   c                   @   s   e Zd ZU eed  ed< dS )z-SetupAttempt.PaymentMethodDetails.CardPresentr   Zgenerated_cardN)r   r   r   r	   r   r4   r    r    r    r!   CardPresent   s   
rO   c                   @   s   e Zd ZdS )z)SetupAttempt.PaymentMethodDetails.CashappNr   r    r    r    r!   Cashapp   s   rP   c                   @   sf   e Zd ZU eed  ed< eed  ed< eed  ed< eed  ed< ee ed	< ee ed
< dS )z'SetupAttempt.PaymentMethodDetails.Ideal)Zabn_amroZasn_bankZbunqZhandelsbankenZingZknabZmoneyouZn26ZrabobankZ	regiobankZrevolutZsns_bankZtriodos_bankZvan_lanschotZyoursafebank)ZABNANL2AZASNBNL21ZBITSNL2AZBUNQNL2AZFVLBNL22ZHANDNL2AZINGBNL2AZKNABNL2HZMOYONL21ZNTSBDEB1ZRABONL2UZRBRBNL21ZREVOIE23ZREVOLT21ZSNSBNL2AZTRIONL2Ur'   r   r(   r   r)   r*   r1   N)r   r   r   r	   r   r4   r   r3   r    r    r    r!   Ideal   s   
rR   c                   @   s   e Zd ZdS )z(SetupAttempt.PaymentMethodDetails.KlarnaNr   r    r    r    r!   Klarna8  s   rS   c                   @   s   e Zd ZdS )z&SetupAttempt.PaymentMethodDetails.LinkNr   r    r    r    r!   Link;  s   rT   c                   @   s   e Zd ZdS )z(SetupAttempt.PaymentMethodDetails.PaypalNr   r    r    r    r!   Paypal>  s   rU   c                   @   s   e Zd ZdS )z+SetupAttempt.PaymentMethodDetails.SepaDebitNr   r    r    r    r!   	SepaDebitA  s   rV   c                   @   sz   e Zd ZU ee ed< ee ed< ee ed< eed  ed< eed  ed< ee ed< eed	  ed
< ee ed< dS )z(SetupAttempt.PaymentMethodDetails.Sofortr%   r&   r'   r   r(   r   r)   r*   r+   r0   r1   Nr2   r    r    r    r!   SofortD  s   
rW   c                   @   s   e Zd ZdS )z/SetupAttempt.PaymentMethodDetails.UsBankAccountNr   r    r    r    r!   UsBankAccounth  s   rX   
acss_debitau_becs_debit
bacs_debit
bancontactboletocardcard_presentcashappidealklarnarD   paypal
sepa_debitsofortrE   us_bank_account)rY   rZ   r[   r\   r]   r^   r_   r`   ra   rb   rD   rc   rd   re   rf   N)r   r   r   r   r"   r#   r$   r5   r6   r   rO   rP   rR   rS   rT   rU   rV   rW   rX   r	   r4   r3   rF   r    r    r    r!   PaymentMethodDetails(   s`   
$ @$rg   c                   @   s   e Zd ZU ee ed< eed  ed< ee ed< ee ed< ee ed< ee ed< ed ed	< ed
 ed< ee ed< ee ed< ed ed< eed  ed< ed ed< dS )zSetupAttempt.SetupErrorZcharge)Zaccount_closedZaccount_country_invalid_addressZ6account_error_country_change_requires_additional_stepsZaccount_information_mismatchZaccount_invalidZaccount_number_invalidZacss_debit_session_incompleteZalipay_upgrade_requiredZamount_too_largeZamount_too_smallZapi_key_expiredZapplication_fees_not_allowedZauthentication_requiredZbalance_insufficientZbalance_invalid_parameterZ bank_account_bad_routing_numbersZbank_account_declinedZbank_account_existsZbank_account_restrictedZbank_account_unusableZbank_account_unverifiedZ bank_account_verification_failedZbilling_invalid_mandateZbitcoin_upgrade_requiredZ$capture_charge_authorization_expiredZcapture_unauthorized_paymentZ card_decline_rate_limit_exceededZcard_declinedZ cardholder_phone_number_requiredZcharge_already_capturedZcharge_already_refundedZcharge_disputedZcharge_exceeds_source_limitZcharge_expired_for_captureZcharge_invalid_parameterZcharge_not_refundableZclearing_code_unsupportedZcountry_code_invalidZcountry_unsupportedZcoupon_expiredZcustomer_max_payment_methodsZcustomer_max_subscriptionsZdebit_not_authorizedZemail_invalidZexpired_cardZ&financial_connections_account_inactiveZidempotency_key_in_useZincorrect_addressZincorrect_cvcZincorrect_numberZincorrect_zipZinstant_payouts_config_disabledZ!instant_payouts_currency_disabledZinstant_payouts_limit_exceededZinstant_payouts_unsupportedZinsufficient_fundsZintent_invalid_stateZ"intent_verification_method_missingZinvalid_card_typeZinvalid_charactersZinvalid_charge_amountZinvalid_cvcZinvalid_expiry_monthZinvalid_expiry_yearZinvalid_numberZinvalid_source_usageZinvalid_tax_locationZinvoice_no_customer_line_itemsZinvoice_no_payment_method_typesZ"invoice_no_subscription_line_itemsZinvoice_not_editableZ!invoice_on_behalf_of_not_editableZ&invoice_payment_intent_requires_actionZinvoice_upcoming_noneZlivemode_mismatchZlock_timeoutmissingZ
no_accountZnot_allowed_on_standard_accountZout_of_inventoryZ!ownership_declaration_not_allowedZparameter_invalid_emptyZparameter_invalid_integerZparameter_invalid_string_blankZparameter_invalid_string_emptyZparameter_missingZparameter_unknownZparameters_exclusiveZpayment_intent_action_requiredZ%payment_intent_authentication_failureZ*payment_intent_incompatible_payment_methodZ payment_intent_invalid_parameterZ3payment_intent_konbini_rejected_confirmation_numberZpayment_intent_mandate_invalidZ&payment_intent_payment_attempt_expiredZ%payment_intent_payment_attempt_failedZpayment_intent_unexpected_stateZ,payment_method_bank_account_already_verifiedZ#payment_method_bank_account_blockedZ.payment_method_billing_details_address_missingZ%payment_method_configuration_failuresZ payment_method_currency_mismatchZpayment_method_customer_declineZ payment_method_invalid_parameterZ)payment_method_invalid_parameter_testmodeZ"payment_method_microdeposit_failedZ8payment_method_microdeposit_verification_amounts_invalidZ9payment_method_microdeposit_verification_amounts_mismatchZ:payment_method_microdeposit_verification_attempts_exceededZApayment_method_microdeposit_verification_descriptor_code_mismatchZ0payment_method_microdeposit_verification_timeoutZpayment_method_not_availableZpayment_method_provider_declineZpayment_method_provider_timeoutZpayment_method_unactivatedZpayment_method_unexpected_stateZpayment_method_unsupported_typeZpayout_reconciliation_not_readyZpayouts_limit_exceededZpayouts_not_allowedZplatform_account_requiredZplatform_api_key_expiredZpostal_code_invalidr;   Zproduct_inactiveZ%progressive_onboarding_limit_exceededZ
rate_limitZrefer_to_customerZrefund_disputed_paymentZresource_already_existsZresource_missingZreturn_intent_already_processedZrouting_number_invalidZsecret_key_requiredZsepa_unsupported_accountZsetup_attempt_failedZ#setup_intent_authentication_failureZsetup_intent_invalid_parameterZsetup_intent_mandate_invalidZ"setup_intent_setup_attempt_expiredZsetup_intent_unexpected_stateZshipping_calculation_failedZsku_inactiveZstate_unsupportedZstatus_transition_invalidZstripe_tax_inactiveZtax_id_invalidZtaxes_calculation_failedZ%terminal_location_country_unsupportedZterminal_reader_busyZterminal_reader_hardware_faultZterminal_reader_offlineZterminal_reader_timeoutZtestmode_charges_onlyZtls_version_unsupportedZtoken_already_usedZtoken_card_network_invalidZtoken_in_useZ+transfer_source_balance_parameters_mismatchZtransfers_not_allowedZurl_invalidcodeZdecline_codeZdoc_urlmessageparamr   Zpayment_intentr   payment_methodZpayment_method_typeZrequest_log_urlr   setup_intent)r   r   CardResourcer   source)Z	api_errorZ
card_errorZidempotency_errorZinvalid_request_errorrE   N)r   r   r   r	   r3   r4   r   r
   r    r    r    r!   
SetupError  s.   
 )rp   c                   @   sR   e Zd ZU ed ed< ed ed< ed ed< ed ed< eed	< ed ed
< dS )SetupAttempt.ListParamsz"SetupAttempt.ListParamsCreated|intcreatedr3   Zending_beforez	List[str]expandrN   limitrm   Zstarting_afterN)r   r   r   r   r4   r3   r    r    r    r!   
ListParams  s   
ru   c                   @   s>   e Zd ZU ed ed< ed ed< ed ed< ed ed< dS )zSetupAttempt.ListParamsCreatedrN   gtZgteltZlteN)r   r   r   r   r4   r    r    r    r!   ListParamsCreated  s
   
rx   r   ZapplicationZattach_to_selfrr   r   Zcustomer)ZinboundZoutboundZflow_directionsidZlivemodeobjectr   Zon_behalf_ofr   rl   payment_method_detailssetup_errorr   rm   statususageNrq   )api_keystripe_versionstripe_accountparamsreturnc                 K   s:   | j d|  ||||d}t|ts6tdt|j |S )z]
        Returns a list of SetupAttempts that associate with a provided SetupIntent.
        get)r   r   r   r   z%Expected list object from API, got %s)Z_static_requestZ	class_url
isinstancer   	TypeErrorrE   r   )clsr   r   r   r   r<   r    r    r!   list  s    
zSetupAttempt.list)r{   r|   )NNN)r   r   r   __doc__r   r   r   r4   r   rg   rp   r   ru   r   rx   r	   r   boolrN   r   r3   classmethodr   r   r   rF   r    r    r    r!   r      sR   
  j     r   N)+Zstripe.api_resources.abstractr   Z%stripe.api_resources.expandable_fieldr   Z stripe.api_resources.list_objectr   Zstripe.request_optionsr   Zstripe.stripe_objectr   typingr   r   r	   r
   Ztyping_extensionsr   r   r   r   r   Zstripe.api_resources.accountr   Z stripe.api_resources.applicationr   Z!stripe.api_resources.bank_accountr   Zstripe.api_resources.cardr   rn   Zstripe.api_resources.customerr   Zstripe.api_resources.mandater   Z#stripe.api_resources.payment_intentr   Z#stripe.api_resources.payment_methodr   Z!stripe.api_resources.setup_intentr   Zstripe.api_resources.sourcer   r   r    r    r    r!   <module>   s$   