
    +hV                         d dl mZ 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 d dlmZ d dlmZ d d	lmZmZmZmZmZmZmZ d d
lmZmZmZ d dlmZ erd dl m!Z!  G d ded   ed   e      Z"y)    )error)DeletableAPIResourceUpdateableAPIResourceVerifyMixin)Account)Customer)ExpandableField)RequestOptions)StripeObject)class_method_variant)ClassVarDictListOptionalUnioncastoverload)LiteralUnpackTYPE_CHECKING)
quote_plus)Cardc            	          e Zd ZU dZdZeed      ed<    G d de      Z	 G d de      Z
er G d d	e      Zeed
      ed<   	 ee   ed<   	 ee   ed<   	 ee   ed<   	 eeed         ed<   	 ee   ed<   	 eed<   	 eed<   	 eed      ed<   	 ee   ed<   	 ee   ed<   	 ee	   ed<   	 eed<   	 eed<   	 eeeef      ed<   	 ed   ed<   	 ee
   ed<   	 ee   ed<   	 eed<   	 eed       ed!<   	 ed"ed#ed$   d%ed&   fd'       Zeed"ed#ed$   d%ed&   fd(              Zed#ed$   d%ed&   fd)       Z ed*      d#ed$   d%ed&   fd+       Zd, Zed-        Ze	 	 	 d1d/       Ze	e
d0Zy.)2BankAccounta  
    These bank accounts are payment methods on `Customer` objects.

    On the other hand [External Accounts](https://stripe.com/docs/api#external_accounts) are transfer
    destinations on `Account` objects for [Custom accounts](https://stripe.com/docs/connect/custom-accounts).
    They can be bank accounts or debit cards as well, and are documented in the links above.

    Related guide: [Bank debits and transfers](https://stripe.com/docs/payments/bank-debits-transfers)
    bank_accountOBJECT_NAMEc                       e Zd ZU  G d de      Zeee      ed<   	 eee      ed<   	 eee      ed<   	 eee      ed<   	 deiZ	y)BankAccount.FutureRequirementsc                   6    e Zd ZU ed   ed<   	 eed<   	 eed<   y)$BankAccount.FutureRequirements.ErrorW&invalid_address_city_state_postal_code$invalid_address_highway_contract_boxinvalid_address_private_mailboxinvalid_business_profile_name(invalid_business_profile_name_denylistedinvalid_company_name_denylistedinvalid_dob_age_over_maximuminvalid_dob_age_under_18invalid_dob_age_under_minimum"invalid_product_description_length%invalid_product_description_url_matchinvalid_representative_country.invalid_statement_descriptor_business_mismatch'invalid_statement_descriptor_denylisted#invalid_statement_descriptor_length.invalid_statement_descriptor_prefix_denylisted,invalid_statement_descriptor_prefix_mismatchinvalid_street_addressinvalid_tax_idinvalid_tax_id_formatinvalid_tos_acceptanceinvalid_url_denylistedinvalid_url_formatinvalid_url_length!invalid_url_web_presence_detected1invalid_url_website_business_information_mismatchinvalid_url_website_empty invalid_url_website_inaccessible+invalid_url_website_inaccessible_geoblocked3invalid_url_website_inaccessible_password_protectedinvalid_url_website_incomplete2invalid_url_website_incomplete_cancellation_policy7invalid_url_website_incomplete_customer_service_details1invalid_url_website_incomplete_legal_restrictions,invalid_url_website_incomplete_refund_policy,invalid_url_website_incomplete_return_policy3invalid_url_website_incomplete_terms_and_conditions1invalid_url_website_incomplete_under_constructioninvalid_url_website_otherinvalid_value_otherverification_directors_mismatch&verification_document_address_mismatch%verification_document_address_missingverification_document_corrupt+verification_document_country_not_supported(verification_document_directors_mismatch"verification_document_dob_mismatch$verification_document_duplicate_typeverification_document_expired!verification_document_failed_copy&verification_document_failed_greyscale"verification_document_failed_other&verification_document_failed_test_mode verification_document_fraudulent(verification_document_id_number_mismatch'verification_document_id_number_missing verification_document_incompleteverification_document_invalid2verification_document_issue_or_expiry_date_missing!verification_document_manipulated"verification_document_missing_back#verification_document_missing_front#verification_document_name_mismatch"verification_document_name_missing*verification_document_nationality_mismatch"verification_document_not_readable verification_document_not_signed"verification_document_not_uploaded$verification_document_photo_mismatchverification_document_too_large(verification_document_type_not_supported!verification_extraneous_directors!verification_failed_address_match'verification_failed_business_iec_number"verification_failed_document_match#verification_failed_id_number_match"verification_failed_keyed_identityverification_failed_keyed_matchverification_failed_name_matchverification_failed_other'verification_failed_residential_address verification_failed_tax_id_match%verification_failed_tax_id_not_issuedverification_missing_directorsverification_missing_executivesverification_missing_owners;verification_requires_additional_memorandum_of_associationscodereasonrequirementN__name__
__module____qualname__r   __annotations__str     T/var/www/html/venv/lib/python3.12/site-packages/stripe/api_resources/bank_account.pyErrorr    )   7    VOX Xr K r   r   currently_dueerrorspast_duepending_verificationN
r}   r~   r   r   r   r   r   r   r   _inner_class_typesr   r   r   FutureRequirementsr   (   v    d	L d	L  S	**	 e%%	 49%%	 'tCy11	 '.r   r   c                       e Zd ZU  G d de      Zeee      ed<   	 eee      ed<   	 eee      ed<   	 eee      ed<   	 deiZ	y)BankAccount.Requirementsc                   6    e Zd ZU ed   ed<   	 eed<   	 eed<   y)BankAccount.Requirements.Errorr!   ry   rz   r{   Nr|   r   r   r   r   r      r   r   r   r   r   r   r   Nr   r   r   r   Requirementsr      r   r   r   c                       e Zd Zy)BankAccount.DeleteParamsN)r}   r~   r   r   r   r   DeleteParamsr     s    r   r   r   accountaccount_holder_nameaccount_holder_typeaccount_type)instantstandardavailable_payout_methods	bank_namecountrycurrencyr   customerdefault_for_currencyfingerprintfuture_requirementsidlast4metadataobjectrequirementsrouting_numberstatusTdeletedsidparamsr   returnr   r   c                     | j                         dt        |      }t        t        d   | j	                  d||            S )J
        Delete a specified external account for a given account.
        /r   deleter   )	class_urlr   r   r   _static_request)clsr   r   urls       r   _cls_deletezBankAccount._cls_deleter  sC     *S/:'(#f=
 	
r   c                      yr   Nr   )r   r   s     r   r   zBankAccount.delete  s     	r   c                      yr   r   selfr   s     r   r   zBankAccount.delete  s     	r   r   c                 F    | j                  d| j                         |      S )r   r   r   )_request_and_refreshinstance_urlr   s     r   r   zBankAccount.delete  s.     (( ) 
 	
r   c                    | j                   }t        |      }t        | d      rN| j                  }t	        j
                         }|J t        |t              r|j                   }t        |      }d}nst        | d      rN| j                  }t        j
                         }|J t        |t              r|j                   }t        |      }d}nt        j                  d|z  d      |d|d|d|S )Nr   sourcesr   external_accountszWCould not determine whether bank_account_id %s is attached to a customer or an account.r   r   )r   r   hasattrr   r   r   
isinstancer   r   r   InvalidRequestError)r   tokenextnr   base
owner_extn
class_baser   s           r   r   zBankAccount.instance_url  s    % 4$}}H%%'D'''(H-#;;#H-J"JT9%llG$$&D&&&'7+!**#G,J,J ++8:?@  !%j*dCCr   c                     t        d      )Na`  Can't modify a bank account without a customer or account ID. Use stripe.Customer.modify_source('customer_id', 'bank_account_id', ...) (see https://stripe.com/docs/api/customer_bank_accounts/update) or stripe.Account.modify_external_account('customer_id', 'bank_account_id', ...) (see https://stripe.com/docs/api/external_account_bank_accounts/update).NotImplementedError)r   r   r   s      r   modifyzBankAccount.modify  s    !W
 	
r   Nc                     t        d      )Na_  Can't retrieve a bank account without a customer or account ID. Use stripe.customer.retrieve_source('customer_id', 'bank_account_id') (see https://stripe.com/docs/api/customer_bank_accounts/retrieve) or stripe.Account.retrieve_external_account('account_id', 'bank_account_id') (see https://stripe.com/docs/api/external_account_bank_accounts/retrieve).r   )r   r   api_keystripe_versionstripe_accountr   s         r   retrievezBankAccount.retrieve  s     "Y
 	
r   )r   r   )NNN) r}   r~   r   __doc__r   r   r   r   r   r   r   r   r
   r   r   r	   r   r   boolr   classmethodr   r   r   r   staticmethodr   r   r   r   r   r   r   r   r   r   r      s   
 6DK'.12Cw/\ w/rw/| w/r 	> 	 oi011 "#& "#& 3- 'tG4I,J'KLL } L M z233 #4.( # ""455 	G J tCH~&& N## <(( SM! K
 gdm$$ 



!'(B!C

	$	%

 

 "#=>	$	%   9:	$	%  -(

9:

	$	%

 )

D@ 
 
  
 
"  2$r   r   N)#striper   stripe.api_resources.abstractr   r   r   stripe.api_resources.accountr   stripe.api_resources.customerr   %stripe.api_resources.expandable_fieldr	   stripe.request_optionsr
   stripe.stripe_objectr   stripe.utilr   typingr   r   r   r   r   r   r   typing_extensionsr   r   r   urllib.parser   stripe.api_resources.cardr   r   r   r   r   <module>r      s_     
 1 2 A 1 - , H H H < < #.F'-(Fr   