o
    Bi'1                     @   s  d dl Z 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mZ d dlmZ d dlmZmZmZ d d	lmZ d d
lmZmZ 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, d dl-m.Z. d dl/m0Z0 d dl1m2Z2 d dl3m4Z4 d dl5m6Z6 d dl7m8Z8 d dl9m:Z: d dl;m<Z< d dl=m>Z> d dl?m@Z@ d dlAmBZB d dlCmDZD d d lEmFZF d d!lGmHZH d d"lImJZJ d d#lKmLZL d d$lMmNZN d d%lOmPZP d d&lQmRZR d d'lSmTZT d d(lUmVZV d d)lWmXZX d d*lYmZZZ d d+l[m\Z\ d d,l]m^Z^ d d-l_m`Z` d d.lambZb d d/lcmdZd d d0lemfZf d d1lgmhZh d d2limjZj d d3lkmlZl d d4lmmnZn d d5lompZp d d6lqmrZr d d7lsmtZt d d8lumvZv d d9lwmxZx d d:lymzZz d d;l{m|Z| d d<l}m~Z~ d d=lmZ d d>lmZ d d?lmZ d d@lmZ d dAlmZ d dBlmZ d dClmZ d dDlmZ d dElmZ d dFlmZ d dGlmZ d dHlmZ d dIlmZ d dJlmZ d dKlmZ d dLlmZ d dMlmZ d dNlmZ d dOlmZ d dPlmZ d dQlmZ G dRdS dSeZdS )T    N)OrderedDict)DEFAULT_API_BASEDEFAULT_CONNECT_API_BASEDEFAULT_UPLOAD_API_BASE)AuthenticationError)_APIRequestor)RequestorOptionsBaseAddresses)_ClientOptions)
HTTPClientnew_default_http_clientnew_http_client_async_fallback)_ApiVersion)WebhookWebhookSignature)Event)OptionalUnioncast)OAuthService)AccountService)AccountLinkService)AccountSessionService)ApplePayDomainService)ApplicationFeeService)AppsService)BalanceService)BalanceTransactionService)BillingService)BillingPortalService)ChargeService)CheckoutService)ClimateService)ConfirmationTokenService)TestHelpersService)CountrySpecService)CouponService)CreditNoteService)CustomerService)CustomerSessionService)DisputeService)EntitlementsService)EphemeralKeyService)EventService)ExchangeRateService)FileService)FileLinkService)FinancialConnectionsService)ForwardingService)IdentityService)InvoiceService)InvoiceRenderingTemplateService)InvoiceItemService)IssuingService)MandateService)PaymentIntentService)PaymentLinkService)PaymentMethodService)!PaymentMethodConfigurationService)PaymentMethodDomainService)PayoutService)PlanService)PriceService)ProductService)PromotionCodeService)QuoteService)RadarService)RefundService)ReportingService)ReviewService)SigmaService)SetupAttemptService)SetupIntentService)ShippingRateService)SourceService)SubscriptionService)SubscriptionItemService)SubscriptionScheduleService)
TaxService)TaxCodeService)TaxIdService)TaxRateService)TerminalService)TokenService)TopupService)TransferService)TreasuryService)WebhookEndpointServicec                   @   s   e Zd Zddi dddddddedee dee dedee d	ed
ee dee dee fddZ	e
jfdeeef dedededef
ddZdS )StripeClientNT)stripe_accountstripe_versionbase_addresses	client_idverify_ssl_certsproxymax_network_retrieshttp_clientapi_keyr[   r\   r]   r^   r_   r`   ra   rb   c                C   s  |d u rt d|	r|s|durtdtttd|}t|||p#tj||d}
|	d u r7tt	||d||d}	t
|
|	d| _t|||d	| _t| j| j| _t| j| _t| j| _t| j| _t| j| _t| j| _t| j| _t| j| _t| j| _t | j| _!t"| j| _#t$| j| _%t&| j| _'t(| j| _)t*| j| _+t,| j| _-t.| j| _/t0| j| _1t2| j| _3t4| j| _5t6| j| _7t8| j| _9t:| j| _;t<| j| _=t>| j| _?t@| j| _AtB| j| _CtD| j| _EtF| j| _GtH| j| _ItJ| j| _KtL| j| _MtN| j| _OtP| j| _QtR| j| _StT| j| _UtV| j| _WtX| j| _YtZ| j| _[t\| j| _]t^| j| __t`| j| _atb| j| _ctd| j| _etf| j| _gth| j| _itj| j| _ktl| j| _mtn| j| _otp| j| _qtr| j| _stt| j| _utv| j| _wtx| j| _ytz| j| _{t|| j| _}t~| j| _t| j| _t| j| _t| j| _t| j| _t| j| _t| j| _t| j| _t| j| _t| j| _t| j| _t| j| _t| j| _d S )
NzNo API key provided. (HINT: set your API key using "client = stripe.StripeClient(<API-KEY>)"). You can generate API keys from the Stripe web interface. See https://stripe.com/api for details, or email support@stripe.com if you have any questions.TzYou cannot specify `proxy` or `verify_ssl_certs` when passing in a custom `http_client`. Please set these values on your custom `http_client` instead.)apiconnectfiles)rc   r[   r\   r]   ra   )r`   r_   )async_fallback_clientr`   r_   )optionsclient)r^   r`   r_   )r   
ValueErrorr   r   r   r   r   CURRENTr   r   r   
_requestorr
   _optionsr   oauthr   accountsr   account_linksr   account_sessionsr   apple_pay_domainsr   application_feesr   appsr   balancer   balance_transactionsr   billingr   billing_portalr    chargesr!   checkoutr"   climater#   confirmation_tokensr$   test_helpersr%   country_specsr&   couponsr'   credit_notesr(   	customersr)   customer_sessionsr*   disputesr+   entitlementsr,   ephemeral_keysr-   eventsr.   exchange_ratesr/   rf   r0   
file_linksr1   financial_connectionsr2   
forwardingr3   identityr4   invoicesr5   invoice_rendering_templatesr6   invoice_itemsr7   issuingr8   mandatesr9   payment_intentsr:   payment_linksr;   payment_methodsr<   payment_method_configurationsr=   payment_method_domainsr>   payoutsr?   plansr@   pricesrA   productsrB   promotion_codesrC   quotesrD   radarrE   refundsrF   	reportingrG   reviewsrH   sigmarI   setup_attemptsrJ   setup_intentsrK   shipping_ratesrL   sourcesrM   subscriptionsrN   subscription_itemsrO   subscription_schedulesrP   taxrQ   	tax_codesrR   tax_idsrS   	tax_ratesrT   terminalrU   tokensrV   topupsrW   	transfersrX   treasuryrY   webhook_endpoints)selfrc   r[   r\   r]   r^   r_   r`   ra   rb   requestor_options r   U/var/www/html/Trade-python/venv/lib/python3.10/site-packages/stripe/_stripe_client.py__init__k   s   	zStripeClient.__init__payload
sig_headersecret	tolerancereturnc                 C   sN   t |drtt|d}t|||| tj|td}t	j
|| jdd}|S )Ndecodezutf-8)object_pairs_hookV1)values	requestorapi_mode)hasattrr   bytesr   r   verify_headerjsonloadsr   r   _construct_fromrl   )r   r   r   r   r   dataeventr   r   r   construct_event  s   
zStripeClient.construct_event)__name__
__module____qualname__strr   r	   boolintr   r   r   DEFAULT_TOLERANCEr   r   r   r   r   r   r   r   rZ   j   sR    	

 
rZ   )r   collectionsr   striper   r   r   stripe._errorr   stripe._api_requestorr   stripe._requestor_optionsr   r	   stripe._client_optionsr
   stripe._http_clientr   r   r   stripe._api_versionr   stripe._webhookr   r   stripe._eventr   typingr   r   r   stripe._oauth_servicer   stripe._account_servicer   stripe._account_link_servicer   stripe._account_session_servicer    stripe._apple_pay_domain_servicer   stripe._application_fee_servicer   stripe._apps_servicer   stripe._balance_servicer   #stripe._balance_transaction_servicer   stripe._billing_servicer   stripe._billing_portal_servicer   stripe._charge_servicer    stripe._checkout_servicer!   stripe._climate_servicer"   "stripe._confirmation_token_servicer#   stripe._test_helpers_servicer$   stripe._country_spec_servicer%   stripe._coupon_servicer&   stripe._credit_note_servicer'   stripe._customer_servicer(    stripe._customer_session_servicer)   stripe._dispute_servicer*   stripe._entitlements_servicer+   stripe._ephemeral_key_servicer,   stripe._event_servicer-   stripe._exchange_rate_servicer.   stripe._file_servicer/   stripe._file_link_servicer0   %stripe._financial_connections_servicer1   stripe._forwarding_servicer2   stripe._identity_servicer3   stripe._invoice_servicer4   *stripe._invoice_rendering_template_servicer5   stripe._invoice_item_servicer6   stripe._issuing_servicer7   stripe._mandate_servicer8   stripe._payment_intent_servicer9   stripe._payment_link_servicer:   stripe._payment_method_servicer;   ,stripe._payment_method_configuration_servicer<   %stripe._payment_method_domain_servicer=   stripe._payout_servicer>   stripe._plan_servicer?   stripe._price_servicer@   stripe._product_servicerA   stripe._promotion_code_servicerB   stripe._quote_servicerC   stripe._radar_servicerD   stripe._refund_servicerE   stripe._reporting_servicerF   stripe._review_servicerG   stripe._sigma_servicerH   stripe._setup_attempt_servicerI   stripe._setup_intent_servicerJ   stripe._shipping_rate_servicerK   stripe._source_servicerL   stripe._subscription_servicerM   !stripe._subscription_item_servicerN   %stripe._subscription_schedule_servicerO   stripe._tax_servicerP   stripe._tax_code_servicerQ   stripe._tax_id_servicerR   stripe._tax_rate_servicerS   stripe._terminal_servicerT   stripe._token_servicerU   stripe._topup_servicerV   stripe._transfer_servicerW   stripe._treasury_servicerX    stripe._webhook_endpoint_servicerY   objectrZ   r   r   r   r   <module>   s   