o
    iy                     @   s   d dl mZ d dlmZmZmZ d dlmZmZm	Z	 e	r4d 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 )    )CreateableAPIResource)ClassVarOptionalcast)LiteralUnpackTYPE_CHECKING)BankAccount)Card)TokenCreateParams)TokenRetrieveParamsc                   @   s   e Zd ZU dZdZeed  ed< ed ed< 	 ed ed< 	 ee	 ed< 	 e
ed	< 	 e	ed
< 	 eed< 	 ed ed< 	 e	ed< 	 eed< 	 eded dd fddZeded dd fddZed
e	ded dd fddZed
e	ded dd fddZdS )Tokena  
    Tokenization is the process Stripe uses to collect sensitive card or bank
    account details, or personally identifiable information (PII), directly from
    your customers in a secure manner. A token representing this information is
    returned to your server to use. Use our
    [recommended payments integrations](https://stripe.com/docs/payments) to perform this process
    on the client-side. This guarantees that no sensitive card data touches your server,
    and allows your integration to operate in a PCI-compliant way.

    If you can't use client-side tokenization, you can also create tokens using
    the API with either your publishable or secret API key. If
    your integration uses this method, you're responsible for any PCI compliance
    that it might require, and you must keep your secret API key safe. Unlike with
    client-side tokenization, your customer's information isn't sent directly to
    Stripe, so we can't determine how it's handled or stored.

    You can't store or use tokens more than once. To store card or bank account
    information for later use, create [Customer](https://stripe.com/docs/api#customers)
    objects or [External accounts](https://docs.stripe.com/api#external_accounts).
    [Radar](https://stripe.com/docs/radar), our integrated solution for automatic fraud protection,
    performs best with integrations that use client-side tokenization.
    tokenOBJECT_NAMEr	   bank_accountr
   card	client_ipcreatedidlivemodeobjecttypeusedparamsr   returnc                 K   s   t d| jd|  |dS )  
        Creates a single-use token that represents a bank account's details.
        You can use this token with any v1 API method in place of a bank account dictionary. You can only use this token once. To do so, attach it to a [connected account](https://docs.stripe.com/api#accounts) where [controller.requirement_collection](https://docs.stripe.com/api/accounts/object#account_object-controller-requirement_collection) is application, which includes Custom accounts.
        r   postr   )r   _static_request	class_urlclsr    r"   m/var/www/snowflake_co_dev_github/snow_flake_back_end_deploy/env/lib/python3.10/site-packages/stripe/_token.pycreateV   s   zToken.createc                    s"   t d| jd|  |dI dH S )r   r   r   r   N)r   _static_request_asyncr   r    r"   r"   r#   create_asynce   s   
zToken.create_asyncr   c                 K   s   | |fi |}|   |S )8
        Retrieves the token with the given ID.
        )refreshr!   r   r   instancer"   r"   r#   retrievev   s   zToken.retrievec                    s$   | |fi |}|  I dH  |S )r'   N)refresh_asyncr)   r"   r"   r#   retrieve_async   s   zToken.retrieve_asyncN)__name__
__module____qualname____doc__r   r   r   __annotations__r   strintboolclassmethodr   r$   r&   r+   r-   r"   r"   r"   r#   r      sZ   
 	
r   N)stripe._createable_api_resourcer   typingr   r   r   typing_extensionsr   r   r   stripe._bank_accountr	   stripe._cardr
   "stripe.params._token_create_paramsr   $stripe.params._token_retrieve_paramsr   r   r"   r"   r"   r#   <module>   s   