a
    !fU                     @   s   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rd dl m!Z! G dd ded ed eZ"dS )    )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                   @   s  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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eed" ed# d$d%d&Zeeeed" ed# d$d'd(Zeed" ed# d)d*d(Zed+ed" ed# d)d,d(Zd-d. Zed/d0 Zed5d2d3Ze	e
d4Zd1S )6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)
    Zbank_accountOBJECT_NAMEc                   @   sf   e Zd ZU G d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	dS )zBankAccount.FutureRequirementsc                   @   s*   e Zd ZU ed ed< eed< eed< dS )z$BankAccount.FutureRequirements.ErrorWZ&invalid_address_city_state_postal_codeZ$invalid_address_highway_contract_boxZinvalid_address_private_mailboxZinvalid_business_profile_nameZ(invalid_business_profile_name_denylistedZinvalid_company_name_denylistedZinvalid_dob_age_over_maximumZinvalid_dob_age_under_18Zinvalid_dob_age_under_minimumZ"invalid_product_description_lengthZ%invalid_product_description_url_matchZinvalid_representative_countryZ.invalid_statement_descriptor_business_mismatchZ'invalid_statement_descriptor_denylistedZ#invalid_statement_descriptor_lengthZ.invalid_statement_descriptor_prefix_denylistedZ,invalid_statement_descriptor_prefix_mismatchZinvalid_street_addressZinvalid_tax_idZinvalid_tax_id_formatZinvalid_tos_acceptanceZinvalid_url_denylistedZinvalid_url_formatZinvalid_url_lengthZ!invalid_url_web_presence_detectedZ1invalid_url_website_business_information_mismatchZinvalid_url_website_emptyZ invalid_url_website_inaccessibleZ+invalid_url_website_inaccessible_geoblockedZ3invalid_url_website_inaccessible_password_protectedZinvalid_url_website_incompleteZ2invalid_url_website_incomplete_cancellation_policyZ7invalid_url_website_incomplete_customer_service_detailsZ1invalid_url_website_incomplete_legal_restrictionsZ,invalid_url_website_incomplete_refund_policyZ,invalid_url_website_incomplete_return_policyZ3invalid_url_website_incomplete_terms_and_conditionsZ1invalid_url_website_incomplete_under_constructionZinvalid_url_website_otherZinvalid_value_otherZverification_directors_mismatchZ&verification_document_address_mismatchZ%verification_document_address_missingZverification_document_corruptZ+verification_document_country_not_supportedZ(verification_document_directors_mismatchZ"verification_document_dob_mismatchZ$verification_document_duplicate_typeZverification_document_expiredZ!verification_document_failed_copyZ&verification_document_failed_greyscaleZ"verification_document_failed_otherZ&verification_document_failed_test_modeZ verification_document_fraudulentZ(verification_document_id_number_mismatchZ'verification_document_id_number_missingZ verification_document_incompleteZverification_document_invalidZ2verification_document_issue_or_expiry_date_missingZ!verification_document_manipulatedZ"verification_document_missing_backZ#verification_document_missing_frontZ#verification_document_name_mismatchZ"verification_document_name_missingZ*verification_document_nationality_mismatchZ"verification_document_not_readableZ verification_document_not_signedZ"verification_document_not_uploadedZ$verification_document_photo_mismatchZverification_document_too_largeZ(verification_document_type_not_supportedZ!verification_extraneous_directorsZ!verification_failed_address_matchZ'verification_failed_business_iec_numberZ"verification_failed_document_matchZ#verification_failed_id_number_matchZ"verification_failed_keyed_identityZverification_failed_keyed_matchZverification_failed_name_matchZverification_failed_otherZ'verification_failed_residential_addressZ verification_failed_tax_id_matchZ%verification_failed_tax_id_not_issuedZverification_missing_directorsZverification_missing_executivesZverification_missing_ownersZ;verification_requires_additional_memorandum_of_associationscodereasonrequirementN__name__
__module____qualname__r   __annotations__str r$   r$   b/var/www/html/python-backend/venv/lib/python3.9/site-packages/stripe/api_resources/bank_account.pyError)   s   
\r&   currently_dueerrorspast_duepending_verificationN
r   r    r!   r
   r&   r   r   r#   r"   _inner_class_typesr$   r$   r$   r%   FutureRequirements(   s   
fr-   c                   @   sf   e Zd ZU G d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	dS )zBankAccount.Requirementsc                   @   s*   e Zd ZU ed ed< eed< eed< dS )zBankAccount.Requirements.Errorr   r   r   r   Nr   r$   r$   r$   r%   r&      s   
\r&   r'   r(   r)   r*   Nr+   r$   r$   r$   r%   Requirements   s   
fr.   c                   @   s   e Zd ZdS )BankAccount.DeleteParamsN)r   r    r!   r$   r$   r$   r%   DeleteParams  s   r0   r   accountZaccount_holder_nameZaccount_holder_typeZaccount_type)ZinstantstandardZavailable_payout_methodsZ	bank_nameZcountrycurrencyr   customerZdefault_for_currencyfingerprintfuture_requirementsidZlast4metadataobjectrequirementsZrouting_numberstatusTZdeletedr/   r   r   )sidparamsreturnc                 K   s.   d|   t|f }ttd | jd||dS )J
        Delete a specified external account for a given account.
        z%s/%sr<   deleter>   )	class_urlr   r   r   Z_static_request)clsr=   r>   urlr$   r$   r%   _cls_deletep  s
    zBankAccount._cls_deletec                 K   s   dS r@   Nr$   )r=   r>   r$   r$   r%   rA   }  s    zBankAccount.delete)r>   r?   c                 K   s   dS rG   r$   selfr>   r$   r$   r%   rA     s    rF   c                 K   s   | j d|  |dS )r@   rA   rB   )Z_request_and_refreshinstance_urlrH   r$   r$   r%   rA     s
    c                 C   s   | j }t|}t| drP| j}t }|d us2J t|trB|j }t|}d}nRt| dr| j}t }|d ustJ t|tr|j }t|}d}nt	
d| dd||||f S )Nr4   sourcesr1   Zexternal_accountszWCould not determine whether bank_account_id %s is attached to a customer or an account.r7   z%s/%s/%s/%s)r7   r   hasattrr4   r   rC   
isinstancer1   r   r   ZInvalidRequestError)rI   tokenZextnr4   baseZ
owner_extnZ
class_baser1   r$   r$   r%   rJ     s2    



zBankAccount.instance_urlc                 K   s   t dd S )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)rD   r=   r>   r$   r$   r%   modify  s    zBankAccount.modifyNc                 K   s   t dd S )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).rP   )rD   r7   Zapi_keyZstripe_versionZstripe_accountr>   r$   r$   r%   retrieve  s    	zBankAccount.retrieve)r6   r:   )NNN)r   r    r!   __doc__r   r   r   r"   r
   r-   r.   r	   r0   r   r   r#   r   boolr   classmethodr   r   rF   r   staticmethodrA   r   rJ   rR   rS   r,   r$   r$   r$   r%   r      sj   

yy 
	   r   N)#Zstriper   Zstripe.api_resources.abstractr   r   r   Zstripe.api_resources.accountr   Zstripe.api_resources.customerr   Z%stripe.api_resources.expandable_fieldr   Zstripe.request_optionsr	   Zstripe.stripe_objectr
   Zstripe.utilr   typingr   r   r   r   r   r   r   Ztyping_extensionsr   r   r   urllib.parser   Zstripe.api_resources.cardr   r   r$   r$   r$   r%   <module>   s"   $
