
    +h                     :    d dl mZmZmZ d dlmZ  G d de      Zy)    )api_requestorconnect_api_baseerror)	urlencodec                   R    e Zd Zed        Zedd       Zedd       Zedd       Zy)OAuthc                 R    d| v ry ddl m} |r|| d<   y t        j                  d      )N	client_idr   )r
   ax  No client_id provided. (HINT: set your client_id using "stripe.client_id = <CLIENT-ID>"). You can find your client_ids in your Stripe dashboard at https://dashboard.stripe.com/account/applications/settings, after registering your account as a platform. See https://stripe.com/docs/connect/standalone-accounts for details, or email support@stripe.com if you have any questions.)striper
   r   AuthenticationError)paramsr
   s     ?/var/www/html/venv/lib/python3.12/site-packages/stripe/oauth.py_set_client_idzOAuth._set_client_id   s9    & $"+F;''E
 	
    c                     | du rd}nd}t         j                  |       d|vrd|d<   t        t        t	        j
                  |                  }t        |z   dz   |z   }|S )NFz/oauth/authorizez/express/oauth/authorizeresponse_typecode?)r   r   r   listr   _api_encoder   )expressr   pathqueryurls        r   authorize_urlzOAuth.authorize_url   sg    e%D-DV$&(&,F?#$}88@AB%+e3
r   Nc                 ~    t        j                  | t              }|j                  dd|d       \  }}|j                  S )Napi_basepostz/oauth/token)r   APIRequestorr   requestdataapi_keyr   	requestorresponse_s        r   tokenzOAuth.token)   s>    !...
	  ''M!}}r   c                     t        j                  | t              }t        j	                  |       |j                  dd|d       \  }}|j                  S )Nr   r   z/oauth/deauthorize)r   r    r   r   r   r!   r"   r#   s        r   deauthorizezOAuth.deauthorize1   sR    !...
	 	V$''(&$
! }}r   )F)N)__name__
__module____qualname__staticmethodr   r   r(   r*    r   r   r   r      sP    
 
(      r   r   N)r   r   r   r   urllib.parser   objectr   r/   r   r   <module>r2      s    9 9 "5F 5r   